kruskal.test(x, g)
x
| a numeric vector of data values, or a list of numeric data vectors. |
g
|
a vector or factor object giving the group for the
corresponding elements of x . Ignored if x is a
list.
|
kruskal.test
performs a Kruskal-Wallis rank sum test of the
null that the location parameters of the distribution of x
are the same in each group (sample). The alternative is that they
differ in at least one.
If x
is a list, its elements are taken as the samples to be
compared, and hence have to be numeric data vectors. In this case,
g
is ignored, and one can simply use kruskal.test(x)
to perform the test. If the samples are not yet contained in a
list, use kruskal.test(list(x, ...))
.
Otherwise, x
must be a numeric data vector, and g
must
be a vector or factor object of the same length as x
giving
the group for the corresponding elements of x
.
"htest"
containing the following
components:
statistic
| the Kruskal-Wallis rank sum statistic. |
parameter
| the degrees of freedom of the approximate chi-square distribution of the test statistic. |
p.value
| the p-value of the test. |
method
|
the string "Kruskal-Wallis rank sum test" .
|
data.name
| a character string giving the names of the data. |