scheirerRayHare.RdConducts Scheirer Ray Hare test.
scheirerRayHare(
formula = NULL,
data = NULL,
y = NULL,
x1 = NULL,
x2 = NULL,
type = 2,
tie.correct = TRUE,
ss = TRUE,
verbose = TRUE
)A formula indicating the response variable and two independent variables. e.g. y ~ x1 + x2.
The data frame to use.
If no formula is given, the response variable.
If no formula is given, the first independent variable.
If no formula is given, the second independent variable.
The type of sum of squares to be used.
Acceptable options are 1, 2,
"I", or "II".
If "TRUE", applies a correction for ties in the
response variable.
If "TRUE", includes the sums of squares in the output.
If "TRUE", outputs statistics used in the analysis
by direct print.
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.
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.
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.
Thanks to Guillaume Loignon for the suggestion to include type-II sum-of-squares.
Sokal, R.R. and F.J. Rohlf. 1995. Biometry. 3rd ed. W.H. Freeman, New York.
### 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)
#>
#> DV: Value
#> Observations: 12
#> D: 1
#> MS total: 13
#>
#> Df Sum Sq H p.value
#> Sex 1 8.333 0.6410 0.42334
#> Fat 1 108.000 8.3077 0.00395
#> Sex:Fat 1 5.333 0.4103 0.52184
#> Residuals 8 21.333