plotLmPartRes: Plot partial residuals of a simple linear model fit.

plotLmPartResR Documentation

Plot partial residuals of a simple linear model fit.

Description

plotLmPartRes shows the relation between selected covariates from a lm model and the response, as well as the relation of those covariates and the response adjusted for the other covariates.

The functionality of plotLmPartRes is very limited. Only numeric vectors are supported (factors, interactions, I()'s are NOT). crPlot and ceresPlot should be preferred.

Usage

plotLmPartRes(m, covNames = names(m$model)[-1], 
    ...)

Arguments

m

an object of class 'lm'

covNames

names of covariates to plot (defaults to all of them)

...

further arguments to plot()

Author(s)

Tomas Sieger

See Also

crPlot, ceresPlot

Examples

# prepare data
set.seed(1)
n<-40
h<-rnorm(n)
f<-rnorm(n)
w<-3*h-f+rnorm(n)
d<-data.frame(h,w,f)
# fit lm
m<-lm(f~h+I(w-d),d)
summary(m)
# plot partial residuals
plotLmPartRes(m)

tsieger/tsiMisc documentation built on Oct. 10, 2023, 10:24 p.m.