confint_EY_h: Compute Confidence Intervals for Regression Estimates

View source: R/operations.R

confint_EY_hR Documentation

Compute Confidence Intervals for Regression Estimates

Description

Compute Confidence Intervals for Regression Estimates

Usage

confint_EY_h(
  X_h,
  betas,
  MSE,
  covariance,
  n,
  p = NCOL(X_h),
  m = 1,
  alpha = 0.05,
  new = FALSE,
  simultaneous = FALSE
)

Arguments

X_h

h \times p matrix, or single h length vector, containing data for observations. Be sure to include the intercept column if present.

betas

Vector of estimated coefficients.

MSE

Estimated mean squared error.

covariance

Covariance matrix of the estimated coefficients.

n

Number of observations in the design matrix. Computed if omitted.

p

Number of parameters in the model. Computed if omitted.

m

Number of new observations to predict.

alpha

Alpha level for constructing confidence intervals.

new

Logical. Are the values new observations, or were they used to fit the model? Confidence intervals are narrower in the latter case. Default FALSE.

simultaneous

Logical. Should simultaneous Bonferroni-corrected intervals be constructed instead of separate intervals? Default FALSE.

Details

This function finds the predicted values for given observations predicted by an estimated linear model. It also computes confidence intervals, the width varying by whether the observations are new and/or whether simultaneous intervals are desired.

Value

h \times 3 matrix of predictions with interval bounds.


ryan-heslin/RegLesson documentation built on Aug. 5, 2022, 9:03 p.m.