[R] logistic regression lrm() output
Frank Harrell
f.harrell at vanderbilt.edu
Wed May 18 18:52:05 CEST 2011
Why is a one unit change in x an interesting range for the purpose of
estimating an odds ratio?
The default in summary() is the inter-quartile-range odds ratio as clearly
stated in the rms documentation.
Frank
array chip wrote:
>
> Hi, I am trying to run a simple logistic regression using lrm() to
> calculate a
> odds ratio. I found a confusing output when I use summary() on the fit
> object
> which gave some OR that is totally different from simply taking
> exp(coefficient), see below:
>
>> dat<-read.table("dat.txt",sep='\t',header=T,row.names=NULL)
>
>> d<-datadist(dat)
>> options(datadist='d')
>> library(rms)
>> (fit<-lrm(response~x,data=dat,x=T,y=T))
>
> Logistic Regression Model
> lrm(formula = response ~ x, data = dat, x = T, y = T)
>
> Model Likelihood Discrimination Rank Discrim.
> Ratio Test Indexes Indexes
>
> Obs 150 LR chi2 17.11 R2 0.191 C 0.763
> 0 128 d.f. 1 g 1.209 Dxy 0.526
> 1 22 Pr(> chi2) <0.0001 gr 3.350 gamma 0.528
> max |deriv| 1e-11 gp 0.129 tau-a 0.132
> Brier 0.111
>
> Coef S.E. Wald Z Pr(>|Z|)
> Intercept -5.0059 0.9813 -5.10 <0.0001
> x 0.5647 0.1525 3.70 0.0002
>
> As you can see, the odds ratio for x is exp(0.5647)=1.75892.
>
> But if I run the following using summary():
>
>> summary(fit)
> Effects Response : response
>
> Factor Low High Diff. Effect S.E. Lower 0.95 Upper 0.95
> x 3.9003 6.2314 2.3311 1.32 0.36 0.62 2.01
> Odds Ratio 3.9003 6.2314 2.3311 3.73 NA 1.86 7.49
>
> What are these output? none of the numbers is the odds ratio (1.75892)
> that I
> calculated by using exp().
>
> Can any explain?
>
> Thanks
>
> John
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
-----
Frank Harrell
Department of Biostatistics, Vanderbilt University
--
View this message in context: http://r.789695.n4.nabble.com/logistic-regression-lrm-output-tp3533223p3533278.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list