chenTest: Chen's Many-to-One Comparisons Test

View source: R/chenTest.R

chenTestR Documentation

Chen's Many-to-One Comparisons Test

Description

Performs Chen's nonparametric test for contrasting increasing (decreasing) dose levels of a treatment.

Usage

chenTest(x, ...)

## Default S3 method:
chenTest(
  x,
  g,
  alternative = c("greater", "less"),
  p.adjust.method = c("SD1", p.adjust.methods),
  ...
)

## S3 method for class 'formula'
chenTest(
  formula,
  data,
  subset,
  na.action,
  alternative = c("greater", "less"),
  p.adjust.method = c("SD1", p.adjust.methods),
  ...
)

Arguments

x

a numeric vector of data values, or a list of numeric data vectors.

...

further arguments to be passed to or from methods.

g

a vector or factor object giving the group for the corresponding elements of "x". Ignored with a warning if "x" is a list.

alternative

the alternative hypothesis. Defaults to two.sided.

p.adjust.method

method for adjusting p values (see p.adjust)

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").

Details

Chen's test is a non-parametric step-down trend test for testing several treatment levels with a zero control. Let X_{0j} denote a variable with the j-th realization of the control group (1 \le j \le n_0) and X_{ij} the j-the realization in the i-th treatment group (1 \le i \le k). The variables are i.i.d. of a least ordinal scale with F(x) = F(x_0) = F(x_i), ~ (1 \le i \le k). A total of m = k hypotheses can be tested:

\begin{array}{ll} \mathrm{H}_{m}: \theta_0 = \theta_1 = \ldots = \theta_m, & \mathrm{A}_{m} = \theta_0 \le \theta_1 \le \ldots \theta_m, \theta_0 < \theta_m \\ \mathrm{H}_{m-1}: \theta_0 = \theta_1 = \ldots = \theta_{m-1}, & \mathrm{A}_{m-1} = \theta_0 \le \theta_1 \le \ldots \theta_{m-1}, \theta_0 < \theta_{m-1} \\ \vdots & \vdots \\ \mathrm{H}_{1}: \theta_0 = \theta_1, & \mathrm{A}_{1} = \theta_0 < \theta_1\\ \end{array}

The statistics T_i are based on a Wilcoxon-type ranking:

T_i = \sum_{j=0}^{i=1} \sum_{u=1}^{n_i} \sum_{v=1}^{n_j} I(x_{iu} - x_{jv}), \qquad (1 \leq i \leq k),

where the indicator function returns I(a) = 1, ~ \mathrm{if}~ a > 0, 0.5 ~ \mathrm{if} a = 0 otherwise 0.

The expected ith mean is

\mu(T_i) = n_i N_{i-1} / 2,

with N_j = \sum_{j =0}^i n_j and the ith variance:

\sigma^2(T_i) = n_i N_{i-1} / 12 ~ \left\{N_i + 1 - \sum_{j=1}^g t_j \left(t_j^2 - 1 \right) / \left[N_i \left( N_i - 1 \right)\right]\right\}.

The test statistic T_i^* is asymptotically standard normal

T_i^* = \frac{T_i - \mu(T_i)} {\sqrt{\sigma^2(T_i)}}, \qquad (1 \leq i \leq k).

The p-values are calculated from the standard normal distribution. The p-values can be adjusted with any method as available by p.adjust or by the step-down procedure as proposed by Chen (1999), if p.adjust.method = "SD1".

Value

A list with class "PMCMR" 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

lower-triangle matrix of the estimated quantiles of the pairwise test statistics.

p.value

lower-triangle matrix of the p-values for the pairwise tests.

alternative

a character string describing the alternative hypothesis.

p.adjust.method

a character string describing the method for p-value adjustment.

model

a data frame of the input data.

dist

a string that denotes the test distribution.

Note

Factor labels for g must be assigned in such a way, that they can be increasingly ordered from zero-dose control to the highest dose level, e.g. integers {0, 1, 2, ..., k} or letters {a, b, c, ...}. Otherwise the function may not select the correct values for intended zero-dose control.

It is safer, to i) label the factor levels as given above, and to ii) sort the data according to increasing dose-levels prior to call the function (see order, factor).

References

Chen, Y.-I., 1999, Nonparametric Identification of the Minimum Effective Dose. Biometrics 55, 1236–1240. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/j.0006-341X.1999.01236.x")}

See Also

wilcox.test, Normal

Examples

## Chen, 1999, p. 1237,
## Minimum effective dose (MED)
## is at 2nd dose level
df <- data.frame(x = c(23, 22, 14,
27, 23, 21,
28, 37, 35,
41, 37, 43,
28, 21, 30,
16, 19, 13),
g = gl(6, 3))
levels(df$g) <- 0:5
ans <- chenTest(x ~ g, data = df, alternative = "greater",
                p.adjust.method = "SD1")
summary(ans)


PMCMRplus documentation built on Nov. 27, 2023, 1:08 a.m.