The lm_rSq_ci function uses the base R lm function to conduct a regression analysis and then computes the confidence interval for R squared.

lm_rSq_ci(
  formula,
  data = NULL,
  conf.level = 0.95,
  ci.method = c("widest", "r.con", "olkinfinn"),
  env = parent.frame()
)

Arguments

formula

The formula of the regression analysis, of the form y ~ x1 + x2, where y is the dependent variable and x1 and x2 are the predictors.

data

If the terms in the formula aren't vectors but variable names, this should be the dataframe where those variables are stored.

conf.level

The confidence of the confidence interval around the regression coefficients.

ci.method

Which method to use for the confidence interval around R squared.

env

The enviroment where to evaluate the formula.

Value

The confidence interval

Author

Gjalt-Jorn Peters

Maintainer: Gjalt-Jorn Peters gjalt-jorn@a-bc.eu

Examples


### Do a simple regression analysis
lm_rSq_ci(age ~ circumference, dat=Orange);
#> [1] 0.7441914 0.9248420