I am using a dataset that uses a school-based sampling design, and thus I want to cluster with school id in my modeling. However, I'm also using multiple imputation. Do I need to include the cluster id variable in the imputation model, or can I just specify it in the ensuing models? And if so, how do I do that given that it's in my dataset as a string--I don't think it would make sense to destring and then convert back to string after imputation, would it?
As of now, without the school cluster id included in the imputation model, I have something like:
Code:
mi set mlong
mi register imputed y x1 x2 x3
mi impute chained (regress) x1 x2 x3 = y, add(5) rseed(100)
mi estimate: regress y x1 x2 x3, vce(cluster school_id)
0 Response to Clustering with imputation
Post a Comment