[R] I have aproblem about nomogram--thank you for your help
笑啸
dingdonglion at 126.com
Mon Oct 4 04:42:00 CEST 2010
dear professor:
I have a problem about the nomogram.I have got the result through analysing the dataset "exp2.sav" through multinominal logistic regression by SPSS 17.0.
and I want to deveop the nomogram through R-Projject,just like this :
> n<-100
> set.seed(10)
> T.Grade<-factor(0:3,labels=c("G0", "G1", "G2","G3"))
> Sex<-factor(0:1,labels=c("F","M"))
> Smoking<-factor(0:1,labels=c("No","yes"))
> L<-0.559*as.numeric(T.Grade)-0.896*as.numeric(Smoking)+0.92*as.numeric(Sex)-1.338
> y <- ifelse(runif(n) < plogis(L), 1, 0)
> ddist <- datadist(as.numeric(T.Grade,Sex,Smoking))
load package "rms"
> ddist <- datadist(as.numeric(T.Grade,Sex,Smoking))
> options(datadist='ddist')
> f<-lrm(y~as.numeric(T.Grade)+as.numeric(Sex)+as.numeric(Smoking))
错误于 error to:model.frame.default(formula = y ~ as.numeric(T.Grade) + as.numeric(Sex) + :
变数的长度不一样 the length of the variable is different ('as.numeric(T.Grade)')
I encounter aproblem in the last program,and I try to settle this problem though several ways ,just like:
asis(x, parms, label, name)
matrx(x, label, name)
pol(x, parms, label, name)
lsp(x, parms, label, name)
rcs(x, parms, label, name)
catg(x, parms, label, name)
scored(x, parms, label, name)
strat(x, label, name)
x1 %ia% x2
and i can not settle this problem
can you tell me how to settle this problem,thank you
turly yours
More information about the R-help
mailing list