MCTtest {DoseFinding}R Documentation

Performs multiple contrast test


This function performs a multiple contrast test. The contrasts are either directly specified in contMat or optimal contrasts derived from the models argument. The directionality of the data (i.e. whether an increase or decrease in the response variable is beneficial is inferred from the models object, see Mods).

For type = "normal" an ANCOVA model based on a homoscedastic normality assumption (with additive covariates specified in addCovars) is fitted.

For type = "general" it is assumed multivariate normally distributed estimates are specified in resp with covariance given by S, and the contrast test statistic is calculated based on this assumption. Degrees of freedom specified in df.


MCTtest(dose, resp, data = NULL, models, S = NULL, type = c("normal", "general"),
        addCovars = ~1, placAdj = FALSE, alpha = 0.025, df = NULL,
        critV = NULL, pVal = TRUE,
        alternative = c("one.sided", "two.sided"), na.action =,
        mvtcontrol = mvtnorm.control(), contMat = NULL)


dose, resp

Either vectors of equal length specifying dose and response values, or names of variables in the data frame specified in data.


Data frame containing the variables referenced in dose and resp if data is not specified it is assumed that dose and resp are variables referenced from data (and no vectors)


An object of class Mods, see Mods for details


The covariance matrix of resp when type = "general", see Description.


Determines whether inference is based on an ANCOVA model under a homoscedastic normality assumption (when type = "normal"), or estimates at the doses and their covariance matrix and degrees of freedom are specified directly in resp, S and df. See also fitMod and Pinheiro et al. (2014).


Formula specifying additive linear covariates (for type = "normal")


Logical, if true, it is assumed that placebo-adjusted estimates are specified in resp (only possible for type = "general").


Significance level for the multiple contrast test


Specify the degrees of freedom to use in case type = "general". If this argument is missing df = Inf is used (which corresponds to the multivariate normal distribution). For type = "normal" the degrees of freedom deduced from the AN(C)OVA fit are used and this argument is ignored.


Supply a pre-calculated critical value. If this argument is NULL, no critical value will be calculated and the test decision is based on the p-values. If critV = TRUE the critical value will be calculated.


Logical determining, whether p-values should be calculated.


Character determining the alternative for the multiple contrast trend test.


A function which indicates what should happen when the data contain NAs.


A list specifying additional control parameters for the qmvt and pmvt calls in the code, see also mvtnorm.control for details.


Contrast matrix to apply to the ANCOVA dose-response estimates. The contrasts need to be in the columns of the matrix (i.e. the column sums need to be 0).


Integrals over the multivariate t and multivariate normal distribution are calculated using the mvtnorm package.


An object of class MCTtest, a list containing the output.


Bjoern Bornkamp


Hothorn, T., Bretz, F., and Westfall, P. (2008). Simultaneous Inference in General Parametric Models, Biometrical Journal, 50, 346–363

Pinheiro, J. C., Bornkamp, B., Glimm, E. and Bretz, F. (2014) Model-based dose finding under model uncertainty using general parametric models, Statistics in Medicine, 33, 1646–1661

See Also

powMCT, optContr


## example without covariates
## define shapes for which to calculate optimal contrasts
modlist <- Mods(emax = 0.05, linear = NULL, logistic = c(0.5, 0.1),
                linInt = c(0, 1, 1, 1), doses = c(0, 0.05, 0.2, 0.6, 1))
m1 <- MCTtest(dose, resp, biom, models=modlist)
## now calculate critical value (but not p-values)
m2 <- MCTtest(dose, resp, biom, models=modlist, critV = TRUE, pVal = FALSE)
## now hand over critical value
m3 <- MCTtest(dose, resp, biom, models=modlist, critV = 2.24)

## example with covariates
modlist <- Mods(emax = 0.05, linear = NULL, logistic = c(0.5, 0.1),
                linInt = c(0, 1, 1, 1), doses = c(0, 1, 2, 3, 4))
MCTtest(dose, resp, IBScovars, models = modlist, addCovars = ~gender)

## example using general approach (fitted on placebo-adjusted scale)
ancMod <- lm(resp~factor(dose)+gender, data=IBScovars)
## extract estimates and information to feed into MCTtest
drEst <- coef(ancMod)[2:5]
vc <- vcov(ancMod)[2:5, 2:5]
doses <- 1:4
MCTtest(doses, drEst, S = vc, models = modlist, placAdj = TRUE,
        type = "general", df = Inf)

## example with general alternatives handed over
## calculate contrast matrix for the step-contrasts
## represent them as linInt models
models <- Mods(linInt=rbind(c(1,1,1,1),
## now calculate optimal contrasts for these means
## use weights from actual sample sizes
weights <- as.numeric(table(biom$dose))
contMat <- optContr(models, w = weights)
## plot contrasts
## perform multiple contrast test
MCTtest(dose, resp, data=biom, contMat = contMat)

## example for using the Dunnett contrasts
## Dunnett contrasts
doses <- sort(unique(biom$dose))
contMat <- rbind(-1, diag(4))
rownames(contMat) <- doses
colnames(contMat) <- paste("D", doses[-1], sep="")
MCTtest(dose, resp, data=biom, contMat = contMat)

[Package DoseFinding version 1.0-1 Index]