[R] help with nomogram function

Ross Darnell r.darnell at uq.edu.au
Thu Nov 6 08:41:45 CET 2003


Frank Harrell wrote
 
> On Wed, 05 Nov 2003 09:22:34 +1000
> Ross Darnell <r.darnell at uq.edu.au> wrote:
> 
> > I have fitted a logistic regression model
> > 
> > > failed.lr2$call
> > lrm(formula = failed ~ Age + task2 + Age:task2, data = time.long, 
> >     na.action = na.omit)
> 
> Use Age*task2 and omit na.action as na.omit is the default
> 
> > 
> > using the Design package functions and would like to generate a
> > nomogram from this model.
> > 
> > the datadist information is generated and stored in
> > 
> > > ddist
> >                 time.long$Age time.long$task2
> > Low:effect                 45            <NA>
> > Adjust to                  56       both.foam
> > High:effect                68            <NA>
> > Low:prediction             21       both.foam
> > High:prediction            80           right
> > Low                        20       both.foam
> > High                       80           right
> 
> This looks most strange.  You did not include the original code but I
> suspect you had $ in a term.  $ should not appear in column headings
> above.  Design wants you to use data= or attach, and avoid $ in terms.
> 
> 
> > 
> > Values:
> > 
> > time.long$task2 : both.foam left right 
> > > 
> > 
> > The model fitted and then when I try the nomgram function
> > 
> > > nomogram(failed.lr2)
> > Error in value.chk(at, i, NA, -nint, Limval, type.range = "full") : 
> > 	variable Age does not have limits defined by datadist
> > > 
> > 
> > I get an error. The NA values in ddist seem to be the problem but I
> > don't understand the datadist information.
> > 

I tried using the data argument in datadist

> names(my.data)
[1] "subject" "Age"     "failed"  "task"   
> ddist <- datadist(Age,task,data=my.data)
Error in datadist(Age, task, data = my.data) : 
	Object "Age" not found


Strange.

Thanks
Ross Darnell


--




More information about the R-help mailing list