[R] lrm in Design package, missing value problem

Frank E Harrell Jr f.harrell at vanderbilt.edu
Sun Aug 23 20:45:40 CEST 2009


James Fearon wrote:
> Hi,
> 
> This concerns lrm in the Design package, which I need for the clustered 
> errors option with panel data.
> 
> I have created a variable (using sign()) that has values -1, 0, and 1 
> (and some NAs).  call this variable x3.  lrm does not like
> 
> t = lrm(y ~ x1 + x2 + I(x3==-1) + I(x3==1), data=data,x=T,y=T)
> 
> I get the error message:  Error in if (!length(fname) || !any(fname == 
> zname)) { :
>  missing value where TRUE/FALSE needed
> 
> Running this on the subset of data with non missing x3 values doesn't help.
> 
> glm has no problem with this.
> 
> Thanks very much,
> 
> Jim Fearon

Right, Design does not like variables to be split up.  Make x3 a factor 
and use it just as the single term x3 in the model.

Frank

-- 
Frank E Harrell Jr   Professor and Chair           School of Medicine
                      Department of Biostatistics   Vanderbilt University




More information about the R-help mailing list