crossMeans: Means for 2 way ANOVA

Description Usage Arguments Value Note Author(s) References

View source: R/crossMeans.R

Description

A function used to calculate a 2 x 2 table of means for use in ANOVA.

Usage

1
2
crossMeans(dtf, f1 = "f1", f2 = "f2", y = "y", deci = 1,
  margins = FALSE)

Arguments

dtf

A data frame.

f1

Name of the first categorical predictor variable (quoted or unquoted). Defaults to "f1".

f2

Name of the second categorical predictor variable (quoted or unquoted). Defaults to "f2".

y

Name of the quantitative outcome (quoted or unquoted). Defaults to "y".

deci

Number of decimal places in the output. Defaults to 1.

margins

Set to TRUE to add marginal means. Defaults to FALSE.

Value

A named matrix with the resulting 2-way table of means.

Note

Minor style modifications made by Frank Kovacs (fkovacs AT andrew.cmu.edu).

We use the drop = FALSE in the aggregate function in the code to account for missing values.

Author(s)

Howard Seltman, hseltman AT stat.cmu.edu

References

Code taken from Howard Seltman's (hseltman AT cmu.edu) personal website. http://www.stat.cmu.edu/~hseltman/AboutMe.html.


frank113/cmu202 documentation built on July 17, 2020, 9:31 p.m.