Hi, I'm trying to estimate the SD of multiply imputed data. It shouldn't be hard, but I'm having trouble. Here's my progress so far.
Code:
/* Simulate bivariate normal data */ clear set seed 1 matrix C = (1, .8 \ .8, 1) drawnorm x y, cov(C) n(100) gen y_incomplete = y gen y_missing = (x > invnormal(.15)) replace y_incomplete = . if y_missing save "norm2incomplete.dta", replace /* Extract the mean and SD of complete data. */ mean y matrix mean = e(b) local mean = round(mean[1,1],0.1) display `mean' matrix sd = e(sd) local sd = round(sd[1,1],0.1) display `sd' /* Impute the data */ use "Data\norm2incomplete.dta", clear mi set flong mi register imputed y_incomplete mi impute regress y_incomplete x, add(50) /* Extract the mean from the imputed data */ mi estimate: mean y_incomplete matrix mean = e(b_mi) local mean = round(mean[1,1],0.1) display `mean' /* So far so good. But the following code fails to extract the sd of the imputed data */ matrix sd = e(sd) local sd = round(sd[1,1],0.1) display `sd'
Comment