multiCA.test: Multinomial Cochran-Armitage trend test

Description Usage Arguments Value Author(s) References Examples

View source: R/aaa-generics.R

Description

The multiCA.test function performs a multinomial generalization of the Cochran-Armitage trend test.

Usage

1
2
3
4
5
6
7
8
9
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 length(outcomes)<=3, and "Holm-Shaffer" otherwise.

formula

a formula of the form outcome ~ group where outcome is a factor representing the cateogrical outcome and group is the grouping variable over which the trend is tested.

data

an optional matrix or 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.

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 outcome - group combination was observed.

...

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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)

multiCA documentation built on May 2, 2019, 4:51 p.m.