mrrTest function

Madhava Rao-Raghunath Test for Testing Treatment vs. Control

Madhava Rao-Raghunath Test for Testing Treatment vs. Control

The function has implemented the nonparametric test of Madhava Rao and Raghunath (2016) for testing paired two-samples for symmetry. The null hypothesis H:F(x,y)=F(y,x)H: F(x,y) = F(y,x)

is tested against the alternative A:F(x,y)!=F(y,x)A: F(x,y) != F(y,x).

mrrTest(x, ...) ## Default S3 method: mrrTest(x, y = NULL, m = NULL, ...) ## S3 method for class 'formula' mrrTest(formula, data, subset, na.action, ...)

Arguments

  • x: numeric vector of data values. Non-finite (e.g., infinite or missing) values will be omitted.
  • ...: further arguments to be passed to or from methods.
  • y: an optional numeric vector of data values: as with x non-finite values will be omitted.
  • m: numeric, optional integer number, whereas n=kmn = k m needs to be full filled.
  • formula: a formula of the form response ~ group where response gives the data values and group a vector or factor of the corresponding groups.
  • data: an optional matrix or data frame (or similar: see model.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.
  • na.action: a function which indicates what should happen when the data contain NAs. Defaults to getOption("na.action").

Returns

A list with class "htest" containing the following components:

  • method: a character string indicating what type of test was performed.
  • data.name: a character string giving the name(s) of the data.
  • statistic: the estimated quantile of the test statistic.
  • p.value: the p-value for the test.
  • parameter: the parameters of the test statistic, if any.
  • alternative: a character string describing the alternative hypothesis.
  • estimates: the estimates, if any.
  • null.value: the estimate under the null hypothesis, if any.

Details

Let XiX_i and Yi, inY_i, ~ i \le n denote continuous variables that were observed on the same iith test item (e.g. patient) with i=1,ni = 1, \ldots n. Let

Ui=Xi+YiVi=XiYi U_i = X_i + Y_i \qquad V_i = X_i - Y_i%SEE PDF

Let U(i)U_{(i)} be the iith order statistic, U(1)U(2)U(n)U_{(1)} \le U_{(2)} \le \ldots U_{(n)} and kk the number of clusters, with the condition:

n=k m. n = k ~ m.%SEE PDF

Further, let the divider denote d0=d_0 = -\infty, dk=d_k = \infty, and else

dj=U(jm)+U(jm+1)2, 1jk1 d_j = \frac{ U_{(jm)} + U_{(jm+1)} }{2}, ~ 1 \le j \le k -1%SEE PDF

The two counts are

nj+={1if dj1<ui<dj,vi>00 n_j^{+} = \left\{\begin{array}{lr}1 & \mathrm{if}~ d_{j-1} < u_i < d_j, v_i > 0 \\0 &\end{array}\right.%SEE PDF

and

nj={1if dj1<ui<dj,vi00 n_j^{-} = \left\{\begin{array}{lr}1 & \mathrm{if}~ d_{j-1} < u_i < d_j, v_i \le 0 \\0 &\end{array}\right.%SEE PDF

The test statistic is

M=j=1k(nj+nj)2m M = \sum_{j = 1}^k \frac{\left(n_j^{+} - n_j^{-}\right)^2}{m}%SEE PDF

The exact p-values for 5n305 \le n \le 30 are taken from an internal look-up table. The exact p-values were taken from Table 7, Appendix B of Madhava Rao and Raghunath (2016).

If m = NULL the function uses n=mn = m for all prime numbers, otherwise it tries to find an value for m in such a way, that for k=n/mk = n / m all variables are integer.

Note

The function returns an error code if a value for m

is provided that does not lead to an integer of the ratio k=n/mk = n /m.

The function also returns an error code, if a tabulated value for given nn, mm and calculated MM

can not be found in the look-up table.

Examples

## Madhava Rao and Raghunath (2016), p. 151 ## Inulin clearance of living donors ## and recipients of their kidneys x <- c(61.4, 63.3, 63.7, 80.0, 77.3, 84.0, 105.0) y <- c(70.8, 89.2, 65.8, 67.1, 87.3, 85.1, 88.1) mrrTest(x, y) ## formula method ## Student's Sleep Data mrrTest(extra ~ group, data = sleep)

References

Madhava Rao, K.S., Ragunath, M. (2016) A Simple Nonparametric Test for Testing Treatment Versus Control. J Stat Adv Theory Appl 16 , 133–162. tools:::Rd_expr_doi("10.18642/jsata_7100121717")

  • Maintainer: Thorsten Pohlert
  • License: GPL (>= 3)
  • Last published: 2024-09-08

Useful links