Extracts hypothesis matrices for terms in ANOVA tables detailing exactly which functions of the parameters are being tested in anova tables.
# S3 method for class 'anova'
show_tests(object, fractions = FALSE, names = TRUE, ...)a list of hypothesis matrices.
show_tests for ls_means
objects.
# Fit basic model to the 'cake' data:
data("cake", package="lme4")
fm1 <- lmer(angle ~ recipe * temp + (1|recipe:replicate), cake)
# Type 3 anova table:
(an <- anova(fm1, type="3"))
#> Type III Analysis of Variance Table with Satterthwaite's method
#> Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
#> recipe 4.00 2.00 2 254.02 0.0957 0.9088
#> temp 1966.71 1966.71 1 222.00 94.1632 <2e-16 ***
#> recipe:temp 1.74 0.87 2 222.00 0.0417 0.9592
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
# Display tests/hypotheses for type 1, 2, and 3 ANOVA tables:
# (and illustrate effects of 'fractions' and 'names' arguments)
show_tests(anova(fm1, type="1"))
#> $recipe
#> (Intercept) recipeB recipeC temp recipeB:temp recipeC:temp
#> recipeB 0 1 -0.5 0 200 -100
#> recipeC 0 0 1.0 0 0 200
#>
#> $temp
#> (Intercept) recipeB recipeC temp recipeB:temp recipeC:temp
#> temp 0 0 0 1 0.3333333 0.3333333
#>
#> $`recipe:temp`
#> (Intercept) recipeB recipeC temp recipeB:temp recipeC:temp
#> recipeB:temp 0 0 0 0 1 -0.5
#> recipeC:temp 0 0 0 0 0 1.0
#>
show_tests(anova(fm1, type="2"), fractions=TRUE, names=FALSE)
#> $recipe
#> [,1] [,2] [,3] [,4] [,5] [,6]
#> [1,] 0 1 0 0 0 0
#> [2,] 0 0 1 0 0 0
#>
#> $temp
#> [,1] [,2] [,3] [,4] [,5] [,6]
#> [1,] 0 0 0 1 1/3 1/3
#>
#> $`recipe:temp`
#> [,1] [,2] [,3] [,4] [,5] [,6]
#> [1,] 0 0 0 0 1 0
#> [2,] 0 0 0 0 0 1
#>
show_tests(an, fractions=TRUE)
#> $recipe
#> (Intercept) recipeB recipeC temp recipeB:temp recipeC:temp
#> recipeB 0 1 0 0 0 0
#> recipeC 0 0 1 0 0 0
#>
#> $temp
#> (Intercept) recipeB recipeC temp recipeB:temp recipeC:temp
#> temp 0 0 0 1 1/3 1/3
#>
#> $`recipe:temp`
#> (Intercept) recipeB recipeC temp recipeB:temp recipeC:temp
#> recipeB:temp 0 0 0 0 1 0
#> recipeC:temp 0 0 0 0 0 1
#>