Showing posts with label multiple imputation. Show all posts
Showing posts with label multiple imputation. Show all posts

Friday, September 07, 2012

How to Combine the Results after the Multiply Imputation

How to Combine the Results after the Multiple Imputation
The overall estimate of Q is simply the average of the M estimates from M multiple imputed datasets.
The overall variance of is
Where the average variance of M within-imputed datasets () is and the variance between-imputed dataset is

The overall degree of freedom (df) is
Where the df of imputed datasets is and the df of observed data is


If the df of the complete data (dfcompleted) are large [Notes: for complex sampling design, dfcomplete = # of PSU - # of Strata], the overall degree of freedom is
Then, the confidence intervals can be
The estimated percent rate of missing information for Q is
Notes: Usually M = 5 or 10 is enough, but the M is better to be great than the percent rate of missing information. 

Tuesday, October 25, 2011

Can 'margins' be used after 'mi estimate'?

Can 'margins' be used after 'mi estimate'?

The -margins- command may not be used in the usual way after -mi estimate-. You'll need to write a short "wrapper command" that can be run with the -mi estimate- prefix. My colleagues outlined the method on Statalist: Average marginal effects for a multiply imputed complex survey. You'll want to change the 11 in the -version 11- statement to 12. One of our FAQs will also be helpful: How can I combine results other than coefficients in e(b) with multiply imputed data? - by A Statistician, Stata


Here is my modified program based on codes of UCLA Stata Portal

use http://www.ats.ucla.edu/stat/data/hsbmar, clear
/* set MI dataset */
mi set mlong
mi register imputed female math read science socst
mi svyset [pw=write], strata(ses)
mi impute chain (logit) female (regress) math read science socst ///
       =ses write awards, add(10) rseed(123456)
/* program */
capture program drop mimargins
program mimargins, eclass properties(mi)
  version 12
  svy: logit honors i.female##i.prog read math science socst
  margins female#prog, post
end
/* run the program */ 
mi estimate, cmdok: mimargins 1
matlist r(table)'*100, tw(20) format(%8.2f)
mi estimate (_b[1.female#2.prog]/_b[1.female#1bn.prog]): mimargins 1

Notes: The 'cmdok' option forces 'mi estimate' to estimate the current Stata unsupported model. The 'cmdok' is not necessary because of already including the 'properties(mi)' in the program.

mi estimate: svy: logit honors i.female##i.prog read math science socst
mi test 1.female#2.prog 1.female#3.prog

mi estimate (diff:1.female#2.prog-1.female#3.prog), saving(miest, replace): svy: logit honors i.female##i.prog read math science socst
mi testtransform diff

mi estimate (rdiff:1.female#2.prog/1.female#3.prog - 1) using miest
mi testtr rdiff


Useful Resources:


Sunday, September 11, 2011

Multiple Imputation (MI)

Multiple Imputation (MI)