lmSingleR2: Return an R2 value for lm model variable

Description Usage Arguments See Also Examples

View source: R/lmSingleR2.R

Description

Simple function to produce a single R^2 value for a specified variable (including factors and interaction terms) from a lm() object. Uses anova() to generate type 1 Sums of Squares (sequential) for variable.

Usage

1
lmSingleR2(obj, test.var)

Arguments

obj

Object from an lm() fiitted equation.

test.var

Required. Variable name from lm() object.

See Also

pCorr

Examples

1
2
3
4
mtcars$gear <- factor(mtcars$gear)
mod <- lm(hp ~ disp + gear, data=mtcars)
summary(mod)
lmSingleR2(mod, "gear")

MichaelJMahometa/SDSRegressionR documentation built on March 3, 2021, 10:51 p.m.