Description Usage Arguments Value Note See Also Examples
Odds ratio
for binary regression models fit with glm
1 2 3 4 5 6 7 8 
x 
A numeric object
containing probabilities P.
OR = P[i] / (1P[i]) = odds[1] / odds[0] There is a method for regression models with 
... 
Not used. 
newdata 
A 
ci 
If 
alpha 
Used to cacluate the confidence interval, which is: CI = x + Z[1alpha].SD where the normal distribution Z = N(0,1) and SD is the standard deviation. 
what 
See Value below. 
A data.table
.
Columns give the model, the value of the link function and
the associated probability P[i] and odds ratio OR[i].
If ci=TRUE
, will also give upper and lower bounds of the
confidence intervals for these values.
Rows are determined by what
:

The value of the link function is given
for the full model.


The value of the link function is given for each combination of coefficients in the model. 

The value of the link function is given
for each set of predictors in the data with which
the model was fit.

In the model formulas, the intercept term is specified as
0
(absent) or 1
(present).
The variance of the values of the link function is:
Var = SUM(x[i]^2.var(B[i])) + SUM(2.x[i][x[j]].cov(B[i], B[j]))
where Var is the variance and
cov is the covariance.
?stats::predict.glm
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16  if(require("graphics")){
plot(x < seq(from=0.1, to=0.9, by=0.05), y=OR(x))}
## H&L 2nd ed. Table 1.3. Page 10.
data(ageChd)
summary(g1 < glm(chd ~ age, data=ageChd, family=binomial))
OR(g1)
attributes(OR(g1))
## Table 1.4. Page 20.
stats::vcov(g1)
## Table 2.3. Page 38.
data(lbw)
summary(g1 < glm(LOW ~ LWT + RACE, data=lbw, family=binomial))
## Table 2.4. Page 42.
vcov(g1)
ageChd$gr54 < ageChd$age > 54
OR(glm(chd ~ gr54, data=ageChd, family=binomial))

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.