[R] problem with rm.impute of the Design library

Frank E Harrell Jr feh3k at spamcop.net
Fri Dec 19 22:52:52 CET 2003


On Fri, 19 Dec 2003 19:51:46 +0100
"Grathwohl,Dominik,LAUSANNE,NRC/BAS" <dominik.grathwohl at rdls.nestle.com>
wrote:

> Hello,
> 
> I'm using:
> 
> platform i386-pc-mingw32
> arch     i386           
> os       mingw32        
> system   i386, mingw32  
> status                  
> major    1              
> minor    8.1            
> year     2003           
> month    11             
> day      21             
> language R      
> 
> and I get the following error with:
>  
> library(Design)
> 
> df <- list(pre=c(0,, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1,
> 0, 1),
> pro=c(1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0),
> sex=c(1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 1, 2, 1),
> y=cbind(
> y1<-c(5000, 3820, 4300, 3720, 4370, 4250, 4820, 4060, 4110, 4620, 4580,
> 3580, 3070, 4030, 3900, 3390, 3880, 4120, 3690, 4130),
> y2<-c(6160, 5240, 5210, 4650, 5600, 5340, 6020, 5590, 5140, 5640, 5340,
> 4640, 4650,   NA, 5320, 4510, 4910, 4960, 4420, 5150),
> y3<-c(6720, 6040, 6240, 5550, 6610, 6850, 6760, 6370, 6030,   NA, 6880,
> 5330, 5700,   NA, 6220, 5240, 5850, 5960, 4910, 5550),
> y4<-c(7640, 6840, 6900, 6010, 7780, 7650, 7610, 7000,   NA,   NA, 7720,
> 5990, 6340,   NA, 7360, 5910, 6310,   NA, 5350, 5880)),
> last=c(4, 4, 4, 4, 4, 4, 4, 4, 3, 2, 4, 4, 4, 1, 4, 4, 4, 3, 4, 4))
> 
> imp.df <- rm.impute(pformula = ~ pre+pro+sex, y = df$y, last = df$last, 
> rformula = ~ pre+pro+sex, n.impute = 2, data = df)
> 
> 
> Here the error:
> 
> > imp.df <- rm.impute(pformula = ~ pre+pro+sex, y = df$y, last =
> > df$last, 
> + rformula = ~ pre+pro+sex, n.impute = 2, data = df)
> 
> 
> Imputation 1
> Time period 1 : no dropouts
> Error in eval(expr, envir, enclos) : Object "in.period.i" not found
> In addition: Warning message: 
> This is an experimental procedure.  It should only be used for testing,
> as results are incorrect. 
> in: rm.impute(pformula = ~pre + pro + sex, y = df$y, last = df$last, 
> 
> 
> Can some of the experts explain me what I did wrong?
> 
> Kind regards,
> 
> Dominik

As stated in the documentation, rm.impute is "under development and is not
correct at present".  It awaits someone to re-write it.  It is not
supported.
---
Frank E Harrell Jr   Professor and Chair           School of Medicine
                     Department of Biostatistics   Vanderbilt University




More information about the R-help mailing list