perm.f.test: Permutation Test on the F-statistic

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/perm.f.test.R

Description

A permutation F-test is performed, and a one-way analysis of variance F-test is performed.

Usage

1
perm.f.test(response, treatment = NULL, num.sim = 20000)

Arguments

response

Numeric vector of responses if treatment is not NULL. If treatment is NULL, then response must be an N by 2 data frame or matrix, such that the first column represents response and the second column represents treatment.

treatment

Vector of treatments, which need not be numerical. If response is an N by 2 data frame or matrix, then treatment should be set to NULL.

num.sim

The number of simulations performed. If num.sim is smaller than one, then the permutation test is not performed.

Details

The one-way analysis of variance F-test is performed, regardless of the value of num.sim. The permutation F-test is performed whenever num.sim is at least 1. The p-value of the permutation F-test is estimated by randomly generating the permutations, and is hence not exact. The larger the value of num.sim the more precise the estimate of the p-value of the permutation F-test, but also the greater the computing time. Thus, the p-value of the permutation F-test is not based on asymptotic approximation.

Value

The output consists of results from calling aov and from the permutation F-test.

Note

The formulas computed within perm.f.test are based on the textbook by Higgins (2004).

Author(s)

Steven T. Garren, James Madison University, Harrisonburg, Virginia, USA

References

Higgins, J. J. (2004) Introduction to Modern Nonparametric Statistics.

See Also

aov and perm.test.

Examples

1
perm.f.test( c( 14,6,5,2,54,7,9,15,11,13,12 ), rep( c("I","II","III"), c(4,4,3) ) )

Example output

[[1]]
[1] "One-way ANOVA"

[[2]]
            Df  Sum Sq Mean Sq F value Pr(>F)
treatment    2  429.23  214.61  1.1109 0.3752
Residuals    8 1545.50  193.19               

[[3]]
[1] "The p-value from the permutation F-test based on"

[[4]]
[1] "20000 simulations is 0.4034"

jmuOutlier documentation built on Aug. 6, 2019, 1:03 a.m.