Skip to contents

Construct a confidence interval for a linear combination of regression coefficients

Usage

make_CI(y, X, alpha, gamma, sigma2 = NULL)

Arguments

y

Response vector

X

Design matrix

alpha

Significance level (e.g., 0.05 for 95% CI)

gamma

Vector specifying the linear combination

sigma2

Optional known variance. If not provided, uses t-distribution

Value

Numeric vector of length 2: lower and upper confidence interval bounds

Examples

y <- c(1,2,3,4)
X <- cbind(1, c(1,2,3,4))
gamma <- c(0,1)
make_CI(y, X, 0.05, gamma)
#> [1] 1 1
make_CI(y, X, 0.05, gamma, sigma2=1)
#> [1] 0.1234775 1.8765225