Anova: Analysis of variance with SS type II or III (including mixed...

Description Usage Arguments Value Author(s) See Also Examples

Description

Replacement for Anova.lm in package car.

Usage

1
2
3
4
## S3 method for class 'lm'
Anova(mod, error, type = c("II", "III", 2, 3), white.adjust
 = c(FALSE, TRUE, "hc3", "hc0", "hc1", "hc2", "hc4"),
 singular.ok, ...)

Arguments

mod

lm, aov, glm, multinom, polr mlm, coxph, lme, mer, svyglm or other suitable model object.

error

for a linear model, an lm model object from which the error sum of squares and degrees of freedom are to be calculated. For F-tests for a generalized linear model, a glm object from which the dispersion is to be estimated. If not specified, mod is used.

type

type of test, "II", "III", 2, or 3.

singular.ok

defaults to TRUE for type-II tests, and FALSE for type-III tests (where the tests for models with aliased coefficients will not be straightforwardly interpretable); if FALSE, a model with aliased coefficients produces an error.

white.adjust

if not FALSE, the default, tests use a heteroscedasticity-corrected coefficient covariance matrix; the various values of the argument specify different corrections. See the documentation for hccm for details. If white.adjust=TRUE then the "hc3" correction is selected.

...

do not use.

Value

Returns appropriate analysis of variance or halts if unsupported input is detected.

Author(s)

John Fox jfox@mcmaster.ca. Extended by Kristian Hovde Liland.

See Also

print.AnovaMix, AnovaMix, lm

Examples

1
2
3
4
5
mixlm <- lm(y~x*r(z),
		    data = data.frame(y = rnorm(8),
							  x = factor(c(rep(1,4),rep(0,4))),
							  z = factor(rep(c(1,0),4))))
Anova(mixlm, type="III")

Example output

Attaching package: 'mixlm'

The following objects are masked from 'package:stats':

    glm, lm

Analysis of variance (unrestricted model)
Response: y
          Mean Sq Sum Sq Df F value Pr(>F)
x           3.520  3.520  1   69.90 0.0758
z           0.003  0.003  1    0.07 0.8394
x:z         0.050  0.050  1    0.03 0.8772
Residuals   1.857  7.428  4       -      -

            Err.term(s) Err.df  VC(SS)
1 x                 (3)      1   fixed
2 z                 (3)      1 -0.0118
3 x:z               (4)      4 -0.9033
4 Residuals           -      -  1.8569
(VC = variance component)

          Expected mean squares
x          (4) + 2 (3) + 4 Q[1]
z          (4) + 2 (3) + 4 (2) 
x:z        (4) + 2 (3)         
Residuals  (4)                 

mixlm documentation built on May 2, 2019, 6:08 p.m.

Related to Anova in mixlm...