## File: conf_int.Rd

package info (click to toggle)
r-cran-clubsandwich 0.5.3-1
 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 % Generated by roxygen2: do not edit by hand % Please edit documentation in R/conf_int.R \name{conf_int} \alias{conf_int} \title{Calculate confidence intervals for all or selected regression coefficients in a fitted model} \usage{ conf_int(obj, vcov, level = 0.95, test = "Satterthwaite", coefs = "All", ...) } \arguments{ \item{obj}{Fitted model for which to calculate confidence intervals.} \item{vcov}{Variance covariance matrix estimated using \code{vcovCR} or a character string specifying which small-sample adjustment should be used to calculate the variance-covariance.} \item{level}{Desired coverage level for confidence intervals.} \item{test}{Character vector specifying which small-sample corrections to calculate. \code{"z"} returns a z test (i.e., using a standard normal reference distribution). \code{"naive-t"} returns a t test with \code{m - 1} degrees of freedom. \code{"Satterthwaite"} returns a Satterthwaite correction. \code{"saddlepoint"} returns a saddlepoint correction. Default is \code{"Satterthwaite"}.} \item{coefs}{Character, integer, or logical vector specifying which coefficients should be tested. The default value \code{"All"} will test all estimated coefficients.} \item{...}{Further arguments passed to \code{\link{vcovCR}}, which are only needed if \code{vcov} is a character string.} } \value{ A data frame containing estimated regression coefficients, standard errors, and confidence intervals. } \description{ \code{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. } \examples{ data("Produc", package = "plm") lm_individual <- lm(log(gsp) ~ 0 + state + log(pcap) + log(pc) + log(emp) + unemp, data = Produc) individual_index <- !grepl("state", names(coef(lm_individual))) conf_int(lm_individual, vcov = "CR2", cluster = Produc$state, coefs = individual_index) V_CR2 <- vcovCR(lm_individual, cluster = Produc$state, type = "CR2") conf_int(lm_individual, vcov = V_CR2, level = .99, coefs = individual_index) } \seealso{ \code{\link{vcovCR}} }