scheirerRayHare: Scheirer Ray Hare test

View source: R/scheirerRayHare.r

scheirerRayHareR Documentation

Scheirer Ray Hare test

Description

Conducts Scheirer Ray Hare test.

Usage

scheirerRayHare(
  formula = NULL,
  data = NULL,
  y = NULL,
  x1 = NULL,
  x2 = NULL,
  type = 2,
  tie.correct = TRUE,
  ss = TRUE,
  verbose = TRUE
)

Arguments

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 1, 2, "I", or "II".

tie.correct

If "TRUE", applies a correction for ties in the response variable.

ss

If "TRUE", includes the sums of squares in the output.

verbose

If "TRUE", outputs statistics used in the analysis by direct print.

Details

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.

Value

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.

Acknowledgments

Thanks to Guillaume Loignon for the suggestion to include type-II sum-of-squares.

Note

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.

Author(s)

Salvatore Mangiafico, mangiafico@njaes.rutgers.edu

References

Sokal, R.R. and F.J. Rohlf. 1995. Biometry. 3rd ed. W.H. Freeman, New York.

https://rcompanion.org/handbook/F_14.html

Examples

### 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)
                                                             

rcompanion documentation built on Sept. 17, 2023, 5:07 p.m.