View source: R/scheirerRayHare.r
scheirerRayHare | R Documentation |
Conducts Scheirer Ray Hare test.
scheirerRayHare(
formula = NULL,
data = NULL,
y = NULL,
x1 = NULL,
x2 = NULL,
type = 2,
tie.correct = TRUE,
ss = TRUE,
verbose = TRUE
)
formula |
A formula indicating the response variable and two independent variables. e.g. y ~ x1 + x2. |
data |
The data frame to use. |
y |
If no formula is given, the response variable. |
x1 |
If no formula is given, the first independent variable. |
x2 |
If no formula is given, the second independent variable. |
type |
The type of sum of squares to be used.
Acceptable options are |
tie.correct |
If |
ss |
If |
verbose |
If |
The Scheirer Ray Hare test is a nonparametric test used for a two-way factorial experiment. It is described by Sokal and Rohlf (1995).
It is sometimes recommended that the design should be balanced, and that there should be at least five observations for each cell in the interaction.
One might consider using aligned ranks transformation anova instead of the Scheirer Ray Hare test.
Note that for unbalanced designs, by default, a type-II sum-of-squares approach is used.
The input should include either formula
and data
;
or y
, x1
, and x2
.
The function removes cases with NA in any of the variables.
A data frame of results similar to an anova table. Output from the
verbose
option is printed directly and not returned with
the data frame.
Thanks to Guillaume Loignon for the suggestion to include type-II sum-of-squares.
The parsing of the formula is simplistic. The first variable on the left side is used as the measurement variable. The first variable on the right side is used for the first independent variable. The second variable on the right side is used for the second independent variable.
Salvatore Mangiafico, mangiafico@njaes.rutgers.edu
Sokal, R.R. and F.J. Rohlf. 1995. Biometry. 3rd ed. W.H. Freeman, New York.
https://rcompanion.org/handbook/F_14.html
### Example from Sokal and Rohlf, 1995.
Value = c(709,679,699,657,594,677,592,538,476,508,505,539)
Sex = c(rep("Male",3), rep("Female",3), rep("Male",3), rep("Female",3))
Fat = c(rep("Fresh", 6), rep("Rancid", 6))
Sokal = data.frame(Value, Sex, Fat)
scheirerRayHare(Value ~ Sex + Fat, data=Sokal)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.