[R] Draw a nomogram after glm

Frank Harrell f.harrell at vanderbilt.edu
Tue May 10 14:56:45 CEST 2011


by is not an argument to c( )
datadist needs to know the final coding of variables so run it after doing
any re-codes.
You are using the wrong syntax for interact=
Please take a while to read the full documentation before responding
further, and read my earlier posts.
Frank


Komine wrote:
> 
> Hi, 
> I try always to do my nomogram. I change little my code in order to
> definite the range of my linear predictor. 
> But I do not succeed to have 0 until 1. I tried this code.   
> library(rms)
> d <- datadist(Fire)
> options(datadist='d')
> Fire$Ignition=c(0,1,by=0.1)
> f<-lrm(Ignition~FMC+Charge,data=Fire)
> print(f)
> summary(f,FMC=c(0,506.40),Charge=c(45,646))
> plot(nomogram(f, interact=list(FMC,Charge))) 
> 
> The result is: 
> 
>> print(f)
> 
> Logistic Regression Model
> 
> lrm(formula = Ignition ~ FMC + Charge, data = Fire)
> 
>                      Model Likelihood     Discrimination    Rank Discrim.    
>                         Ratio Test            Indexes          Indexes       
> 
> Obs           231    LR chi2      0.04    R2       0.000    C       0.501    
>  0             77    d.f.            2    g        0.026    Dxy     0.002    
>  0.1           77    Pr(> chi2) 0.9796    gr       1.026    gamma   0.003    
>  1             77                         gp       0.006    tau-a   0.002    
> max |deriv| 7e-13                         Brier    0.222                     
> 
> 
>        Coef    S.E.   Wald Z Pr(>|Z|)
> y>=0.1  0.6832 0.3018  2.26  0.0236  
> y>=1   -0.7033 0.3020 -2.33  0.0199  
> FMC     0.0002 0.0011  0.18  0.8601  
> Charge -0.0001 0.0009 -0.07  0.9424  
> 
> 
>> summary(f,FMC=c(0,506.40),Charge=c(45,646)) 
>              Effects              Response : Ignition 
> 
>  Factor      Low High  Diff. Effect S.E. Lower 0.95 Upper 0.95
>  FMC          0  506.4 506.4  0.10  0.58 -1.04      1.24      
>   Odds Ratio  0  506.4 506.4  1.11    NA  0.36      3.45      
>  Charge      45  646.0 601.0 -0.04  0.55 -1.11      1.03      
>   Odds Ratio 45  646.0 601.0  0.96    NA  0.33      2.81      
>> plot(nomogram(f, interact=list(FMC,Charge)))   
>     http://r.789695.n4.nabble.com/file/n3511218/nomogram_2.jpeg 
> Please can I do to have linear predictor between 0 to 1. 
> Thanks very much for your Help
> Komine
> 


-----
Frank Harrell
Department of Biostatistics, Vanderbilt University
--
View this message in context: http://r.789695.n4.nabble.com/Draw-a-nomogram-after-glm-tp3498144p3511758.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list