Dear all,
I am attempting to run a multilevel mediation model with the ‘gsem’ command on Stata 14.0 (Windows 10).
I am using a two-level data where individuals (protesters) are nested into demonstrations. I am trying to assess if individual (e.g. previous violent political behavior) and contextual (e.g. demonstration’s size) predictors influence demonstrations’ atmosphere (±tense according to the demonstrators’ perception of their interaction with the police). This is my X -> Y path (Xs: continuous and categorical, Y: binary, Multilevel variable: demonstrations IDs.
The crucial hypothesis of the study is that the Xs at the second level influence the police presence (M) and then tense the demonstrations (Y). This is my X -> M -> Y path where M is a binary variable at level 2. However, the Xs are at level 1 and 2 while Y is at level1.
The schema attached summarizes the data structure and the paths.
In a basic rationale, I thought that it was not necessary to specify a multilevel for the relationship between X and M because … there is only one level (thus I acted as if it was a simple one level logit regression). But I specified a latent variable on the others relationships (random intercept) explaining the atmosphere (Y). I am not sure that the following command is the right way to test my model.
First: Is it the right way? Is there something missing or wrong? Should I specify other things?
Second: How to compute indirect effects? Is the following command correct? (It is based on nonlinear combination of estimators)
Third: ‘Y’ is zero-inflated (‘0’ n=9668 ; ‘1’ n=582 - at level1). Should I specify another family and link (e.g. negative binomial or poisson) ?
I have already check this post but unfortunately there is no response : http://www.statalist.org/forums/foru...mes-at-level-2
Thank you.
Adrien.
I am attempting to run a multilevel mediation model with the ‘gsem’ command on Stata 14.0 (Windows 10).
I am using a two-level data where individuals (protesters) are nested into demonstrations. I am trying to assess if individual (e.g. previous violent political behavior) and contextual (e.g. demonstration’s size) predictors influence demonstrations’ atmosphere (±tense according to the demonstrators’ perception of their interaction with the police). This is my X -> Y path (Xs: continuous and categorical, Y: binary, Multilevel variable: demonstrations IDs.
The crucial hypothesis of the study is that the Xs at the second level influence the police presence (M) and then tense the demonstrations (Y). This is my X -> M -> Y path where M is a binary variable at level 2. However, the Xs are at level 1 and 2 while Y is at level1.
The schema attached summarizes the data structure and the paths.
In a basic rationale, I thought that it was not necessary to specify a multilevel for the relationship between X and M because … there is only one level (thus I acted as if it was a simple one level logit regression). But I specified a latent variable on the others relationships (random intercept) explaining the atmosphere (Y). I am not sure that the following command is the right way to test my model.
Code:
gsem (Y <- 0.X1 2.X1 i.X2 i.X3 i.X4 c.X5 i.X6 c.X7 c.X8 c.X9 i.X10 M1[M1] /// , family(binomial) link(logit)) /// (Y <- i.M M1[M1], family(binomial) link(logit)) /// (M <- 0.X1 2.X1 i.X2 i.X3 i.X4 c.X5 /// , family(binomial) link(logit)) /// , nocapslatent latent(M1) allbaselevels covstruct(_lexogenous, diagonal)
Second: How to compute indirect effects? Is the following command correct? (It is based on nonlinear combination of estimators)
Code:
nlcom _b[Y:1.M]*_b[M:2.X1] , post nlcom _b[Y:1.M]*_b[M:0.X1] , post nlcom _b[Y:1.M]*_b[M:1.X2] , post
I have already check this post but unfortunately there is no response : http://www.statalist.org/forums/foru...mes-at-level-2
Thank you.
Adrien.
Comment