Learn R Programming

MCPAN (version 1.1-21)

binomRDtest: Simultaneous test for contrasts of independent binomial proportions (in a oneway layout)

Description

P-value of maximum test and adjusted p-values for M contrasts of I groups in a one-way layout. Tests are performed for contrasts of proportions, which can be interpreted as differences of (weighted averages of) proportions.

Usage

binomRDtest(x, ...)

# S3 method for default binomRDtest(x, n, names=NULL, type="Dunnett", cmat=NULL, method="Wald", alternative="two.sided", dist="MVN", ...)

# S3 method for formula binomRDtest(formula, data, type="Dunnett", cmat=NULL, method="Wald", alternative="two.sided", dist="MVN", ...)

# S3 method for table binomRDtest(x, type="Dunnett", cmat=NULL, method="Wald", alternative="two.sided", dist="MVN", ...)

# S3 method for matrix binomRDtest(x, type="Dunnett", cmat=NULL, method="Wald", alternative="two.sided", dist="MVN", ...)

Arguments

x

a numeric vector, giving the number of successes in I independent samples, or an object of class "table", representing the 2xk-table, or an object of class "matrix", representing the 2xk-table

n

a numerioc vector, giving the number of trials (i.e. the sample size) in each of the I groups

names

an optional character vector, giving the names of the groups in x, n; if not specified, possibly availbale names of x are taken as group names

formula

a two-sided formula of the style 'response ~ treatment', where 'response' should be a categorical variable with two levels, while treatment should be a factor specifying the treatment levels

data

a data.frame, containing the variables specified in formula

type

a character string specifying the contrast type

cmat

an optional user defined contrast matrix of dimension MxI

method

a single charcter string, specifying the method for adjustment, with options: "Wald" (Maximum likelihood estimators), "ADD1" (add1-adjustment on the raw proportion estimates) "ADD2" (add2-adjustment on proportion estimates following Agresti Caffo (2000))

alternative

a character string specifying the direction of the alternative hypothesis

dist

a character string, where "MVN" invokes the computation of p-values using the multivariate normal distribution, and "N" invokes use p-value computation using the univariate normal distribution

arguments to be passed to binomest, currently only success labelling the event which should be considered as success

Value

An object of class "binomRDtest", a list containing:

teststat

a numeric vector of teststatistics of length M

pval

a single numeric p-value, the p-value of the maximum test (minimum p-value)

p.val.adj

a vector of length M, the adjusted p-values of the single contrasts

dist

character string indicating whether the multivariate normal or normal distribution was used for computation of p-values

alternative

a single character vector, as the input

x

the observed number of successes in the treatment groups

n

the number of trials in the treatment groups

p

the estimated proportions in the treatment groups

success

a character string labelling the event considered as success

method

as input, a character string

cmat

used contrast matrix

Details

For usage, see the examples.

References

Statistical procedures and characterization of coverage probabilities are described in: Sill, M. (2007): Approximate simultaneous confidence intervals for multiple comparisons of binomial proportions. Master thesis, Institute of Biostatistics, Leibniz University Hannover.

See Also

summary.binomRDtest

Examples

Run this code
# NOT RUN {
ntrials <- c(40,20,20,20)
xsuccesses <- c(1,2,2,4)
names(xsuccesses) <- LETTERS[1:4]
binomRDtest(x=xsuccesses, n=ntrials, method="ADD1",
 type="Dunnett")

binomRDtest(x=xsuccesses, n=ntrials, method="ADD1",
 type="Williams", alternative="greater")

binomRDtest(x=xsuccesses, n=ntrials, method="ADD2",
 type="Williams", alternative="greater")
# }

Run the code above in your browser using DataLab