Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ RoxygenNote: 7.3.2
Encoding: UTF-8
URL: https://github.com/openpharma/DoseFinding, https://openpharma.github.io/DoseFinding/
BugReports: https://github.com/openpharma/DoseFinding/issues
Roxygen: list(markdown = TRUE)
120 changes: 60 additions & 60 deletions R/DoseFinding-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,40 @@
#'
#' @details
#' The main functions are:\cr
#' \bold{MCTtest}: Implements a multiple contrast tests\cr
#' \bold{powMCT}: Power calculations for multiple contrast tests\cr
#' \bold{fitMod}: Fits non-linear dose-response models\cr
#' \bold{optDesign}: Calculates optimal designs for dose-response models\cr
#' \bold{MCPMod}: Performs MCPMod methodology\cr
#' \bold{sampSize}: General function for sample size calculation\cr
#' **MCTtest**: Implements a multiple contrast tests\cr
#' **powMCT**: Power calculations for multiple contrast tests\cr
#' **fitMod**: Fits non-linear dose-response models\cr
#' **optDesign**: Calculates optimal designs for dose-response models\cr
#' **MCPMod**: Performs MCPMod methodology\cr
#' **sampSize**: General function for sample size calculation\cr
#'
#' @references Bornkamp, B., Bretz, F., Dette, H. and Pinheiro, J. C. (2011).
#' Response-Adaptive Dose-Finding under model uncertainty, \emph{Annals of
#' Applied Statistics}, \bold{5}, 1611--1631
#' Response-Adaptive Dose-Finding under model uncertainty, *Annals of
#' Applied Statistics*, **5**, 1611--1631
#'
#' Bornkamp B., Pinheiro J. C., and Bretz, F. (2009). MCPMod: An R Package for
#' the Design and Analysis of Dose-Finding Studies, \emph{Journal of
#' Statistical Software}, \bold{29}(7), 1--23
#' the Design and Analysis of Dose-Finding Studies, *Journal of
#' Statistical Software*, **29**(7), 1--23
#'
#' Bretz, F., Pinheiro, J. C., and Branson, M. (2005), Combining multiple
#' comparisons and modeling techniques in dose-response studies,
#' \emph{Biometrics}, \bold{61}, 738--748
#' *Biometrics*, **61**, 738--748
#'
#' Dette, H., Bretz, F., Pepelyshev, A. and Pinheiro, J. C. (2008). Optimal
#' Designs for Dose Finding Studies, \emph{Journal of the American Statisical
#' Association}, \bold{103}, 1225--1237
#' Designs for Dose Finding Studies, *Journal of the American Statisical
#' Association*, **103**, 1225--1237
#'
#' O'Quigley, J., Iasonos, A. and Bornkamp, B. (2017) Handbook of methods for
#' designing, monitoring, and analyzing dose-finding trials, CRC press, Part 3:
#' Dose-Finding Studies in Phase II
#'
#' Pinheiro, J. C., Bornkamp, B., and Bretz, F. (2006). Design and analysis of
#' dose finding studies combining multiple comparisons and modeling procedures,
#' \emph{Journal of Biopharmaceutical Statistics}, \bold{16}, 639--656
#' *Journal of Biopharmaceutical Statistics*, **16**, 639--656
#'
#' Pinheiro, J. C., Bornkamp, B., Glimm, E. and Bretz, F. (2014) Model-based
#' dose finding under model uncertainty using general parametric models,
#' \emph{Statistics in Medicine}, \bold{33}, 1646--1661
#' *Statistics in Medicine*, **33**, 1646--1661
#'
#' Seber, G.A.F. and Wild, C.J. (2003). Nonlinear Regression, Wiley
#' @keywords internal
Expand Down Expand Up @@ -82,19 +82,19 @@
#'
#' Below are the definitions of the model functions:
#'
#' \bold{Emax model} \deqn{}{f(d,theta)=E0+Emax d/(ED50 + d).}\deqn{
#' **Emax model** \deqn{}{f(d,theta)=E0+Emax d/(ED50 + d).}\deqn{
#' f(d,\theta)=E_0+E_{max}\frac{d}{ED_{50}+d}}{f(d,theta)=E0+Emax d/(ED50 +
#' d).}
#'
#' \bold{Sigmoid Emax Model} \deqn{}{f(d,theta)=E0+Emax d^h/(ED50^h +
#' **Sigmoid Emax Model** \deqn{}{f(d,theta)=E0+Emax d^h/(ED50^h +
#' d^h).}\deqn{
#' f(d,\theta)=E_0+E_{max}\frac{d^h}{ED^h_{50}+d^h}}{f(d,theta)=E0+Emax
#' d^h/(ED50^h + d^h).}
#'
#' \bold{Exponential Model} \deqn{}{f(d,theta)=E0+E1 (exp(d/delta)-1).}\deqn{
#' **Exponential Model** \deqn{}{f(d,theta)=E0+E1 (exp(d/delta)-1).}\deqn{
#' f(d,\theta)=E_0+E_1(\exp(d/\delta)-1)}{f(d,theta)=E0+E1 (exp(d/delta)-1).}
#'
#' \bold{Beta model} \deqn{}{f(d,theta)=E0+Emax
#' **Beta model** \deqn{}{f(d,theta)=E0+Emax
#' B(delta1,delta2)(d/scal)^delta1(1-d/scal)^delta2}\deqn{
#' f(d,\theta)=E_0+E_{max}B(\delta_1,\delta_2)(d/scal)^{\delta_1}(1-d/scal)^{\delta_2}
#' }{f(d,theta)=E0+Emax B(delta1,delta2)(d/scal)^delta1(1-d/scal)^delta2}
Expand All @@ -105,71 +105,71 @@
#' \delta_2^{\delta_2})}{B(delta1,delta2)=(delta1+delta2)^(delta1+delta2)/(delta1^delta1
#' delta2^delta2).} and \eqn{scal}{scal} is a fixed dose scaling parameter.
#'
#' \bold{Linear Model} \deqn{}{f(d,theta)=E0+delta d.}\deqn{
#' **Linear Model** \deqn{}{f(d,theta)=E0+delta d.}\deqn{
#' f(d,\theta)=E_0+\delta d}{f(d,theta)=E0+delta d.}
#'
#' \bold{Linear in log Model} \deqn{}{f(d,theta)=E0+delta log(d + off),}\deqn{
#' **Linear in log Model** \deqn{}{f(d,theta)=E0+delta log(d + off),}\deqn{
#' f(d,\theta)=E_0+\delta \log(d + off)}{f(d,theta)=E0+delta log(d + off),}
#' here \eqn{off}{off} is a fixed offset parameter.
#'
#' \bold{Logistic Model} \deqn{
#' **Logistic Model** \deqn{
#' f(d, \theta) = E_0 + E_{\max}/\left\{1 + \exp\left[ \left(ED_{50} - d
#' \right)/\delta \right] \right\}}{f(d,theta)=E0+Emax/(1 + exp((ED50-d)/delta)).}
#'
#' \bold{Quadratic Model} \deqn{}{f(d,theta)=E0+beta1 d+beta2 d^2.}\deqn{
#' **Quadratic Model** \deqn{}{f(d,theta)=E0+beta1 d+beta2 d^2.}\deqn{
#' f(d,\theta)=E_0+\beta_1d+\beta_2d^2}{f(d,theta)=E0+beta1 d+beta2 d^2.} The
#' standardized model equation for the quadratic model is \eqn{d+\delta
#' d^2}{d+delta d^2}, with \eqn{\delta=\beta_2/\beta_1}{delta=beta2/beta1}.
#'
#' \bold{Linear Interpolation model}\cr The linInt model provides linear
#' **Linear Interpolation model**\cr The linInt model provides linear
#' interpolation at the values defined by the nodes vector. In virtually all
#' situations the nodes vector is equal to the doses used in the analysis. For
#' example the \code{\link{Mods}} and the \code{\link{fitMod}} function
#' example the [Mods()] and the [fitMod()] function
#' automatically use the doses that are used in the context of the function
#' call as nodes. The guesstimates specified in the \code{\link{Mods}} function
#' call as nodes. The guesstimates specified in the [Mods()] function
#' need to be the treatment effects at the active doses standardized to the
#' interval [0,1] (see the examples in the \code{\link{Mods}} function).
#' interval \[0,1\] (see the examples in the [Mods()] function).
#'
#' @details
#' The \bold{Emax model} is used to represent monotone, concave dose-response
#' The **Emax model** is used to represent monotone, concave dose-response
#' shapes. To distinguish it from the more general sigmoid emax model it is
#' sometimes also called hyperbolic emax model.
#'
#' The \bold{sigmoid Emax} model is an extension of the (hyperbolic) Emax model
#' The **sigmoid Emax** model is an extension of the (hyperbolic) Emax model
#' by introducing an additional parameter h, that determines the steepness of
#' the curve at the ed50 value. The sigmoid Emax model describes monotonic,
#' sigmoid dose-response relationships. In the toxicology literature this model
#' is also called four-parameter log-logistic (4pLL) model.
#'
#' The \bold{quadratic} model is intended to capture a possible non-monotonic
#' The **quadratic** model is intended to capture a possible non-monotonic
#' dose-response relationship.
#'
#' The \bold{exponential model} is intended to capture a possible sub-linear or
#' The **exponential model** is intended to capture a possible sub-linear or
#' a convex dose-response relationship.
#'
#' The \bold{beta model} is intended to capture non-monotone dose-response
#' The **beta model** is intended to capture non-monotone dose-response
#' relationships and is more flexible than the quadratic model. The kernel of
#' the beta model function consists of the kernel of the density function of a
#' beta distribution on the interval [0,scal]. The parameter scal is not
#' beta distribution on the interval \[0,scal\]. The parameter scal is not
#' estimated but needs to be set to a value larger than the maximum dose. It
#' can be set in most functions (\samp{fitMod}, \samp{Mods}) via the
#' \samp{addArgs} argument, when omitted a value of \samp{1.2*(maximum dose)}
#' is used as default, where the maximum dose is inferred from other input to
#' the respective function.
#'
#' The \bold{linear in log-dose} model is intended to capture concave shapes.
#' The parameter \code{off} is not estimated in the code but set to a
#' The **linear in log-dose** model is intended to capture concave shapes.
#' The parameter `off` is not estimated in the code but set to a
#' pre-specified value. It can be set in most functions (\samp{fitMod},
#' \samp{Mods}) via the \samp{addArgs} argument, when omitted a value of
#' \samp{0.01*(maximum dose)} is used as default, where the maximum dose is
#' inferred from other input to the respective function.
#'
#' The \bold{logistic model} is intended to capture general monotone, sigmoid
#' The **logistic model** is intended to capture general monotone, sigmoid
#' dose-response relationships. The logistic model and the sigmoid Emax model
#' are closely related: The sigmoid Emax model is a logistic model in
#' log(dose).
#'
#' The \bold{linInt model} provids linear interpolation of the means at the
#' The **linInt model** provids linear interpolation of the means at the
#' doses. This can be used as a "nonparametric" estimate of the dose-response
#' curve, but is probably most interesting for specifying a "nonparametric"
#' truth during planning and assess how well parametric models work under a
Expand Down Expand Up @@ -210,14 +210,14 @@
#' linIntGrad(dose, resp, nodes, ...)
#' @return Response value for model functions or matrix containing the gradient
#' evaluations.
#' @seealso \code{\link{fitMod}}
#' @seealso [fitMod()]
#' @references MacDougall, J. (2006). Analysis of dose-response studies - Emax
#' model,\emph{in} N. Ting (ed.), \emph{Dose Finding in Drug Development},
#' model,*in* N. Ting (ed.), *Dose Finding in Drug Development*,
#' Springer, New York, pp. 127--145
#'
#' Pinheiro, J. C., Bretz, F. and Branson, M. (2006). Analysis of dose-response
#' studies - modeling approaches, \emph{in} N. Ting (ed.). \emph{Dose Finding
#' in Drug Development}, Springer, New York, pp. 146--171
#' studies - modeling approaches, *in* N. Ting (ed.). *Dose Finding
#' in Drug Development*, Springer, New York, pp. 146--171
#' @examples
#'
#' ## some quadratic example shapes
Expand Down Expand Up @@ -275,12 +275,12 @@ NULL
#' @usage data(biom)
#' @format A data frame with 100 observations on the following 2 variables.
#' \describe{
#' \item{\code{resp}}{a numeric vector containing the response values}
#' \item{\code{dose}}{a numeric vector containing the dose values}
#' \item{`resp`}{a numeric vector containing the response values}
#' \item{`dose`}{a numeric vector containing the dose values}
#' }
#' @source Bretz, F., Pinheiro, J. C., and Branson, M. (2005), Combining
#' multiple comparisons and modeling techniques in dose-response studies,
#' \emph{Biometrics}, \bold{61}, 738--748
#' *Biometrics*, **61**, 738--748
#' @keywords datasets
NULL

