Hi there,
I was using the syntax foreach var of varlist * {summ `var' replace `var' = r(mean) if missing(`var')}
but this seems to have replaced missing data with the complete mean rather than the subscale mean.
If I have items q6, q7, q8, q12, q18, q19 and item q8 is missing. How do I replace q8 with the subscale mean i.e. can I do q6+q7+q12+q18+q19 divided by 6 to replace q8?
So, for example, if the item scores are:
q6: 4
q7: 3
q8: . (missing)
q12: 3
q18: 1
q19: 4
Can I get Stata to sum the other subscale scores and divide by the total number of scores to leave the mean of 2.5 to replace q8 without me having to do this manually?
Hope I explained that ok?
Many thanks for your help in advance,
Mary-Elaine.
Related Posts with replace missing data with the mean of a subscale
F test and Chi2 testHi everyone: I would like to verify the relationship between F and chi2. But it is found that they …
How to compute the sum of the first occurence within Group(s) in Stata?I have a small long format dataset below. * Example generated by -dataex-. For more info, type help …
Panel model - Heteroskedasticity and Graphical representationHi everyone! I am conducting my masters degree thesis, performing a panel model in Stata. The panel …
Ask for Help with Computation of Running Sum of a Variable within Multiple Variables in Stata.The long format dataset is presented as follows. It has 3 columns, gender (male=1; female=2), period…
Alternative to fixed-effects Binomial Model for longitudinal dataHi all: My dependent variable, v6mouses, is drug use; 60.15% of the result is 0 and 26.92% of the r…
Subscribe to:
Post Comments (Atom)
0 Response to replace missing data with the mean of a subscale
Post a Comment