Learn R Programming

MCPMod (version 1.0-10.1)

powCalc: Calculate the power for the multiple contrast test

Description

Given the optimal contrasts, the sample size and a certain `alternative' (i.e. a mean vector and sigma), the function calculates the power to detect this alternative. See Pinheiro et al. (2006) for details. The function is the building block for the functions powerMM, sampSize and LP. Numerical integration routines from the mvtnorm package are used to calculate the underlying multivariate integrals.

Usage

powCalc(cMat, n, alpha = 0.025, delta = NULL, mu = NULL,
        sigma = NULL, cVal = NULL, corMat = NULL,
        twoSide = FALSE, control = mvtnorm.control())

Arguments

cMat

Matrix with the contrasts in the columns

n

Numeric vector of sample sizes per group. In case just one number is specified, it is assumed that all group sample sizes are equal to this number

alpha

Level of significance (defaults to 0.025)

delta

Non-centrality vector of the distribution of the test statistic under the alternative.

mu

Mean vector under the alternative. The function then calculates the non-centrality vector itself. Ignored if delta is specified.

sigma

Expected standard deviation of the response. Only necessary if the non-centrality vector is to be calculated by the function (i.e. if delta is NULL).

cVal

Optional numeric vector giving the critical value, if specified the argument alpha is ignored.

corMat

An optional matrix giving the correlations of the contrasts specified in cMat.

twoSide

Logical indicating whether a two sided or a one sided test should be performed (defaults to one-sided)

control

A list of options for the pmvt and qmvt functions as produced by mvtnorm.control.

Value

The function returns the power value.

References

Pinheiro, J. C., Bornkamp, B. and Bretz, F. (2006). Design and analysis of dose finding studies combining multiple comparisons and modeling procedures, Journal of Biopharmaceutical Statistics, 16, 639--656

See Also

planMM, LP, sampSize, powerMM

Examples

Run this code
# NOT RUN {
doses <- c(0,10,25,50,100,150)
models <- list(linear = NULL, emax = c(25),
               logistic = c(50, 10.88111), exponential=c(85),
               betaMod=matrix(c(0.33,2.31,1.39,1.39), byrow=TRUE, nrow=2))

# calculate optimal contrasts and critical value 
plMM <- planMM(models, doses, 50, scal = 200, alpha = 0.05)

# calculate mean vectors
compMod <- fullMod(models, doses, base = 0, maxEff = 0.4, scal = 200)
muMat <- modelMeans(compMod, doses, FALSE, scal = 200)

# calculate power to detect mean vectors
# Power for linear model 
powCalc(plMM$contMat, 50, mu = muMat[,1], sigma = 1, cVal = plMM$critVal)
# Power for emax model  
powCalc(plMM$contMat, 50, mu = muMat[,2], sigma = 1, cVal = plMM$critVal)
# Power for logistic model
powCalc(plMM$contMat, 50, mu = muMat[,3], sigma = 1, cVal = plMM$critVal)
# compare with JBS 16, p. 650
# }

Run the code above in your browser using DataLab