twoway {twoway} | R Documentation |
Analysis of a two-way table with one observation per cell
Description
Fits an additive model using either row and column means or Tukey's median polish procedure
Usage
twoway(x, ...)
## Default S3 method:
twoway(x, method = c("mean", "median"), ...,
name = deparse(substitute(x)), responseName = attr(x, "response"),
varNames = names(dimnames(x)))
Arguments
x |
a numeric matrix or data frame. |
... |
other arguments passed down |
method |
one of |
name |
name for the input dataset |
responseName |
name for the response variable |
varNames |
names for the Row and Column variables |
Details
The rownames(x)
are used as the levels of the row factor and the colnames(x
) are
the levels of the column factor.
For a numeric matrix, the function uses the names(dimnames(x))
as the names of these
variables, and, if present, a responseName
attribute as the name for the response variable.
Value
An object of class c("twoway")
with the following named components:
- overall
the fitted constant term.
- roweff
the fitted row effects.
- coleff
the fitted column effects.
- residuals
the residuals.
- name
the name of the dataset.
- rownames
the names for the rows
- colnames
the names for the columns
- method
the fitting method
- varNames
the names of the row and column variables
- responseName
the name of the response variable
- compValue
the comparison values, for the diagnostic plot
- slope
the slope value, for the diagnostic plot
- power
the suggested power transformation,
1-slope
An object of class "twoway"
, but supplemented by additional components used for labeling
Author(s)
Michael Friendly
References
Tukey, J. W. (1977). Exploratory Data Analysis, Reading MA: Addison-Wesley. Friendly, M. (1991). SAS System for Statistical Graphics Cary, NC: SAS Institute
See Also
codetwoway.formula, codemedpolish
Examples
data(taskRT)
twoway(taskRT)