In texts books, we are told that mixed effects models use the "full" data set.
For example, let's say we have 100 participants and repeated measurements (baseline, 12 weeks and 24 weeks).
The beauty of mixed effects models is that they can use data for 10 participants who have data for only one time point (e.g. baseline only), participants that have all time points ( n = 50) and participants who have only the last measurement ( n = 40).
However, in Stata, for example, what we have is list wise deletion of all participants with at least a single missing data.
Code:
* generate a simple dataset. lazy coding. sorry.* treatment (1 or 0) * outcome is continuous * time is categorical (0,12 and 24 weeks) ***************** simulation of data ******************** set seed 12345 clear set obs 100 gene treatment = cond(_n>50,1,0) gene id = _n gene outcome = rnormal(100,10) gene time = 0 tempfile baseline followup1 followup2 save `baseline', replace clear set obs 100 gene treatment = cond(_n>50,1,0) gene id = _n gene outcome = cond(treatment==1,rnormal(50,10), rnormal(100,10)) gene time = 12 save `followup1', replace clear set obs 100 gene treatment = cond(_n>50,1,0) gene id = _n gene outcome = cond(treatment==1,rnormal(25,10), rnormal(100,10)) gene time = 24 save `followup2', replace clear use `baseline' append using `followup1' append using `followup2' ***************** end of simulation ******************** ************ ANALYSIS 1: WITH THE FULL DATA SET ********************* xtmixed outcome treatment#time || id:, var reml *! generate missing outcome data for 5% of the sample (MCAR) replace outcome = . if runiform()>0.95 ************ ANALYSIS 2: WITH MISSING DATA ************************* xtmixed outcome treatment#time || id:, var reml drop if outcome==. ************ ANALYSIS 3: MANUAL LIST WISE DELETION ****************** xtmixed outcome treatment#time || id:, var reml
Does it make sense to mention that analysis 2 uses the full data set? Any suggestions regarding how to use the full data set?
Thank you so much for any comment or reference on that topic.
All the best,
Tiago
0 Response to Does -xtmixed- use the full data set ?
Post a Comment