Fit a single continuous BMD model.
single_continuous_fit(
D,
Y,
model_type = "hill",
fit_type = "laplace",
prior = NA,
BMD_TYPE = "sd",
BMR = 0.1,
point_p = 0.01,
distribution = "normal-ncv",
alpha = 0.05,
samples = 25000,
degree = 2,
burnin = 1000,
ewald = FALSE,
transform = FALSE
)Returns a model object class with the following structure:
full_model: The model along with the likelihood distribution.
bmd: A vector containing the benchmark dose (BMD) and \(100\times(1-2\alpha)\) confidence intervals.
parameters: The parameter estimates produced by the procedure, which are relative to the model '
given in full_model. The last parameter is always the estimate for \(\log(sigma^2)\).
covariance: The variance-covariance matrix for the parameters.
bmd_dis: Quantiles for the BMD distribution.
maximum: The maximum value of the likelihod/posterior.
Deviance: An array used to compute the analysis of deviance table.
prior: This value gives the prior for the Bayesian analysis.
model: Parameter specifies t mean model used.
options: Options used in the fitting procedure.
data: The data used in the fit.
transformed: Are the data \(\log(x+\sqrt{x^2+1})\) transformed?
PARM_samples: matrix of parameter samples.
BMD_samples: vector of BMD sampled values.
doses matrix
response matrix
Mean model. It should be one of
"hill","exp-3","exp-5","power","polynomial"
the method used to fit (laplace, mle, or mcmc)
Prior / model for the continuous fit. If this is specified, it overrides the parameters 'model_type' and 'distribution.'
BMD_TYPE specifies the type of benchmark dose analysis to be performed. For continuous models, there are four types of BMD definitions that are commonly used.
- Standard deviation is the default option, but it can be explicitly specified with 'BMR_TYPE = "sd"' This definition defines the BMD as the dose associated with the mean/median changing a specified number of standard deviations from the mean at the control dose., i.e., it is the dose, BMD, that solves \(\mid f(dose)-f(0) \mid = BMR \times \sigma\)
- Relative deviation can be specified with 'BMR_TYPE = "rel"'. This defines the BMD as the dose that changes the control mean/median a certain percentage from the background dose, i.e. it is the dose, BMD that solves \(\mid f(dose) - f(0) \mid = (1 \pm BMR) f(0)\)
- Hybrid deviation can be specified with 'BMR_TYPE = "hybrid"'. This defines the BMD that changes the probability of an adverse event by a stated amount relitive to no exposure (i.e 0). That is, it is the dose, BMD, that solves \(\frac{Pr(X > x| dose) - Pr(X >x|0)}{Pr(X < x|0)} = BMR\). For this definition, \(Pr(X < x|0) = 1 - Pr(X > X|0) = \pi_0\), where \(0 \leq \pi_0 < 1\) is defined by the user as "point_p," and it defaults to 0.01. Note: this discussion assumed increasing data. The fitter determines the direction of the data and inverts the probability statements for decreasing data.
- Absolute deviation can be specified with 'BMR_TYPE="abs"'. This defines the BMD as an absolute change from the control dose of zero by a specified amount. That is the BMD is the dose that solves the equation \(\mid f(dose) - f(0) \mid = BMR\).
This option specifies the benchmark response BMR. The BMR is defined in relation to the BMD calculation requested (see BMD). By default, the "BMR = 0.1."
This option is only used for hybrid BMD calculations. It defines a probability that is the cutpoint for observations. It is the probability that observations have this probability, or less, of being observed at the background dose.
The underlying distribution used as the data distribution.
Alpha is the specified nominal coverage rate for computation of the lower bound on the BMDL and BMDU, i.e., one computes a \(100\times(1-\alpha)\%\) confidence interval. For the interval (BMDL,BMDU) this is a \(100\times(1-2\alpha)\%\) confidence interval. By default, it is set to 0.05.
the number of samples to take (MCMC only)
the number of degrees of a polynomial model. Only used for polynomial models.
the number of burnin samples to take (MCMC only)
perform Wald CI computation instead of the default profile likelihood computation. This is the the 'FAST BMD' method of Ewald et al (2021)
Transforms doses using \(\log(dose+\sqrt{dose^2+1})\). Note: this is a log transform that has a derivative defined when dose =0.
M2 <- matrix(0,nrow=5,ncol=4)
colnames(M2) <- c("Dose","Resp","N","StDev")
M2[,1] <- c(0,25,50,100,200)
M2[,2] <- c(6,5.2,2.4,1.1,0.75)
M2[,3] <- c(20,20,19,20,20)
M2[,4] <- c(1.2,1.1,0.81,0.74,0.66)
model = single_continuous_fit(M2[,1,drop=FALSE], M2[,2:4], BMD_TYPE="sd", BMR=1, ewald = TRUE,
distribution = "normal",fit_type="laplace",model_type = "hill")
summary(model)
Run the code above in your browser using DataLab