Description Usage Arguments Details Value Author(s) Examples
Performs a permutation (randomization) test for homogeneity of one variable on two or more populations, using chi-square as the test statistic.
1 2 | perm.hom.test(x, type = c("cont", "flat", "raw"),
variable = NULL, R = 9999)
|
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). |
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.
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. |
Neil A. Weiss
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.