kepner_robinson_test_internal: Kepner-Robinson Test

Description Usage Arguments Value References Examples

View source: R/kepner_robinson.R

Description

This function calculates the Kepner-Robinsin test under the null hypothesis H0F: F_1 = ... F_k.

Usage

1
2
3
4
5
6
7
8
9

Arguments

data

numeric vector containing the data

na.rm

a logical value indicating if NA values should be removed

formula

formula object

...

further arguments are ignored

group

ordered factor vector for the groups

alternative

either decreasing or increasing

trend

custom numeric vector indicating the trend for the custom alternative, only used if alternative = "custom"

Value

Returns a data.frame with the results

References

Kepner, J. L., & Robinson, D. H. (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.