art: Aligned rank transform of non-parametric data for further...

View source: R/art.r

artR Documentation

Aligned rank transform of non-parametric data for further analysis using ANOVA

Description

This function performs the aligned rank transforms on non-parametric data which is useful for further analysis using parametric techniques like ANOVA.

Usage

art(
  x,
  response = names(x)[1],
  factors = names(x)[2:ncol(x)],
  subject = NULL,
  fun = function(x) mean(x, na.rm = TRUE),
  verbose = FALSE
)

Arguments

x

Data frame.

response

Character. Names of column of x that has response variable (default is to use the first column).

factors

Character list. Names of columns of x used to define factors and levels (default is to use all columns except for the first).

subject

NULL or character. Name of column in x that has the subject variable. If NULL then this is ignored. If specified, residuals are calculated for each cell defined by factors, not by subject and factors, but aligning is done using both factors and subject.

fun

Function. Function used to calculate cell centering statistic (the default is to use: mean with na.rm=TRUE). The function can be any that handles a list of one or more elements.

verbose

Logical. If TRUE then display progress.

Details

The function successfully re-creates rankings given by ARTool (Wobbrock et al. 2011) of data in Higgins et al. (1990) for data with 2 and 3 factors. If response is ranks and the set of ranks in each cell is the same (e.g., each cell has ranks 1, 2, and 3, but not necessarily in that order), then all values will be equal across the different ART variables. This occurs because the center of each cell (e.g., the mean) is the same as the grand mean, so the aligned values are simply the residuals. An ANOVA on this data yields no variance across cells, so the F tests are invalid.

Value

Data frame.

References

Higgins, J.J., Blair, R.C., and Tashtoush, S. 1990. The aligned rank transform procedure. Proceedings of the Conference on Applied Statistics in Agriculture. Manhattan, Kansas: Kansas State University, pp. 185-195. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.4148/2475-7772.1443")}

Peterson, K. 2002. Six modifications of the aligned rank transform test for interaction. Journal of Modern Applied Statistical Methods 1:100-109. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.22237/jmasm/1020255240")}

Wobbrock, J.O., Findlater, L., Gergle, D., and Higgins, J.J. 2011. The aligned rank transform for nonparametric factorial analysis using only ANOVA procedures. Proceedings of the ACM Conference on Human Factors in Computing Systems (CHI 2011). Vancouver, British Columbia (May 7-12, 2011). New York: ACM Press, pp. 143-146. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1145/1978942.1978963")}.

Examples

x <- data.frame(
   subject=c('a', 'b', 'c', 'a', 'b', 'c', 'a', 'b', 'c', 'a', 'b', 'c'),
   factor1=c('up', 'up', 'up', 'up', 'up', 'up', 'down', 'down', 'down', 'down',
      'down', 'down'),
   factor2=c('high', 'med', 'low', 'high', 'med', 'low', 'high', 'med', 'low', 'high',
      'med', 'low'),
   response=c(1, 17, 1, 1, 0, 4, 5, 6, 3, 7, 100, 70)
)
art(x=x, response='response', factors=c('factor1', 'factor2'))

adamlilith/statisfactory documentation built on Jan. 3, 2024, 10:37 p.m.