anova.rsm: ANOVA Table for a RSM Object

Description Usage Details Note See Also Examples

View source: R/marg.R

Description

This is a method for the function anova() for objects inheriting from class rsm. See anova for the general behaviour of this function.

Usage

1
2
## S3 method for class 'rsm'
anova(object, ..., test = c("Chisq", "none"))

Details

When called with a single rsm object, anova.rsm may take a while to run, because it fully iterates a series of rsm models. The series is constructed by successively adding to the null model all the terms in object, taken in the order they appear in terms(object).

Note

For each term minus twice the log likelihood is returned instead of the residual sum of squares. The degrees of freedom change according to whether the scale parameter is known or not.

See Also

anova, rsm.object, rsm

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Sea Level Data
data(venice)
attach(venice)
Year <- 1:51/51
c11 <- cos(2*pi*1:51/11) ; s11 <- sin(2*pi*1:51/11)
c19 <- cos(2*pi*1:51/18.62) ; s19 <- sin(2*pi*1:51/18.62)
venice.p <- rsm(sea ~ Year + I(Year^2) + c11 + s11 + c19 + s19, 
                family = extreme)
anova(venice.p)
##
venice.l <- rsm(sea ~ Year + I(Year^2), family = extreme)
anova(venice.p, venice.l)
##
detach()

## House Price Data
data(houses)
houses.rsm <- rsm(price ~ ., family = student(5), data = houses)
anova(houses.rsm)

Example output

Loading required package: statmod
Loading required package: survival

   Package "marg" 1.2-2 (2014-03-31) 
    Copyright (C) 2000-2014 A. R. Brazzale

 This is free software, and you are welcome to redistribute
 it and/or modify it under the terms of the GNU General
 Public License published by the Free Software Foundation.
 Package "marg" comes with ABSOLUTELY NO WARRANTY.

 type `help(package="marg")' for summary information

Analysis of Deviance Table

Error distribution: extreme
Scale parameter: free (1 df lost for fitting)
Response: sea

Terms added sequentially (first to last)
          Df Deviance Resid. Df  -2*LL  Pr(>Chi)    
NULL                         49 446.33              
Year       1  14.1006        48 432.23 0.0001733 ***
I(Year^2)  1   0.0337        47 432.20 0.8542665    
c11        1  14.1302        46 418.06 0.0001706 ***
s11        1   3.9869        45 414.08 0.0458541 *  
c19        1   2.9914        44 411.09 0.0837076 .  
s19        1   2.0166        43 409.07 0.1555920    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Analysis of Deviance Table

Error distribution: extreme
Scale parameter: free (1 df lost for fitting)
Response: sea 

Model 1: Year + I(Year^2) + c11 + s11 + c19 + s19
Model 2: Year + I(Year^2)
  Resid. Df  -2*LL Df Deviance  Pr(>Chi)    
1        43 409.07                          
2        47 432.20  4   23.125 0.0001195 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Analysis of Deviance Table

Error distribution: student
Scale parameter: free (1 df lost for fitting)
Response: price

Terms added sequentially (first to last)
       Df Deviance Resid. Df  -2*LL Pr(>Chi)    
NULL                      24 205.56             
bdroom  1   3.7962        23 201.77  0.05137 .  
floor   1  17.3924        22 184.38 3.04e-05 ***
rooms   1   5.4057        21 178.97  0.02007 *  
front   1   2.2779        20 176.69  0.13123    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

marg documentation built on May 2, 2019, 7:55 a.m.