perm.hom.test: Permutation Homogeneity Test

Description Usage Arguments Details Value Author(s) Examples

Description

Performs a permutation (randomization) test for homogeneity of one variable on two or more populations, using chi-square as the test statistic.

Usage

1
2
perm.hom.test(x, type = c("cont", "flat", "raw"),
              variable = NULL, R = 9999)

Arguments

x

a data frame (see details below).

type

a character string indicating the type of data frame; must be one of "cont" (default), "flat", or "raw".

variable

an optional character string that gives the name of the variable whose distributions are to be compared.

R

number of replications (default = 9999).

Details

The null hypothesis is that the populations are homogeneous with respect to the variable under consideration. The alternative hypothesis is that the populations are nonhomogeneous with respect to the variable under consideration.

Types of data frames permitted:

cont: In this type of data frame, the first variable gives either the possible values of the variable under consideration or the populations. The remaining variables give the observed frequencies.

flat: This type of data frame consists of three variables. The first two variables give the pairs of possible values of the variable under consideration and the populations; the third variable gives the frequencies of the pairs.

raw: This type of data frame consists of two variables, which give the raw data of the variable-values and populations.

Value

A list with class "perm.cs.hom" containing the following components:

Perm.values

the values of chi-square obtained from the permutations.

Header

the main title for the output.

Variable

the name of the variable whose distributions are to be compared or NULL.

Statistic

the statistic used for the permutation test; here, always chi.square.

Observed

the value of the chi-square statistic for the observed data.

n

the (total) sample size.

Null

the null hypothesis; here, always homogeneous.

Alternative

the alternative hypothesis; here, always nonhomogeneous.

P.value

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

p.value

the P-value.

Author(s)

Neil A. Weiss

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Self-concept for independent random samples of sighted and blind
# Indian adolescents.
data("self")
str(self)
self
# Note that self is in the form of a contingency table ("cont").

# Permutation homogeneity test to decide whether a difference exists in
# self-concept distributions between sighted and blind Indian adolescents,
# using 999 replications.
perm.hom.test(self, "cont", "Self-concept", 999)
# Or, equivalently, since "cont" is the default "type":
perm.hom.test(self, variable = "Self-concept", R = 999)

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