Learn R Programming

lmreg (version 1.2)

hanova: ANOVA table for adequacy of a subset in a linear model)

Description

Prepares the Analysis of Variance table for testing adequacy of a subset model within a linear model.

Usage

hanova(lm1, lm2)

Arguments

lm1

An lm object describing full model.

lm2

An lm object describing subset model.

Value

Returns analysis of variance table for testing adequacy of lm2 within lm1.

Details

Normal distribution of response (given explanatory variables and/or factors) is assumed. The program simply reformats the output of the anova function.

References

Sengupta and Jammalamadaka (2019), Linear Models and Regression with R: An Integrated Approach.

Examples

Run this code
# NOT RUN {
data(birthwt)
lmbw <- lm(bwt ~ smoke+factor(race), data = birthwt)
lm1 <- lm(bwt ~ smoke, data = birthwt)
hanova(lm1,lmbw)
# }

Run the code above in your browser using DataLab