kepner_robinson_test: Kepner-Robinson Test

Description Usage Arguments Value References Examples

View source: R/S3method.R

Description

This function calculates the Kepner-Robinson test using ranks under the null hypothesis H0F: F_1 = ... F_k where F_i are the marginal distributions. Each subject needs to have k measurements. This test assumes that the covariance matrix of a subject has a compound symmetry structure.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
kepner_robinson_test(x, ...)

## S3 method for class 'numeric'
kepner_robinson_test(
  x,
  time,
  subject,
  na.rm = FALSE,
  distribution = c("Chisq", "F"),
  ...
)

## S3 method for class 'formula'
kepner_robinson_test(
  formula,
  data,
  subject,
  na.rm = FALSE,
  distribution = c("Chisq", "F"),
  ...
)

Arguments

x

numeric vector containing the data

...

further arguments are ignored

time

factor specifying the groups

subject

factor specifying the subjects or the name of the subject column if a data.frame is used

na.rm

a logical value indicating if NA values should be removed

distribution

either 'Chisq' or 'F' approximation

formula

optional formula object

data

optional data.frame of the data

Value

Returns an object of class 'pseudorank'

References

James L. Kepner & David H. Robinson (1988) Nonparametric Methods for Detecting Treatment Effects in Repeated-Measures Designs, Journal of the American Statistical Association, 83:402, 456-461.

Examples

1
2
3
4
5
x = c(1, 1, 1, 1, 2, 3, 4, 5, 6)
grp = as.factor(c('A','A','B','B','B','D','D','D','D'))

# calculate Kruskal-Wallis test using pseudo-ranks
kruskal_wallis_test(x, grp, na.rm = FALSE, pseudoranks = TRUE)

Example output

Kruskal-Wallis Test
 
Test Statistic:  6.736842 
Distribution of Statistic:  Chisq 
Degrees of Freedom:  2 
unweighted relative Effects / Pseudo-ranks:  TRUE
p-Value:  0.03444398 

pseudorank documentation built on Oct. 23, 2020, 7:15 p.m.