Hi all, I am trying to understand the difference between -mixed- models and using -,fe- in Stata, while also acknowledging that Stata is not my default software programming language, so please bear with me.
Imagine a very simplified version of my dataset below, where I have an outcome variable and a main predictor variable (x1) along with a second covariate (x2). My data are structured where I have 3 waves of observations for a given person_id, and some families (fam_id) have multiple persons, hence nesting within family.
My initial impression is that, when using the following code:
This is estimating a multilevel model with fixed and random effects, where observations nested within persons, which are themselves nested within families. And while it is including an indicator for wave, it is not a longitudinal model, in the sense that it is not estimating wave-by-wave changes in the predictor and outcome within a given person_id.
Is that generally correct?
Whereas, in order to estimate a traditional longitudinal fixed effects model, I would specify in Stata:
Is this generally correct? And is there anything I'm missing, either in terms of the syntax of Stata or the explanation of differences between the types of models?
Imagine a very simplified version of my dataset below, where I have an outcome variable and a main predictor variable (x1) along with a second covariate (x2). My data are structured where I have 3 waves of observations for a given person_id, and some families (fam_id) have multiple persons, hence nesting within family.
My initial impression is that, when using the following code:
Code:
mixed outcome x1 x2 i.wave || fam_id: || person_id:
Is that generally correct?
Whereas, in order to estimate a traditional longitudinal fixed effects model, I would specify in Stata:
Code:
xtset wave person_id xtreg outcome x1 x2, fe
Code:
* Example generated by -dataex-. For more info, type help dataex clear input byte(wave person_id fam_id outcome x1 x2) 1 1 1 2 0 1 1 2 1 2 0 1 1 3 2 5 1 0 1 4 3 7 1 0 1 5 4 3 0 0 1 6 4 1 0 0 1 7 4 4 0 0 1 8 5 4 0 1 1 9 6 5 0 0 1 10 6 2 0 0 1 11 7 4 0 0 1 12 8 3 0 0 2 1 1 3 1 1 2 2 1 5 1 1 2 3 2 6 0 0 2 4 3 5 0 0 2 5 4 4 0 1 2 6 4 2 0 1 2 7 4 7 0 1 2 8 5 7 1 1 2 9 6 2 0 0 2 10 6 5 0 0 2 11 7 2 0 0 2 12 8 2 1 1 3 1 1 4 0 1 3 2 1 4 0 1 3 3 2 7 1 0 3 4 3 9 1 1 3 5 4 8 1 1 3 6 4 3 1 1 3 7 4 7 1 1 3 8 5 10 1 1 3 9 6 4 0 0 3 10 6 6 0 0 3 11 7 4 0 0 3 12 8 5 0 0 end
Comment