perm.oneway.anova: Permutation One-Way ANOVA Test

Description Usage Arguments Details Value Author(s) Examples

Description

Performs a permutation (randomization) test for location, using trimmed data (trim = 0 gives untrimmed data) on several independent samples.

Usage

1
perm.oneway.anova(x, y, trim = 0, ford = NULL, R = 9999)

Arguments

x

a (non-empty) vector of observations of the (response) variable.

y

a vector of the corresponding populations (levels of the factor).

trim

the fraction (0 to 0.5) of observations to be trimmed from each sample; default is 0.

ford

an optional integer vector giving the change from alphabetical order of the populations to some other desired order.

R

number of replications (default = 9999).

Details

The null hypothesis is that the distributions of the variable are identical on all the populations. The alternative hypothesis is that the distributions of the variable have systematically larger values on some of the populations than on others.

Value

A list with class "perm.oneway.anova" containing the following components:

Perm.values

the values of the test statistic obtained from the permutations.

Header

the main title for the output.

Response

the name of the (response) variable.

Factor

the name of the factor.

Levels

the populations (levels of the factor).

n

the sample sizes.

Mean

the sample means.

SD

the sample standard deviations.

Statistic

the test statistic; here, always F.trim.

Observed

the observed value of the test statistic.

P.value

the P-value or a statement like P < 0.001.

p.value

the P-value.

Trim

the trim value.

Author(s)

Neil A. Weiss

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Last year's energy consumptions, to the nearest 10 million BTU, for
# independent random samples of households in the four U.S. regions.
data("energy")
str(energy)
attach(energy)

# Permutation one-way ANOVA to decide whether the energy distributions
# have systematically larger values in some U.S. regions than in others.
# Regions ordered to Northeast, Midwest, South, and West; 999 replications.
perm.oneway.anova(ENERGY, REGION, ford = c(2,1,3,4), R = 999)

detach(energy)  # clean up

Example output

'data.frame':	20 obs. of  2 variables:
 $ ENERGY: int  13 8 11 12 11 15 10 16 11 13 ...
 $ REGION: Factor w/ 4 levels "Midwest","Northeast",..: 2 2 2 2 2 1 1 1 1 1 ...


 RESULTS OF PERMUTATION 0% TRIMMED ONE-WAY ANOVA
 BASED ON 999 REPLICATIONS  

SUMMARY STATISTICS

    REGION n Mean       SD
 Northeast 5 11.0 1.870829
   Midwest 6 12.5 2.588436
     South 4  7.5 3.000000
      West 5  7.2 1.923538

HYPOTHESIS TEST

 Response Factor Trim Statistic Observed P.value
   ENERGY REGION    0    F.trim 6.324748   0.007

wPerm documentation built on May 2, 2019, 3:02 a.m.