mood.medtest: Mood's median test

View source: R/mood.medtest.R

mood.medtestR Documentation

Mood's median test

Description

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

Usage


mood.medtest(x, ...)

## Default S3 method:
mood.medtest(x, g, exact = NULL, ...)

## S3 method for class '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.

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.

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.

Author(s)

Maxime HERVE <maxime.herve@univ-rennes1.fr>

Examples

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)

RVAideMemoire documentation built on Nov. 6, 2023, 5:07 p.m.