conf_int | R Documentation |
conf_int
reports confidence intervals for each coefficient estimate in
a fitted linear regression model, using a sandwich estimator for the standard
errors and a small sample correction for the critical values. The
small-sample correction is based on a Satterthwaite approximation.
conf_int(
obj,
vcov,
level = 0.95,
test = "Satterthwaite",
coefs = "All",
...,
p_values = FALSE
)
obj |
Fitted model for which to calculate confidence intervals. |
vcov |
Variance covariance matrix estimated using |
level |
Desired coverage level for confidence intervals. |
test |
Character vector specifying which small-sample corrections to
calculate. |
coefs |
Character, integer, or logical vector specifying which
coefficients should be tested. The default value |
... |
Further arguments passed to |
p_values |
Logical indicating whether to report p-values. The default
value is |
A data frame containing estimated regression coefficients, standard errors, confidence intervals, and (optionally) p-values.
vcovCR
data("ChickWeight", package = "datasets")
lm_fit <- lm(weight ~ Diet * Time, data = ChickWeight)
diet_index <- grepl("Diet.:Time", names(coef(lm_fit)))
conf_int(lm_fit, vcov = "CR2", cluster = ChickWeight$Chick, coefs = diet_index)
V_CR2 <- vcovCR(lm_fit, cluster = ChickWeight$Chick, type = "CR2")
conf_int(lm_fit, vcov = V_CR2, level = .99, coefs = diet_index)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.