[R] Replacing missing values

Peter Ho peter at esb.ucp.pt
Thu May 10 12:44:36 CEST 2001

Jean Vidal wrote:

> I'm discovering R (very impressive), and didn't find in the docs a simple
> method for replacing, in a data frame, missing values (NA) with the
> column's mean (or any other method for reconstructing missing values when
> needed).

Joe Schafer has written a package called "norm" for the analysis of multivariate
normal datasets with missing value, which has been ported to R by Alvaro A. Novo,
and can be found in CRAN as a contributed package. norm uses the method of multiple
imputation (both the Expectation Maximization algorithm and Data Augmentation) to
impute mssing values. Joe Schafer has lots of information (docs and slide
presentations) about multiple imputation and on the use of norm. He has also
written a book " Analysis of Incomplete Multivariate Data ". You can get more
information on all of this at his webste at http://www.stat.psu.edu/~jls/ .

You may also want to consult Gary King, who has also written a program for imputing
missing values and has also some documentation on this at

I would recommend reading all the information on those sites, before using norm.

I hope this will help.

Peter Ho GradIFST
Escola Superior de Biotecnologia
Universidade Católica Portuguesa
Rua Dr. António Bernardino de Almeida
4200-072 Porto

r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list