Learn R Programming

DoseFinding (version 0.5-5)

gMCPtest: Generalized multiple contrast tests

Description

The function performs a multiple contrast test based on dose-response estimates specified via drEst and vCov. It is assumed that the estimates in drEst approximately follow a multivariate normal distribution for calculation of p-values. The contrasts are chosen corresponding to models specified via the models argument.

Usage

gMCPtest(dose, drEst, vCov, models, alpha = 0.025, contMat = NULL,
         critV = NULL, pVal = TRUE, alternative = c("one.sided","two.sided"),
         direction = c("increasing", "decreasing"),
         mvtcontrol = mvtnorm.control(), std = TRUE, off, scal)

Arguments

dose
Numeric specifying the dose variable.
drEst
Numeric specifying the response estimate corresponding to the doses in dose
vCov
Covariance matrix associated with the dose-response estimate specified via drEst
models
A candidate models list. A list specifying the model shapes to be included in the contrast matrix. The names of the list entries should be equal to the names of the model functions. The list entries should be equal to prior estimates for s
alpha
Significance level for the multiple contrast test
contMat
Optional matrix containing the optimal contrasts in the columns. If specified the code does not calculate the optimal contrasts.
critV
Critical value, if NULL, no critical value will be calculated, and the test decision will be based on the p-values. If critV = TRUE the critical value will be calculated (the test decision will be based on the critical value). If critV is equa
pVal
Optional logical determining whether p-values should be calculated, defaults to TRUE. If the critical value is supplied, p-values will not be calculated.
alternative
Character determining the alternative for the multiple contrast trend test.
direction
Character determining the trend direction of the data, which one wants to investigate (e.g., if one wants to investigate whether the response gets larger with increasing dose direction should be equal to "increasing"). When the contrast matrix
mvtcontrol
A list specifying additional control parameters for the qmvt and pmvt calls in the code, see also mvtnorm.control for details.
std
Optional logical value determining, whether standardized versions should be assumed for calculation of the optimal contrasts. If FALSE all model parameters need to be specified in the models argument (also location and scale parameters).
off
Fixed offset parameter needed when the linear in log model is used. See also documentation of the linear in log model: "linlog". When off = NULL by default (maximum dose)*0.1 is used for off.
scal
Fixed scale parameter needed when the beta model is used. See also documentation of the beta model: "betaMod". When scal = NULL by default (maximum dose)*1.2 is used for scal.

Value

  • An object of class gMCPtest, it is a list containing entries
  • contMatThe used contrast matrix
  • corMatThe used correlation matrix
  • tStatThe calculated test-statistics
  • alphaThe used type one error rate
  • alternativeThe alternative used for the test
  • critValThe used critical value

References

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

See Also

MCPtest

Examples

Run this code
## apply to normal data
data(biom)
## produce first stage ANOVA fit
anMod <- lm(resp~factor(dose)-1, data=biom)
drFit <- coef(anMod)
vCov <- vcov(anMod)
dose <- sort(unique(biom$dose))
## now fit an emax model to these estimates
models <- list(emax = 0.2, linear = NULL)
gtst <- gMCPtest(dose, drFit, vCov, models = models, critV=TRUE)
print(gtst)

## apply to binary migraine data
data(migraine)
PFrate <- migraine$painfree/migraine$ntrt
doseVec <- migraine$dose
doseVecFac <- as.factor(migraine$dose)
## fit logistic regression with dose as factor
logfit <- glm(PFrate~doseVecFac-1, family = binomial, weights = migraine$ntrt)
drEst <- coef(logfit)
vCov <- vcov(logfit)
models <- list(linear = NULL, emax = 20)
gtest2 <- gMCPtest(doseVec, drEst, vCov, models = models)
gtest2

## use user specified contrast matrix
data(biom)
## calculate a contrast matrix
mu1 <- c(1, 2, 2, 2, 2)                      
mu2 <- c(1, 1, 2, 2, 2)                      
mu3 <- c(1, 1, 1, 2, 2)                      
mMat <- cbind(mu1, mu2, mu3)              
dimnames(mMat)[[1]] <- sort(unique(biom$dose))  
contMat <- planMM(muMat = mMat, doses = doses, n = 20, cV = FALSE)$contMat
## fit first stage model
anMod <- lm(resp~factor(dose)-1, data=biom)
drFit <- coef(anMod)
vCov <- vcov(anMod)
## perform MCP analysis
gMCPtest(drEst = drFit, vCov = vCov, contMat = contMat)

Run the code above in your browser using DataLab