Hello,
I am attempting to use xtmixed for a repeated measures analysis looking at the effect of an intervention on scores for many different hospitals. I also want to adjust for rural/urban status. Each hospital has two years of data (labeled score1 and score2). I believed that xtmixed would be appropriate for this type of analysis, where hospital would be the random effect and the intervention and rural/urban status would be fixed effects. I'm getting confused on what to do with the time variable (a binary variable where 0=baseline and 1=2 years after baseline).
This is what I've done so far:
I reshaped like this: reshape long score, i(hospital) j(time).
I did a lot of reading and looking at examples but am still confused about how the time variable should be included in the model and what the conditions are under which the intervention/time interaction should be included. I have seen all of the following iterations on the forum:
1. xtmixed score i.intervention i.time i.rural || hospital:, var reml
2. xtmixed score i.intervention#time i.rural || hospital:, var reml
3. xtmixed score i.intervention i.intervention#time i.rural || hospital:, var reml
Can someone help me sort this out? I really want to have a good understanding of these models and just keep getting more confused the more I read.
Thank you,
Sarah
Related Posts with Specifying model correctly with xtmixed
Multiple Tasks in a MacroI know how to write simpel code of a macro to complete one task: e.g. drop obervations whose var1 va…
Correlations between two variables repeatedly measuredHi, I have a panel data of 30 subjects with 8 longitudinal observations each. I have measured 10 pl…
Create a new variable with If -statementsHello Statalists, I ’am quite a beginner in Stata and statistics in general. I have a large data sa…
Remove axes from twoway with by()Hi, Any ideas on how to remove the x-axis from all panels in a twoway graph with the by-option? I h…
Problem with sgmediation after using SEMHello everyone, I used SEM to construct 5 factors using 29 variables. After, I did some regressions…
Subscribe to:
Post Comments (Atom)
0 Response to Specifying model correctly with xtmixed
Post a Comment