Learn R Programming

DAMisc (version 1.3)

crSpanTest: Test of Span Parameter in linearity for Component + Residual Plots

Description

This function performs crTest for a user-defined range of span parameters, optionally allowing for multiple testing corrections in the p-values.

Usage

crSpanTest(model, spfromto, n=10, adjust.method="none", 
    adjust.type=c("none", "across", "within", "both"))

Arguments

model
A model object of class lm
spfromto
A vector of two values across which a range of n span values will be generated and tested.
n
Number of span parameters to test.
adjust.method
Adjustment method for multiple-testing procedure, using p.adjust from stats.
adjust.type
String giving the values over which the multiple testing correction will be performed. Here, both refers to a multiple testing correction done over all span parameters and all variables in the model. within means the m
...
Other arguments to be passed down to the call to loess.

Value

  • A list with two elements:
  • xSequence of span values used in testing
  • yp-values for each variable for each span parameter

Examples

Run this code
library(car)
mod <- lm(prestige ~ income + education + women, data=Prestige)
tmp <- crSpanTest(mod, c(.1, .9), adjust.method="holm", 
	adjust.type="both")
matplot(tmp$x, tmp$y, type="l")

Run the code above in your browser using DataLab