# SEM with categorical complex survey data adjusting for cluster effect

My data comes from a two stage stratified cluster sample. There are some categorical (ordinal) manifest (dependent/endogenous) variables. I believe these variables can be divided into three major groups and are manifested by three factors, such as 'economic independence', 'self-esteem' etc. which can also be related to each other. Some covariates and independent factors are also there which are supposed to be associated with these latent variables and manifest variables. I want to adjust for clustering and check for some statistical causal relationships among the latent factors and variables. As the data are supposed to have clustering, I want to adjust for the cluster effect as well. Could you tell me about the issues I should consider regarding such an analysis? I suppose there can also be a stratum effect.

I wanted to perform Structural Equation Modelling (SEM) with categorical survey data. I found gsem function in Stata that can do it. But it takes too long, and I even wonder if it can handle complicated analysis with many variables. I also observe that it has some memory usage problem. If I want to account for clustering, survey nature of the data and at the same time want to perform SEM with some categorical variables, is there any other software available? Sections & Interest Groups suggests Mplus supports only continuous variables. I have also checked laavan-survey package in R. But that also only supports continuous data. Please correct me if I am wrong.

• This probably belongs on Software Recommendations, not here. Can you clarify your situation, though? What are your data? Are you trying to do something like latent class analysis? Feb 5 '16 at 21:55
• My data contains several categorical variables and I have assumption that these variables are manifested by some latent factors. I also have some covariates. The data comes from a two stage stratified cluster survey. I have an assumption that there might be cluster level homogeneity and I want to adjust for that. It seems like Stata takes too long and I don't know about any other software that deals with both categorical and survey data. Since people who knows SEM are likely to answer and I found a tag called software recommendation, so I posted it. Should I take my question to that site? Feb 6 '16 at 2:55
• What is the nature of the latent factor? Is it categorical? I am sympathetic to the idea that more people here will know SEM, eg, but asking for software is off topic (the tag notwithstanding) and there is an SE site for software recommendations. This probably belongs there unless reformulated as a statistical question (which I do see as possible). Feb 6 '16 at 8:08
• There are two latent factors like self-esteem and economic independence. Should we treat these as categorical? I think every categorical latent factor has some underlying continuous process. The manifest variables are all categorical (ordinal to be exact). Feb 6 '16 at 8:36
• Those are questions that are on topic here. There can be categorical latent variables just as continuous; you are theorizing continuous LVs. I think your situation is fairly common & regular SEM software should be able to handle it. Typically, people treat the ordinal variables as continuous rather than categorical (by using polychoric correlations eg). I would reformulate your question as how to understand & conduct your analysis in a software-neutral way: describe the study, the sampling scheme, the variables, your theoretical model etc. (It's possible you'll get software guidance anyway.) Feb 6 '16 at 9:00

You can fit a SEM model, while accounting for weights, stratification and the full sampling design if you have enough information from the survey data. If you use MPLUS you can fit a SEM model with either binary, ordinal, nominal or continuous indicators. You can check the following MPLUS note to see some common specifications for complex sample survey.
Not sure if lavaan.survey can handle ordinal/categorical variables, yet lavaan can fit SEM with ordinal/categorical indicators, using a WLSMV estimator. Since the first depends on the second, I wouldn't be surprise if you can fit a SEM/path model with ordinal indicators.
I haven't used gsem in STATA so cannot comment on that option.