Expand All @@ -303,12 +303,12 @@ NULL
#' @format A data frame with 5 summary estimates (one per dose). Variables:
#' A data frame with 5 summary estimates (one per dose). Variables:
#' \describe{
#' \item{\code{dose}}{a numeric vector containing the dose values}
#' \item{\code{fev1}}{a numeric vector containing the least square
#' \item{`dose`}{a numeric vector containing the dose values}
#' \item{`fev1`}{a numeric vector containing the least square
#' mean per dose}
#' \item{\code{sdev}}{a numeric vector containing the standard errors
#' \item{`sdev`}{a numeric vector containing the standard errors
#' of the least square means per dose}
#' \item{\code{n}}{Number of participants analyzed per treatment group}
#' \item{`n`}{Number of participants analyzed per treatment group}
#' }
#' @source http://clinicaltrials.gov/ct2/show/results/NCT00501852
#' @keywords datasets
Expand Down Expand Up @@ -356,12 +356,12 @@ NULL
#' @format
#' A data frame with 369 observations on the following 2 variables.
#' \describe{
#' \item{\code{gender}}{a factor specifying the gender}
#' \item{\code{dose}}{a numeric vector}
#' \item{\code{resp}}{a numeric vector}
#' \item{`gender`}{a factor specifying the gender}
#' \item{`dose`}{a numeric vector}
#' \item{`resp`}{a numeric vector}
#' }
#' @source Biesheuvel, E. and Hothorn, L. A. (2002). Many-to-one comparisons in
#' stratified designs, \emph{Biometrical Journal}, \bold{44}, 101--116
#' stratified designs, *Biometrical Journal*, **44**, 101--116
#' @keywords datasets
NULL

