Hi GeorgeLeckie
Here an example:
It is not a good example because the test scores have been normalised, but I could't find a stata example with multilevel data non-normalised. nmatpre had missing values, these values have been imputed on REALCOM and imported on stata giving the following file
Code: Select all
. insheet using "N:\pract4imputRealcom.csv", clear
I can generate a model of interest: regression of normexam on nmatpre. If the data were imputed on stata it could be easy to apply:
Code: Select all
. mi estimate, cmdok noisily: runmlwin normexam cons nmatpre, ///
level2(shoolid: cons nmatpre) ///
level1(childid: cons) ///
nopause
The first concern is: how to use runmlwin with these imputed values? Should I consider the mean value of the imputed variables?
((_1_nmatpre + _2_nmatpre + _3_nmatpre + _4_nmatpre + _5_nmatpre + _6_nmatpre + _7_nmatpre + _8_nmatpre + _9_nmatpre + _10_nmatpre)/10)
The second concern: considering normexam and nmatpre non normals and that there are no missing values in nmatpre. To determine the powers of the fractional polynomial we could apply the following command in stata. To allow the fractional polynomial model to work on these data we need to remove the negative values
Code: Select all
. drop if normexam<0
. drop if nmatpre<0
. fp <nmatpre>: xtmixed normexam <nmatpre> || schoolid: /*we could consider the power of 1*/
I Would like to determine the power of the fractional polynomial using runmlwin. The following command doesn't work because stata consider "cmdok noisily:" as a "fp" option
Code: Select all
. fp <nmatpre>: cmdok noisily: runmlwin normexam cons <nmatpre> level2(schoolid: cons) level1(chilid: cons) nopause nogroup
How to combine these stata commands: fp and runmlwin or mi, fp and runmlwin?
Thanks
Best wishes
Likestatistic