Learn R Programming

ANSM5 (version 1.1.1)

friedman: Perform Friedman test

Description

friedman() performs the Friedman test and is used in chapter 7 of "Applied Nonparametric Statistical Methods" (5th edition)

Usage

friedman(
  y,
  groups,
  blocks,
  use.Iman.Davenport = FALSE,
  max.exact.perms = 1e+05,
  nsims.mc = 1e+05,
  seed = NULL,
  do.asymp = FALSE,
  do.exact = TRUE
)

Value

An ANSMtest object with the results from applying the function

Arguments

y

Numeric vector of same length as groups, blocks

groups

Factor of same length as y, blocks with levels such that length(y) == nlevels(groups) * nlevels(blocks)

blocks

Factor of same length as y, groups with levels such that length(y) == nlevels(groups) * nlevels(blocks)

use.Iman.Davenport

Boolean indicating whether or not to use Iman and Davenport approximation (defaults to FALSE)

max.exact.perms

Maximum number of permutations allowed for exact calculations (defaults to 100000)

nsims.mc

Number of Monte Carlo simulations to be performed (defaults to 100000)

seed

Random number seed to be used for Monte Carlo simulations (defaults to NULL)

do.asymp

Boolean indicating whether or not to perform asymptotic calculations (defaults to FALSE)

do.exact

Boolean indicating whether or not to perform exact calculations (defaults to TRUE)

Examples

Run this code
# Example 7.6 from "Applied Nonparametric Statistical Methods" (5th edition)
friedman(ch7$pulse, ch7$time.period, ch7$student, do.exact = FALSE, do.asymp = TRUE)

# Exercise 7.12 from "Applied Nonparametric Statistical Methods" (5th edition)
friedman(ch7$names.recalled, ch7$group, ch7$medical.student, use.Iman.Davenport = TRUE,
  do.exact = FALSE, do.asymp = TRUE)

Run the code above in your browser using DataLab