Last data update: 2014.03.03

R: Test of Span Parameter in linearity for Component + Residual...
crSpanTestR Documentation

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 multiple testing correction should be done within each model, but not across the span parameters and ‘across’ means that the multiple testing correction should be for each variable across the various span parameters, but not across variables within the same model. ‘none’ refers to a pass-through option of no multiple testing procedure.

...

Other arguments to be passed down to the call to loess.

Value

A list with two elements:

x

Sequence of span values used in testing

y

p-values for each variable for each span parameter

Author(s)

Dave Armstrong (UW-Milwaukee, Department of Political Science)

Examples

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")

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(DAMisc)
Loading required package: car
Loading required package: effects

Attaching package: 'effects'

The following object is masked from 'package:car':

    Prestige

> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/DAMisc/crSpanTest.Rd_%03d_medium.png", width=480, height=480)
> ### Name: crSpanTest
> ### Title: Test of Span Parameter in linearity for Component + Residual
> ###   Plots
> ### Aliases: crSpanTest
> 
> ### ** Examples
> 
> 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")
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>