[R] missing data imputation

Anders Schwartz Corr corr at fas.harvard.edu
Fri Jul 8 19:52:00 CEST 2005

Dear R-help,

I am trying to impute missing data for the first time using R. The norm
package seems to work for me, but the missing values that it returns seem
odd at times -- for example it returns negative values for a variable that
should only be positive. Does this matter in data analysis, and/or is
there a way to limit the imputed values to be within the minimum and
maximum of the actual data? Below is the code I am using.


Anders Corr
Ph.D. Candidate


tc <- read.csv("tc.csv", header = TRUE)
rngseed(1234567)   #set random number generator seed
s  <-  prelim.norm(tc)
thetahat <- em.norm(s)   #find the MLE for a starting value
theta <- da.norm(s,thetahat,steps=20,showits=TRUE,return.ymis=TRUE)  #take 20 steps
ximp <- imp.norm(s,thetahat,tc)  #impute missing data under the MLE

More information about the R-help mailing list