RRor | R Documentation |
Model based interval estimate of the risk ratio or prevented fraction from a logistic regression model.
RRor(
fit = NULL,
beta.hat = NULL,
var.beta.hat = NULL,
degf = NULL,
which = c(1, 2),
pf = TRUE,
norm = FALSE,
alpha = 0.05,
rnd = 3
)
fit |
A glm object. |
beta.hat |
Parameters estimates from a logistic regression with no intercept. |
var.beta.hat |
Variance-covariance matrix from a logistic regression with no intercept. |
degf |
Degrees of freedom. |
which |
Numeric vector indicating which parameters to compare, so that
|
pf |
Estimate RR or its complement PF? |
norm |
Estimate confidence interval using quantiles of Guassian rather than t distribution quantiles? |
alpha |
Complement of the confidence level. |
rnd |
Number of digits for rounding. Affects display only, not estimates. |
Estimates confidence intervals using the delta method on parameters from a generalized linear model with logit link.
RR = {{{\mu}}_{2}} / {{{\mu}}_{1}}
, where
{\mu}_{i}
are the estimated probabilities from the model.
A rror object with the following fields.
estimate
: vector with point and interval estimate
estimator
: either PF or RR
mu
: matrix with rows giving probability estimates for each of the groups
rnd
: how many digits to round the display
alpha
: complement of confidence level
norm
: logical indicating Gaussian or t-interval
degf
: degrees of freedom
Call to this function may be one of two formats: (1) specify fit
or
(2) beta.hat
, var.beta.hat
, degf
RRor(fit, degf = NULL, pf = TRUE, alpha = 0.05, which = c(1, 2), norm = TRUE, rnd = 3)
RRor(beta.hat, var.beta.hat, degf, pf = TRUE, alpha = 0.05, which = c(1, 2), norm = TRUE, rnd = 3)
PF-package
rror, phiWt, tauWt StatWI007 for more examples
bird.fit <- glm(cbind(y, n - y) ~ tx - 1, binomial, bird)
RRor(tauWt(bird.fit))
# 95% t intervals on 4 df
#
# PF
# PF LL UL
# 0.500 -0.583 0.842
#
# mu.hat LL UL
# txcon 0.733 0.943 0.3121
# txvac 0.367 0.752 0.0997
RRor(phiWt(bird.fit))
# 95% t intervals on 4 df
#
# PF
# PF LL UL
# 0.500 -0.583 0.842
#
# mu.hat LL UL
# txcon 0.733 0.943 0.3121
# txvac 0.367 0.752 0.0997
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.