Expand All @@ -381,9 +381,9 @@ NULL
#' A data frame with 517 columns corresponding to the patients that
#' completed the trial
#' \describe{
#' \item{\code{dose}}{a numeric vector containing the dose values}
#' \item{\code{painfree}}{number of treatment responders}
#' \item{\code{ntrt}}{number of subject per treatment group}
#' \item{`dose`}{a numeric vector containing the dose values}
#' \item{`painfree`}{number of treatment responders}
#' \item{`ntrt`}{number of subject per treatment group}
#' }
#' @source http://clinicaltrials.gov/ct2/show/results/NCT00712725
#' @keywords datasets
Expand Down Expand Up @@ -421,14 +421,14 @@ NULL
#' @format
#' A data frame with 100 observations on the following 2 variables.
#' \describe{
#' \item{\code{resp}}{a numeric vector containing the response values}
#' \item{\code{dose}}{a numeric vector containing the dose values}
#' \item{\code{id}}{Patient ID}
#' \item{\code{time}}{time of measurement}
#' \item{`resp`}{a numeric vector containing the response values}
#' \item{`dose`}{a numeric vector containing the dose values}
#' \item{`id`}{Patient ID}
#' \item{`time`}{time of measurement}
#' }
#' @source Pinheiro, J. C., Bornkamp, B., Glimm, E. and Bretz, F. (2014)
#' Model-based dose finding under model uncertainty using general parametric
#' models, \emph{Statistics in Medicine}, \bold{33}, 1646--1661
#' models, *Statistics in Medicine*, **33**, 1646--1661
#' @keywords datasets
#' @examples
#'
Expand Down
34 changes: 17 additions & 17 deletions R/MCPMod.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,31 @@

