Re: [R] Imputation

From: Jonathan Baron <>
Date: Wed 04 May 2005 - 22:48:35 EST

On 05/04/05 11:13, Ramesh Kolluru wrote:    
 I have timeseries data for some factors, and some missing values are there in those  factors, I want impute those missing values without disturbing the distribution of  that factor, and maintaining the correlation with other factors. Pl. suggest me some  imputation methods.
 I tried some functions in R like aregImpute, transcan. After the imputation I am  unable to retrive the data with imputed values. Please give me some way to get the  data with imputed values.

Here is one way to do it with transcan(), but I'm looking forward to seeing other answers. The data are in s.m, and the missing values are NA. The imputed values are in s.imp$imputed, in order, and the third line simply replaces the NAs with these values. (I posted this before. You might have found it by searching the R search page below.) This is for the simplest possible sort of imputation. I'm not sure that it meets your requirements. (In fact, I'm pretty sure it doesn't.) So you'd have to change the options for transcan, or do something else.

s.imp <- transcan(s.m,asis="*",data=s.m,imputed=T,long=T,pl=F) <- # which data are imputed
s.m[which(] <- unlist(s.imp$imputed)

As for aregImpute(), that has to be more difficult, because aregImpute() does multiple imputation. Very roughly, it produces an whole set of imputed values, for the purpose of statistical inference. I don't know how to get a single best estimate out of this set, or even whether this is a good idea.


Jonathan Baron, Professor of Psychology, University of Pennsylvania
Home page:
R search page:

______________________________________________ mailing list
PLEASE do read the posting guide!
Received on Wed May 04 23:31:57 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:35 EST