confint2 | R Documentation |
Computes confidence intervals based on Wald, likelihood-ratio, Rao's score or Terrell's gradient tests for a generalized linear model.
confint2(
model,
level = 0.95,
test = c("wald", "lr", "score", "gradient"),
digits = max(3, getOption("digits") - 2),
verbose = TRUE
)
model |
an object of the class glm. |
level |
an (optional) value indicating the required confidence level. As default, |
test |
an (optional) character string indicating the required type of test. The available options are: Wald ("wald"), Rao's score ("score"), Terrell's gradient ("gradient"), and likelihood ratio ("lr") tests. As default, |
digits |
an (optional) integer value indicating the number of decimal places to be used. As default, |
verbose |
an (optional) logical indicating if should the report of results be printed. As default, |
The approximate 100(level
)% confidence interval for \beta
based on the test
test is the set of values of \beta_0
for which the hypothesis H_0
: \beta=\beta_0
versus H_1
: \beta!=\beta_0
is not rejected at the approximate significance level of 100(1-level
)%. The Wald, Rao's score and Terrell's gradient tests are performed using the expected Fisher information matrix.
A matrix with so many rows as parameters in the linear predictor and two columns: "Lower limit" and "Upper limit".
Buse A. (1982) The Likelihood Ratio, Wald, and Lagrange Multiplier Tests: An Expository Note. The American Statistician 36, 153-157.
Terrell G.R. (2002) The gradient statistic. Computing Science and Statistics 34, 206 – 215.
###### Example 1: Fuel consumption of automobiles
Auto <- ISLR::Auto
fit1 <- glm(mpg ~ weight*horsepower, family=inverse.gaussian("log"), data=Auto)
confint2(fit1, test="lr")
confint2(fit1, test="score")
###### Example 2: Patients with burn injuries
burn1000 <- aplore3::burn1000
burn1000 <- within(burn1000, death <- factor(death, levels=c("Dead","Alive")))
fit2 <- glm(death ~ age*inh_inj + tbsa*inh_inj, family=binomial("logit"), data=burn1000)
confint2(fit2, test="lr")
confint2(fit2, test="gradient")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.