Hello,
I have the following code:
g Q1 = aqol1
g Q2 = aqol2
g Q3 = aqol3
g Q4 = aqol4
g Q5 = aqol5
g Q6 = aqol6
g Q7 = aqol7
g Q8 = aqol8
g Q9 = aqol9
g Q10 = aqol10
g Q11 = aqol11
g Q12 = aqol12
************************************************** ***************
********* Imputing Missing Values in Database *********
************************************************** **************
* Dimension 1. Independent Living
egen IL_miss = rowmean(Q1 Q2 Q3)
egen ILmissno = rowmiss(Q1 Q2 Q3)
replace Q1=round(IL_miss) if missing(Q1) & ILmissno==1
replace Q2=round(IL_miss) if missing(Q2) & ILmissno==1
replace Q3=round(IL_miss) if missing(Q3) & ILmissno==1
Following this code (and the rest of it which I didn't post), I will eventually get a single numeric score. My question is...How can I change the code to allow for the fact that Questions 1 through Questions 12 gets measured at multiple different timepoints in which case I would end up with a multiple scores? Is there a looping mechanism that I can use?
Thanks all,
I have the following code:
g Q1 = aqol1
g Q2 = aqol2
g Q3 = aqol3
g Q4 = aqol4
g Q5 = aqol5
g Q6 = aqol6
g Q7 = aqol7
g Q8 = aqol8
g Q9 = aqol9
g Q10 = aqol10
g Q11 = aqol11
g Q12 = aqol12
************************************************** ***************
********* Imputing Missing Values in Database *********
************************************************** **************
* Dimension 1. Independent Living
egen IL_miss = rowmean(Q1 Q2 Q3)
egen ILmissno = rowmiss(Q1 Q2 Q3)
replace Q1=round(IL_miss) if missing(Q1) & ILmissno==1
replace Q2=round(IL_miss) if missing(Q2) & ILmissno==1
replace Q3=round(IL_miss) if missing(Q3) & ILmissno==1
Following this code (and the rest of it which I didn't post), I will eventually get a single numeric score. My question is...How can I change the code to allow for the fact that Questions 1 through Questions 12 gets measured at multiple different timepoints in which case I would end up with a multiple scores? Is there a looping mechanism that I can use?
Thanks all,
Comment