Last chance! 50% off unlimited learning
Sale ends in
ols
can be used to calculate the values of Ordinary Least Square Estimated values and corresponding scaler Mean Square Error (MSE) value.
ols(formula, data, na.action, ...)
formula
.
data
, the variables are taken from environment(formula)
, typically the environment from which the function is called.
NA
values, then na.action
indicate what should happen to those NA
values.
ols
returns the Ordinary Least Square Estimated values, standard error values, t statistic values,p value and corresponding scalar MSE value. In addition if the dataset contains multicollinearity then it will be indicated as a warning massage.
y ~ x - 1
or y ~ 0 + x
to remove the intercept.If there is any dependence present among the independent variables (multicollinearity) then it will be indicated as a warning massage. In case of multicollinearity Ordinary Least Square Estimators are not the best estimators.
checkm
## Portland cement data set is used.
data(pcd)
ols(Y~X1+X2+X3+X4-1,data=pcd) # Model without the intercept is considered.
Run the code above in your browser using DataLab