My goal is to use and understand GSEM, both the builder and the syntax. I'm doing a path analysis to determine the mediation effects of a number of variables. My dependent variable is ordinal, as is the main independent variable, and there are three mediating variables that are either binary, continuous or ordinal. Using GSEM syntax, I write the model like this:
gsem (fi4<-i.sc2 i.health c.town i.retired, family(ordinal) link(logit)) (retired<-i.sc2, family(binomial) link(logit)) (town<-i.sc2) (health<-i.sc2, family(binomial) link(logit)) if sex==1 [pweight=static_weight_v3]
...where fi4 is the DV, sc2 is the 'main' IV and the other variables (health, town, retired) are mediators. Obviously, when I run this command the output reports coefficients for each level of the relationship between an IV and the DV, e.g. I get a coefficient for 1.sc2's effect on fi4, a separate one for 2.sc2 etc. However, using the GSEM builder, I can't work out how to add each categorical variable level to the plot separately, only the 'full' variable (i.e. sc2, not 1.sc2). To calculate the mediation indirect and direct effects, I need each separate path coefficient, not an overall coefficient for the ordinal variable. Am I misunderstanding something? Levels of categorical variables do not appear in the drop-down list from which I select the variable I wish to add, only the list of variables in the main data. Grateful for any help here, I realise it may be a silly question!
Related Posts with Using categorical independent variables in GSEM builder
How to treat missing dataHi, I am using panel data with the variables Stock_id, date2, price, revenue_M, DE, and TA_M where p…
Generating a new ID variable accounting for gaps in timeDear Statalist community, my question aims on how to generate a new identifier variable in a panel …
Creating additional rows to match dates in column 2 and 3Hi, I am working on recurrent events analysis. I have to merge two data sets. The first data set has…
Difference-in-differences analysis, pre-trend fixed-effects by groupHi all, I have been advised by my mentor to incorporate pre-trend fixed-effects that are country-sp…
Panel Data: Rolling window; fixed effects regression; saving coefficients and predicted residualsHi, I have an unbalanced panel dataset with daily (financial) data for ±500 companies. The followi…
Subscribe to:
Post Comments (Atom)
0 Response to Using categorical independent variables in GSEM builder
Post a Comment