Last chance! 50% off unlimited learning
Sale ends in
Performs a Mood's median test to compare medians of independent samples.
mood.medtest(x, ...)# S3 method for default
mood.medtest(x, g, exact = NULL, ...)
# S3 method for formula
mood.medtest(formula, data, subset, ...)
a character string indicating the name of the test.
a character string giving the name(s) of the data.
the value the chi-squared test statistic (in case of a chis-square test).
the degrees of freedom of the approximate chi-squared distribution of the test statistic (in case of a chis-square test).
the p-value of the test.
a numeric vector of data values.
a vector or factor object giving the group for the corresponding elements of x
.
a logical indicating whether an exact p-value should be computed.
a formula of the form a ~ b
, where a
and b
give the data values and corresponding groups.
an optional data frame containing the variables in the formula formula
. By default the variables are taken from environment(formula)
.
an optional vector specifying a subset of observations to be used.
further arguments to be passed to or from other methods.
Maxime HERVE <maxime.herve@univ-rennes1.fr>
If exact=NULL
, a Fisher's exact test is used if the number of data values is < 200; otherwise a chi-square test is used, with Yates continuity correction if necessary.
set.seed(1716)
response <- c(rnorm(10,3,1.5),rnorm(10,5.5,2))
fact <- gl(2,10,labels=LETTERS[1:2])
mood.medtest(response~fact)
Run the code above in your browser using DataLab