Learn R Programming

DoseFinding (version 0.6-3)

critVal: Calculate critical value for multiple contrast test

Description

This function calculates the critical value for a multiple contrast test via numerical integration (using the methods implemented in the mvtnorm package).

Usage

critVal(cMat, n, alpha = 0.025,
        alternative = c("one.sided", "two.sided"),
        control = mvtnorm.control(), corMat = NULL, nDF = NULL)

Arguments

cMat
A matrix with the contrasts in the columns
n
A vector giving the sample size per group. If only one number is specified it is assumed that the sample sizes are balanced.
alpha
Level of significance (defaults to 0.025)
alternative
Character determining the alternative for the multiple contrast trend test.
control
A list of options for the pmvt and qmvt functions as produced by mvtnorm.control
corMat
Optional: correlation matrix of contrasts can be specified
nDF
Degrees of freedom of the underlying t-statistics, if NULL the degrees of freedom are calculated from n under the assumption of a parallel group design.

Value

  • Critical value

References

Bretz, F., Pinheiro, J. and Branson, M. (2005), Combining Multiple Comparisons and Modeling Techniques in Dose-Response Studies, Biometrics, 61, 738--748 Hothorn, T., Bretz, F., and Genz, A. (2001), On multivariate t and Gauss probabilities in R, R News, 1, 27--29

See Also

planMM, mvtnorm.control, MCPtest

Examples

Run this code
## Calculation of critical value for Dunnett test
## Set up contrast matrix (3 active doses)
CM <- rbind(-1,diag(3))
## 30 patients per group, one-sided alpha 0.05
critVal(CM, n=30, alpha = 0.05)
## Example from R News 1(2) p. 28, 29
CM <- c(1, 1, 1, 0, 0, -1, 0, 0, 1, 0, 0, -1, 0, 0,
       1, 0, 0, 0, -1, -1, 0, 0, -1, 0, 0)
CM <- t(matrix(CM, ncol = 5))
critVal(CM, n=c(26, 24, 20, 33, 32), alpha = 0.05, 
    alternative = "two.sided")

Run the code above in your browser using DataLab