[R] standard error of Binary logistic regression coefficient.
Joshua Wiley
jwiley.psych at gmail.com
Tue Jul 27 19:03:35 CEST 2010
Hi,
Just to extend the excellent suggestions, if you are interested in the
odds ratio, you can just use exp():
#Odds Ratio
exp(fit4$coefficients)
#Confidence interval around OR
exp(confint(fit4))
To give you an idea graphically of the log odds (or logit) look at:
p <- seq(0, 1, by = .001)
plot(y = log(p / (1 - p) ), x = p, type = "l")
Cheers,
Josh
On Tue, Jul 27, 2010 at 8:40 AM, Bessy <piglet630 at hotmail.com> wrote:
>
> Dear all,
>
> I am struggling with the calculation of standard error of the coefficient in
> Binary logistic regression analysis.
>
> I built a binary logsitic regression model as follows and got confused since
> the calculation of standard error of coefficients of X1, X2 and X3 are not
> the same as the Linear regression.
>
>> fit4 <-glm(Y~X1+X2+X3,data=d4,family=binomial("logit"))
> Warning message:
> In glm.fit(x = X, y = Y, weights = weights, start = start, etastart =
> etastart, :
> fitted probabilities numerically 0 or 1 occurred
>> summary(fit4)
>
> Call:
> glm(formula = Y ~ X1 + X2 + X3, family = binomial("logit"), data = d4)
>
> Deviance Residuals:
> Min 1Q Median 3Q Max
> -1.641483e+00 -8.421161e-05 0.000000e+00 1.349398e-03 1.417550e+00
>
> Coefficients:
> Estimate Std. Error z value Pr(>|z|)
> (Intercept) -10.1534523 10.8397717 -0.93669 0.348921
> X1 0.3312469 0.3007324 1.10147 0.270693
> X2 0.1808757 0.1069222 1.69166 0.090711 .
> X3 5.0874665 5.0820163 1.00107 0.316792
> ---
> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
>
> (Dispersion parameter for binomial family taken to be 1)
>
> Null deviance: 91.4954278 on 65 degrees of freedom
> Residual deviance: 5.8129055 on 62 degrees of freedom
> AIC: 13.812906
>
> Number of Fisher Scoring iterations: 12
>
>
> Could somebody suggest the calculation of standard error of X1, X2 and X3 in
> the output of my model, please?
>
> Any suggestions will be really appreciated.
>
> Kind Regards
>
> Bessy
>
> --
> View this message in context: http://r.789695.n4.nabble.com/standard-error-of-Binary-logistic-regression-coefficient-tp2303716p2303716.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.
>
--
Joshua Wiley
Ph.D. Student, Health Psychology
University of California, Los Angeles
http://www.joshuawiley.com/
More information about the R-help
mailing list