#' MCPMod - Multiple Comparisons and Modeling
#'
#' Tests for a dose-response effect using a model-based multiple contrast test (see \code{\link{MCTtest}}), selects one
#' (or several) model(s) from the significant shapes, fits them using \code{\link{fitMod}}. For details on the method
#' Tests for a dose-response effect using a model-based multiple contrast test (see [MCTtest()]), selects one
#' (or several) model(s) from the significant shapes, fits them using [fitMod()]. For details on the method
#' see Bretz et al. (2005).
#'
#'
#' @aliases MCPMod predict.MCPMod plot.MCPMod
#' @inheritParams MCTtest
#' @param selModel Optional character vector specifying the model selection
#' criterion for dose estimation. Possible values are \itemize{ \item
#' \code{AIC}: Selects model with smallest AIC (this is the default) \item
#' \code{maxT}: Selects the model corresponding to the largest t-statistic.
#' \item \code{aveAIC}: Uses a weighted average of the models corresponding to
#' `AIC`: Selects model with smallest AIC (this is the default) \item
#' `maxT`: Selects the model corresponding to the largest t-statistic.
#' \item `aveAIC`: Uses a weighted average of the models corresponding to
#' the significant contrasts. The model weights are chosen by the formula:
#' \eqn{w_i = \exp(-0.5AIC_i)/\sum_i(\exp(-0.5AIC_i))}{w_i =
#' exp(-0.5AIC_i)/sum(exp(-0.5AIC_i))} See Buckland et al. (1997) for details.
#' } For \samp{type = "general"} the "gAIC" is used.
#' @param df Specify the degrees of freedom to use in case \samp{type = "general"}, for the call to
#' \code{\link{MCTtest}} and \code{\link{fitMod}}. Infinite degrees of (\samp{df=Inf}) correspond to the multivariate
#' [MCTtest()] and [fitMod()]. Infinite degrees of (\samp{df=Inf}) correspond 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.
#' @param doseType,Delta,p \samp{doseType} determines the dose to estimate, ED or TD (see also \code{\link{Mods}}), and
#' @param doseType,Delta,p \samp{doseType} determines the dose to estimate, ED or TD (see also [Mods()]), and
#' \samp{Delta} and \samp{p} need to be specified depending on whether TD or ED is to be estimated. See
#' \code{\link{TD}} and \code{\link{ED}} for details.
#' [TD()] and [ED()] for details.
#' @param bnds Bounds for non-linear parameters. This needs to be a list with list entries corresponding to the selected
#' bounds. The names of the list entries need to correspond to the model names. The \code{\link{defBnds}} function
#' bounds. The names of the list entries need to correspond to the model names. The [defBnds()] function
#' provides the default selection.
#' @param control Control list for the optimization.\cr A list with entries: "nlminbcontrol", "optimizetol" and
#' "gridSize".
Expand All @@ -43,29 +43,29 @@
#' @return An object of class \samp{MCPMod}, which contains the fitted \samp{MCTtest} object as well as the \samp{DRMod}
#' objects and additional information (model selection criteria, dose estimates, selected models).
#' @author Bjoern Bornkamp
#' @seealso \code{\link{MCTtest}}, \code{\link{fitMod}}, \code{\link{drmodels}}
#' @seealso [MCTtest()], [fitMod()], [drmodels()]
#' @references Bretz, F., Pinheiro, J. C., and Branson, M. (2005), Combining multiple comparisons and modeling
#' techniques in dose-response studies, \emph{Biometrics}, \bold{61}, 738--748
#' techniques in dose-response studies, *Biometrics*, **61**, 738--748
#'
#' Pinheiro, J. C., Bornkamp, B., and Bretz, F. (2006). Design and analysis of dose finding studies combining multiple
#' comparisons and modeling procedures, \emph{Journal of Biopharmaceutical Statistics}, \bold{16}, 639--656
#' comparisons and modeling procedures, *Journal of Biopharmaceutical Statistics*, **16**, 639--656
#'
#' Pinheiro, J. C., Bretz, F., and Branson, M. (2006). Analysis of dose-response studies - modeling approaches,
#' \emph{in} N. Ting (ed.). \emph{Dose Finding in Drug Development}, Springer, New York, pp. 146--171
#' *in* N. Ting (ed.). *Dose Finding in Drug Development*, Springer, New York, pp. 146--171
#'
#' Pinheiro, J. C., Bornkamp, B., Glimm, E. and Bretz, F. (2014) Model-based dose finding under model uncertainty
#' using general parametric models, \emph{Statistics in Medicine}, \bold{33}, 1646--1661
#' using general parametric models, *Statistics in Medicine*, **33**, 1646--1661
#'
#' Schorning, K., Bornkamp, B., Bretz, F., & Dette, H. (2016). Model selection
#' versus model averaging in dose finding studies. \emph{Statistics in
#' Medicine}, \bold{35}, 4021--4040
#' versus model averaging in dose finding studies. *Statistics in
#' Medicine*, **35**, 4021--4040
#'
#' Xun, X. and Bretz, F. (2017) The MCP-Mod methodology: Practical Considerations and The DoseFinding R package, in
#' O'Quigley, J., Iasonos, A. and Bornkamp, B. (eds) Handbook of methods for designing, monitoring, and analyzing
#' dose-finding trials, CRC press
#'
#' Buckland, S. T., Burnham, K. P. and Augustin, N. H. (1997). Model selection an integral part of inference,
#' \emph{Biometrics}, \bold{53}, 603--618
#' *Biometrics*, **53**, 603--618
#'
#' Seber, G.A.F. and Wild, C.J. (2003). Nonlinear Regression, Wiley.
#' @examples
Expand Down
Loading