lm_rSq_ci: Obtaining an R squared confidence interval estimate for an lm regression
Description
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.
Usage
lm_rSq_ci(
formula,
data = NULL,
conf.level = 0.95,
ci.method = c("widest", "r.con", "olkinfinn"),
env = parent.frame()
)
Value
The confidence interval
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.
Examples
Run this code
### Do a simple regression analysis
lm_rSq_ci(age ~ circumference, dat=Orange);
Run the code above in your browser using DataLab