Hello,
I have an unbalanced panel dataset with observations derived from surveys distributed at Time = 1 and Time = 2. There are around 250 observations at Time = 1, 90 observations at Time = 2; about 70 of the observations were answered by the same people (the rest were answered by people who answered only in time 1 or only in time 2. Treatments were distributed between time 1 and 2 either 0, 1, or 2 times.
I am trying to setup a repeated measures mixed effects analysis, and I am a little uncertain on a number of points of this analysis.
First, I am setting up the analysis like this:
My first question is, is it a problem that treatment#time values for time 2 are omitted in the results?
Second question: I would like to add other explanatory variables. I am not sure how I am supposed to set up the code is it:
or:
Thanks!
I have an unbalanced panel dataset with observations derived from surveys distributed at Time = 1 and Time = 2. There are around 250 observations at Time = 1, 90 observations at Time = 2; about 70 of the observations were answered by the same people (the rest were answered by people who answered only in time 1 or only in time 2. Treatments were distributed between time 1 and 2 either 0, 1, or 2 times.
I am trying to setup a repeated measures mixed effects analysis, and I am a little uncertain on a number of points of this analysis.
First, I am setting up the analysis like this:
Code:
xtmixed outcome i.treatment##i.time [pweight=pweight] || survey_id: note: 1.treatment#1.time identifies no observations in the sample note: 1.treatment#2.time omitted because of collinearity note: 2.treatment#1.time identifies no observations in the sample note: 2.treatment#2.time omitted because of collinearity Obtaining starting values by EM: Performing gradient-based optimization: Iteration 0: log pseudolikelihood = -164.41994 Iteration 1: log pseudolikelihood = -164.32418 Iteration 2: log pseudolikelihood = -164.32406 Iteration 3: log pseudolikelihood = -164.32406 Computing standard errors: Mixed-effects regression Number of obs = 340 Group variable: survey_id Number of groups = 240 Obs per group: min = 1 avg = 1.3 max = 2 Wald chi2(3) = 10.67 Log pseudolikelihood = -164.32406 Prob > chi2 = 0.0136 (Std. Err. adjusted for 240 clusters in survey_id) -------------------------------------------------------------------------------- | Robust outcome | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------------+---------------------------------------------------------------- treatment | 1 | .1512536 .1142023 1.32 0.185 -.0725788 .375086 2 | .2128566 .1315946 1.62 0.106 -.0450641 .4707774 | 2.time | -.2401163 .0744787 -3.22 0.001 -.3860919 -.0941407 | treatment#time | 1 1 | 0 (empty) 1 2 | 0 (omitted) 2 1 | 0 (empty) 2 2 | 0 (omitted) | _cons | .4079056 .0354483 11.51 0.000 .3384281 .4773831 -------------------------------------------------------------------------------- ------------------------------------------------------------------------------ | Robust Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval] -----------------------------+------------------------------------------------ survey_id: Identity | sd(_cons) | .3270064 .0381154 .2602205 .410933 -----------------------------+------------------------------------------------ sd(Residual) | .3225015 .0393712 .253873 .4096821 ------------------------------------------------------------------------------ Warning: Sampling weights were specified only at the first level in a multilevel model. If these weights are indicative of overall and not conditional inclusion probabilities, then results may be biased.
Second question: I would like to add other explanatory variables. I am not sure how I am supposed to set up the code is it:
Code:
xtmixed outcome explanatory i.treatment##i.time [pweight=pweight] || survey_id:
Code:
xtmixed outcome explanatory##i.time i.treatment##i.time [pweight=pweight] || survey_id:
Thanks!
Comment