James Algina posted on Wednesday, September 02, 2015 - 3:17 pm
Hello: In the following model dv and cov are dichotomous and have been declared in the categorical statement. trt and site are each coded -.5 and .5. trt varies at level 2 and site at level 3. The estimator is Bayes. It there a way to introduce a cov by trt interaction at both level-1 and level-2. MODEL: %within% dv on cov; %between tchid% TRT_DV | dv on trt; dv on Cov; %between schid% TRT_DV on site (TS); dv on site (S); Cov on site; dv WITH COV TRT_DV; COV WITH TRT_DV;
It looks like you are using a latent variable decomposition of the cov variable. If not intended, you should declare it as Within.
The way you go influences how you handle the interaction - oberved product or using XWITH.
James Algina posted on Wednesday, September 02, 2015 - 5:02 pm
I am using a latent decomposition, but would also be interested to know whether you can use an observed decomposition and still treat the covariate at dichotomous as level-1.
I tried using XWITH but it resulted in the following error message:
Interaction variables are not allowed with ESTIMATOR=BAYES.
Also I found that you can include CxT at level-1 and level-2 if you estimate the variance of CxT at level-1, -2, or-3. Two potential problems with this approach 1. I am not sure I am defining a meaningful interaction at either level. 2. CxT is not normally distributed and I am not sure how robust the procedure is to non-normality. Jamie
Similarly form the "observed" covariate interaction for level 2, but you will need the average cov value over level 2 clusters.
James Algina posted on Wednesday, September 02, 2015 - 7:26 pm
Hello and thank you for your response. In the following mcov comprises means for the level-2 clusters. Is the following program what you suggested? (I left out the code for number of iterations and processors.)
within Cov L1CxT; between (tchid) trt L2CxT (schid) site; . . . define: L1CxT=Cov*TRT; L2CxT=mcov*trt; . . . ANALYSIS: ESTIMATOR = BAYES; type=threelevel random;
MODEL: %within% dv on cov L1CxT; %between tchid% TRT_DV | dv on trt; dv on MCov L2CxT; %between schid% TRT_DV on site (TS); dv on site (S); MCov on site; dv WITH MCOV TRT_DV; MCOV WITH TRT_DV;
James Algina posted on Thursday, September 03, 2015 - 12:09 pm
In regard to the original model in this thread (shown below) where dv and cov are dichotomous and there is a latent decomposition of cov. My belief is that using estimator = Bayes, there is no way to add an interaction of trt (an observed variable) and the random effect for cov at level-2. Is this correct? If it is not correct can you show me the code to add the interaction or direct me to an example that illustrates the code?
MODEL: %within% dv on cov; %between tchid% TRT_DV | dv on trt; dv on Cov; %between schid% TRT_DV on site (TS); dv on site (S); Cov on site; dv WITH COV TRT_DV; COV WITH TRT_DV;