multiCA.test {multiCA} | R Documentation |
Multinomial Cochran-Armitage trend test
Description
The multiCA.test
function performs a multinomial generalization of the
Cochran-Armitage trend test.
Usage
multiCA.test(x, ...)
## Default S3 method:
multiCA.test(x, scores = 1:ncol(x), outcomes = 1:nrow(x),
p.adjust.method = c("none", "closed.set", "Holm-Shaffer", "single-step",
"Westfall"), ...)
## S3 method for class 'formula'
multiCA.test(formula, data, subset, na.action, weights, ...)
Arguments
x |
a two-dimensional matrix of event counts with the outcomes as rows and ordered groups as columns. |
scores |
non-decreaseing numeric vector of the same length as the number of ordered groups. Defaults to linearly increasing values |
outcomes |
integer or character vector defining the set of outcomes (by row index or row name) over which the trend should be tested. Defaults to all outcomes. |
p.adjust.method |
character string defining the correction method for individual outcome p-values. Defaults to "closed.set" when |
formula |
a formula of the form |
data |
an optional matrix or data frame containing the variables in the 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"). |
weights |
an integer-valued variable representing the number of times each |
... |
other arguments |
Value
a list with two components
overall |
an object of class "htest" with the results of the overall test |
individual |
a vector with adjusted p-values for individual outcomes |
Author(s)
Aniko Szabo
References
Szabo, A. (2016) Test for trend with a multinomial outcome.
Examples
data(stroke)
## using formula interface
multiCA.test(Type ~ Year, weights=Freq, data=stroke)
##using Westfall's multiple testing adjustment
multiCA.test(Type ~ Year, weights=Freq, data=stroke, p.adjust.method="Westfall")
## using matrix interface and testing only the first 3 outcomes
strk.mat <- xtabs(Freq ~ Type + Year, data=stroke)
multiCA.test(strk.mat, outcomes=1:3)