optContr {DoseFinding} R Documentation

## Calculate optimal contrasts

### Description

This function calculates a contrast vectors that are optimal for detecting certain alternatives. The contrast is optimal in the sense of maximizing the non-centrality parameter of the underlying contrast test statistic:

c'mu/sqrt(c'Sc).

Here mu is the mean vector under the alternative and S the covariance matrix associated with the estimate of mu. The optimal contrast is given by

c propto S^(-1) (mu - mu'S^(-1)1)/(1'S^(-1)1),

see Pinheiro et al. (2014).

Note that the directionality (i.e. whether in "increase" in the response variable is beneficial or a "decrease", is inferred from the specified models object, see `Mods` for details).

Constrained contrasts (type = "constrained") add the additional constraint in the optimization that the sign of the contrast coefficient for control and active treatments need to be different. The quadratic programming algorithm from the quadprog package is used to calculate the contrasts.

### Usage

```optContr(models, doses, w, S, placAdj = FALSE,
type = c("unconstrained", "constrained"))

## S3 method for class 'optContr'
plot(x, superpose = TRUE, xlab = "Dose",
ylab = NULL, plotType = c("contrasts", "means"), ...)

```

### Arguments

 `models` An object of class Mods defining the dose-response shapes for which to calculate optimal contrasts. `doses` Optional argument. If this argument is missing the doses attribute in the Mods object specified in models is used. `w, S` Arguments determining the matrix S used in the formula for the optimal contrasts. Exactly one of w and S has to be specified. Note that w and S only have to be specified up to proportionality w Vector specifying weights for the different doses, in the formula for calculation of the optimal contrasts. Specifying a weights vector is equivalent to specifying S=diag(1/w) (e.g. in a homoscedastic case with unequal sample sizes, w should be proportional to the group sample sizes). S Directly specify a matrix proportional to the covariance matrix to use. `placAdj` Logical determining, whether the contrasts should be applied to placebo-adjusted estimates. If yes the returned coefficients are no longer contrasts (i.e. do not sum to 0). However, the result of multiplying of this "contrast" matrix with the placebo adjusted estimates, will give the same results as multiplying the original contrast matrix to the unadjusted estimates. `type` For type = "constrained" the contrast coefficients of the zero dose group are constrained to be different from the coefficients of the active treatment groups. So that a weighted sum of the active treatments is compared against the zero dose group. For an increasing trend the coefficient of the zero dose group is negative and all other coefficients have to be positive (for a decreasing trend the other way round). `x, superpose, xlab, ylab, plotType` Arguments for the plot method for optContr objects. plotType determines, whether the contrasts or the underlying (standardized) mean matrix should be plotted. `...` Additional arguments for plot method

### Value

Object of class optContr. A list containing entries contMat and muMat (i.e. contrast, mean and correlation matrix).

Bjoern Bornkamp

### References

Bretz, F., Pinheiro, J. C., and Branson, M. (2005), Combining multiple comparisons and modeling techniques in dose-response studies, Biometrics, 61, 738–748

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

`MCTtest`

### Examples

```doses <- c(0,10,25,50,100,150)
models <- Mods(linear = NULL, emax = 25,
logistic = c(50, 10.88111), exponential= 85,
betaMod=rbind(c(0.33,2.31), c(1.39,1.39)),
doses = doses, addArgs = list(scal = 200))
contMat <- optContr(models, w = rep(50,6))
plot(contMat)

## now we would like the "contrasts" for placebo adjusted estimates
dosPlac <- doses[-1]
## matrix proportional to cov-matrix of plac. adj. estimates for balanced data
S <- diag(5)+matrix(1, 5,5)
## note that we explicitly hand over the doses here
contMat0 <- optContr(models, doses=dosPlac, S = S, placAdj = TRUE)
## -> contMat0 is no longer a contrast matrix (columns do not sum to 0)
colSums(contMat0\$contMat)
## calculate contrast matrix for unadjusted estimates from this matrix
## (should be same as above)
aux <- rbind(-colSums(contMat0\$contMat), contMat0\$contMat)
t(t(aux)/sqrt(colSums(aux^2))) ## compare to contMat\$contMat

## now calculate constrained contrasts
optContr(models, w = rep(50,6), type = "constrained")
optContr(models, doses=dosPlac, S = S, placAdj = TRUE,
type = "constrained")
```

[Package DoseFinding version 1.0-1 Index]