crTest.Rd
This function estimates a linear model and a loess model on the component-plus-residual plot (i.e., a partial residual plot) for each quantitative variable in the model. The residual sums of squares for each are used to calculate an F-test for each quantitative variable.
crTest( model, adjust.method = "none", cat = 5, var = NULL, span.as = TRUE, span = 0.75, ... )
model | A model object of class |
---|---|
adjust.method | Adjustment method for multiple-testing procedure, using
|
cat | Number of unique values below which numeric variables are considered categorical for the purposes of the smooth. |
var | Character string indicating the term desired for testing. If
left |
span.as | Logical indicating whether the span should be automatically selected through AICC or GCV |
span | Span to be passed down to the |
... | Other arguments to be passed down to the call to |
A matrix with the following columns for each variable:
Residual sum-of-squares for the parametric (linear) model.
Residual sum-of-squares for the non-parametric (loess) model.
Numerator degrees of freedom for the F-test: tr(S)-(k+1).
Denominator degrees of freedom for the F-test: n-tr(S)
F-statistic
p-value, potentially adjusted for multiple comparisons.
data(Prestige, package="carData") mod <- lm(prestige ~ income + education + women, data=Prestige) crTest(mod)#> RSSp RSSnp DFnum DFdenom F p #> income 6033.57 5119.01 2.055 97.945 8.517 0.000 #> education 6033.57 5705.36 1.309 98.691 4.336 0.030 #> women 6033.57 5919.62 0.667 99.333 2.865 0.104