Learn R Programming

DoseFinding (version 0.9-9)

optContr: 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: $$\frac{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^{opt} \propto S^{-1}\left(\mu - \frac{\mu^{\prime}S^{-1} 1}{1^\prime S^{-1} 1}\right),$$ see Pinheiro et al. (2013).

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 iterative algorithm for calculating the constrained contrasts was derived by E. Glimm).

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

    Value

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

    item

    • placAdj
    • type
    • x, superpose, xlab, ylab, plotType
    • ...

    samp

    type = "constrained"

    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. (2013) Model-based dose finding under model uncertainty using general parametric models, Technical report, preprint available under http://arxiv.org/abs/1305.0889

    See Also

    MCTtest

    Examples

    Run this code
    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")

    Run the code above in your browser using DataLab