
Last chance! 50% off unlimited learning
Sale ends in
regr
function wraps a number of linear regression functions into
one convenient interface that provides similar output to the regression
function in SPSS. It automatically provides confidence intervals and
standardized coefficients. Note that this function is meant for teaching
purposes, and therefore it's only for very basic regression analyses.
regr(formula, dat = NULL, conf.level = .95, digits = 2, pvalueDigits = 3, coefficients = c("raw", "scaled"), plot = FALSE, ci.method = c("widest", "r.con", "olkinfinn"), ci.method.note = FALSE, env = parent.frame())
y ~ x1 + x2
, where
y is the dependent variable and x1 and x2 are the predictors.
### Do a simple regression analysis
regr(age ~ circumference, dat=Orange);
### Show more digits for the p-value
regr(Orange$age ~ Orange$circumference, pvalueDigits=18);
Run the code above in your browser using DataLab