View source: R/ols-regression.R
ols_regress | R Documentation |
Ordinary least squares regression.
ols_regress(object, ...)
## S3 method for class 'lm'
ols_regress(object, ...)
object |
An object of class "formula" (or one that can be coerced to
that class): a symbolic description of the model to be fitted or class
|
... |
Other inputs. |
ols_regress
returns an object of class "ols_regress"
.
An object of class "ols_regress"
is a list containing the following
components:
r |
square root of rsquare, correlation between observed and predicted values of dependent variable |
rsq |
coefficient of determination or r-square |
adjr |
adjusted rsquare |
rmse |
root mean squared error |
cv |
coefficient of variation |
mse |
mean squared error |
mae |
mean absolute error |
aic |
akaike information criteria |
sbc |
bayesian information criteria |
sbic |
sawa bayesian information criteria |
prsq |
predicted rsquare |
error_df |
residual degrees of freedom |
model_df |
regression degrees of freedom |
total_df |
total degrees of freedom |
ess |
error sum of squares |
rss |
regression sum of squares |
tss |
total sum of squares |
rms |
regression mean square |
ems |
error mean square |
f |
f statistis |
p |
p-value for |
n |
number of predictors including intercept |
betas |
betas; estimated coefficients |
sbetas |
standardized betas |
std_errors |
standard errors |
tvalues |
t values |
pvalues |
p-value of |
df |
degrees of freedom of |
conf_lm |
confidence intervals for coefficients |
title |
title for the model |
dependent |
character vector; name of the dependent variable |
predictors |
character vector; name of the predictor variables |
mvars |
character vector; name of the predictor variables including intercept |
model |
input model for |
If the model includes interaction terms, the standardized betas are computed after scaling and centering the predictors.
https://www.ssc.wisc.edu/~hemken/Stataworkshops/stdBeta/Getting%20Standardized%20Coefficients%20Right.pdf
ols_regress(mpg ~ disp + hp + wt, data = mtcars)
# if model includes interaction terms set iterm to TRUE
ols_regress(mpg ~ disp * wt, data = mtcars, iterm = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.