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",
...
)
A list with 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 assoicated 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', 'nointeraction'
the number of decimal places in the display.
confidence level of the intervals.
if TRUE, print out 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. It does not work in the same way however. In
particular, when page = 'means'
it does not return
summary statistics for each grouping of the data (pooled/by row
factor/by column factor/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 like inttype, pooled etc.
page = 'table' anova table page = 'means' cell means matrix, numeric summary page = 'effects' table of effects page = 'interaction' tables of contrasts page = 'nointeraction' tables of contrasts
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