Displays summary information for a two-way anova analysis. The lm object
must come from a numerical response variable and factors. The output depends
on the value of page:
summary2way(
fit,
page = c("table", "means", "effects", "interaction", "nointeraction"),
digit = 5,
conf.level = 0.95,
print.out = TRUE,
new = TRUE,
all = FALSE,
FUN = "identity",
...
)`summary2way()` prints the requested teaching summary page and invisibly returns the current summary components. The returned list has the following components:
degrees of freedom for regression, residual and total.
sum squares for regression, residual and total.
mean squares for regression and residual.
F-statistic value.
The P-value associated with each F-test.
The overall mean of the response variable.
The main effects for the first (row) factor.
The main effects for the second (column) factor.
The
interaction effects if an interaction model has been fitted,
otherwise NULL.
If new = TRUE,
then this is a list with five components: table - the
ANOVA table, means the table of means from
model.tables, effects - the table of effects from
model.tables, and comparisons - the differences
in the means with standard errors, confidence bounds, and
P-values from TukeyHSD
.
an lm object, i.e. the output from lm().
options for output: "table", "means",
"effects", "interaction", or
"nointeraction".
the number of decimal places in the display.
confidence level of the intervals.
if TRUE, print the output on the screen.
if TRUE then this will run the new version of
summary2way which should be more robust than the old
version. However, it does not work in the same way. In
particular, when page = 'means' it does not return
summary statistics for each grouping of the data (pooled, by row
factor, by column factor, and by interaction factor). Instead, it
simply returns the means for each grouping.
Only applicable to page = "interaction". If
TRUE, pairwise comparisons for all combinations of
factor levels are shown. Otherwise, comparisons are only shown
between combinations that have the same level for one of the
factors.
optional function to be applied to estimates and confidence intervals. Typically for backtransformation operations.
other arguments such as inttype and pooled.
page = "table": ANOVA table.
page = "means": cell means matrix and numeric summary.
page = "effects": table of effects.
page = "interaction": interaction contrast tables.
page = "nointeraction": main-effect contrast tables.
summary1way, model.tables,
TukeyHSD
## Arousal data:
data(arousal.df)
arousal.fit = lm(arousal ~ gender * picture, data = arousal.df)
summary2way(arousal.fit)
## Butterfat data:
data("butterfat.df")
fit = lm(log(Butterfat) ~ Breed + Age, data = butterfat.df)
summary2way(fit, page = "nointeraction", FUN = exp)
Run the code above in your browser using DataLab