SEM: Cross-lagged model on 5 waves with fixed effects

248 Views Asked by At

I have currently run a cross-lagged model on 5 waves to answer the question does depression affect self-esteem, or does self-esteem affect depression, using the following code:

sem (depression2 <- depression1 inattention1) ///
    (depression <- depression2 selfesteem2) ///
    (depression4 <- depression3 selfesteem3) ///
    (depression5 <- depression4 selfesteem4) ///
    (selfesteemn2 <- selfesteem1 depression1) ///
    (selfesteem3 <- selfesteem2 depression2) ///
    (selfesteem4 <- selfesteem3 depression3) ///
    (selfesteem5 <- selfesteem4 depression4), ///
    method(mlmv) standardized ///
    cov(e.depression2*e.selfesteem2 e.depression3*e.selfesteem3 e.depression4*e.selfesteem4 e.depression5*e.selfesteem)

This all went well; however, I would like to include fixed effect of gender and IQ and I have absolutely no clue how to do it. I found some slides by Paul Allison that were cut off at the point where he was supposed to explain how to do this. Can anyone advise me how to achieve this?

1

There are 1 best solutions below

2
On

You will need to include a new regression before the comma with the fixed effects. Something like this could work:

(gender IQ -> depression depression2 depression3 depression4 depression5) ///
(gender IQ -> selfesteemn2 selfesteem3 selfesteem4 selfesteem5) ///

Keep in mind that sem doesn't accept the i. notation natively, so you will have to generate indicator variables for categorical variables using xi: like this:

xi: sem (IQ <- i.subgroup)