RVAideMemoire (version 0.9-69-3)

mood.medtest: Mood's median test

Description

Performs a Mood's median test to compare medians of independent samples.

Usage

mood.medtest(x, ...)

# S3 method for default mood.medtest(x, g, exact = NULL, ...)

# S3 method for formula mood.medtest(formula, data, subset, ...)

Arguments

x

a numeric vector of data values.

g

a vector or factor object giving the group for the corresponding elements of x.

exact

a logical indicating whether an exact p-value should be computed.

formula

a formula of the form a ~ b, where a and b give the data values and corresponding groups.

data

an optional data frame containing the variables in the formula formula. By default the variables are taken from environment(formula).

subset

an optional vector specifying a subset of observations to be used.

...

further arguments to be passed to or from other methods.

Value

method

a character string indicating the name of the test.

data.name

a character string giving the name(s) of the data.

statistic

the value the chi-squared test statistic (in case of a chis-square test).

parameter

the degrees of freedom of the approximate chi-squared distribution of the test statistic (in case of a chis-square test).

p.value

the p-value of the test.

Details

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.

Examples

Run this code
# NOT RUN {
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 DataCamp Workspace