Hello stata experts,
I want to check the means of imputed data for several variables. I want to do the graphing all at once and save it for review later on. To graph the plot for one variable, I have the following codes which run successfully:
mi impute chained (pmm) v1 v5 (ologit) v2 (logit) v3 (mlogit) v4 = v6 v7, add(5) rseed(1234) augment savetrace(extrace, replace) burnin(100)
use extrace, replace
reshape wide *mean *sd, i(iter) j(m)
tsset iter
tsline v1_mean*, title("Mean of Imputed Values") note("Each line is for one imputation") legend(off)
graph export v1_mean.png, replace
I am hoping to do the above tsline codes for v1 to v5 at once. I assume this would mean to plot a series of variables (v1_mean*, v2_mean*, v3_mean*...) for each series (v1, v2, v3...). I tried foreach and couldn't get it right.
Thanks in advance for your help!
Ji
I want to check the means of imputed data for several variables. I want to do the graphing all at once and save it for review later on. To graph the plot for one variable, I have the following codes which run successfully:
mi impute chained (pmm) v1 v5 (ologit) v2 (logit) v3 (mlogit) v4 = v6 v7, add(5) rseed(1234) augment savetrace(extrace, replace) burnin(100)
use extrace, replace
reshape wide *mean *sd, i(iter) j(m)
tsset iter
tsline v1_mean*, title("Mean of Imputed Values") note("Each line is for one imputation") legend(off)
graph export v1_mean.png, replace
I am hoping to do the above tsline codes for v1 to v5 at once. I assume this would mean to plot a series of variables (v1_mean*, v2_mean*, v3_mean*...) for each series (v1, v2, v3...). I tried foreach and couldn't get it right.
Thanks in advance for your help!
Ji
Comment