[R] A problem about nomogram

Frank Harrell f.harrell at Vanderbilt.Edu
Tue Nov 12 22:30:58 CET 2013


You did not follow the posting guide, did you use pure ascii email, and 
used illegal characters in your source code.  This caused extra work. 
Once I cleaned up your characters and made the example self-contained, 
the labels worked fine for me.  Here's the cleaned-up code:

library(rms)
x1 <- runif(20)
x2 <- runif(20)
y <- sample(0:1, 20, TRUE)
label(x1) <- 'A'
label(x2) <- 'B'

ddist <- datadist(x1,x2)
options(datadist='ddist')
f <- lrm(y~x1+x2)
x<-nomogram(f, fun=function(x)1/(1+exp(-x)), 
fun.at=c(.001,.01,.05,seq(0,1,by=.1),.95,.99,.999),vnames="labels")

plot(x)

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



More information about the R-help mailing list