Learn R Programming

olsrr (version 0.1.0)

ols_pure_error_anova: Lack of Fit F Test

Description

Assess how much of the error in prediction is due to lack of model fit.

Usage

ols_pure_error_anova(model, ...)

Arguments

model

an object of class lm

...

other parameters

Value

ols_pure_error_anova returns an object of class "ols_pure_error_anova". An object of class "ols_pure_error_anova" is a list containing the following components:

lackoffit

f statistic

pure_error

pure error

rss

regression sum of squares

ess

error sum of squares

total

total sum of squares

rms

ems

p-value of fstat

lms

degrees of freedom

pms

name(s) of variable

rf

name of group_var

lf

f statistic

pr

p-value of fstat

pl

degrees of freedom

mpred

name(s) of variable

df_rss

name of group_var

df_ess

f statistic

df_lof

p-value of fstat

df_error

degrees of freedom

final

name(s) of variable

resp

name of group_var

preds

name of group_var

Details

The residual sum of squares resulting from a regression can be decomposed into 2 components:

  • Due to lack of fit

  • Due to random variation

If most of the error is due to lack of fit and not just random error, the model should be discarded and a new model must be built.

References

Kutner, MH, Nachtscheim CJ, Neter J and Li W., 2004, Applied Linear Statistical Models (5th edition). Chicago, IL., McGraw Hill/Irwin.

Examples

Run this code
model <- lm(mpg ~ disp, data = mtcars)
ols_pure_error_anova(model)

Run the code above in your browser using DataLab