Learn R Programming

wPerm (version 1.0.1)

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

Description

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

Usage

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).

Value

  • A list with class "perm.oneway.anova" containing the following components:
  • Perm.valuesthe values of the test statistic obtained from the permutations.
  • Headerthe main title for the output.
  • Responsethe name of the (response) variable.
  • Factorthe name of the factor.
  • Levelsthe populations (levels of the factor).
  • nthe sample sizes.
  • Meanthe sample means.
  • SDthe sample standard deviations.
  • Statisticthe test statistic; here, always F.trim.
  • Observedthe observed value of the test statistic.
  • P.valuethe P-value or a statement like P < 0.001.
  • p.valuethe P-value.
  • Trimthe trim value.

concept

  • permutation tests
  • randomization tests
  • tests for difference in location
  • inferences for several independent samples
  • one-way ANOVA
  • permutation one-way ANOVA test

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.

Examples

Run this code
# 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

Run the code above in your browser using DataLab