View source: R/continuous_wrappers.R
| single_continuous_fit | R Documentation |
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 )
D |
doses matrix |
Y |
response matrix |
model_type |
Mean model. It should be one of
|
fit_type |
the method used to fit (laplace, mle, or mcmc) |
prior |
Prior / model for the continuous fit. If this is specified, it overrides the parameters 'model_type' and 'distribution.' |
BMD_TYPE |
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. |
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." |
point_p |
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. |
distribution |
The underlying distribution used as the data distribution. |
alpha |
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-α)\% confidence interval. For the interval (BMDL,BMDU) this is a 100\times(1-2α)\% confidence interval. By default, it is set to 0.05. |
samples |
the number of samples to take (MCMC only) |
degree |
the number of degrees of a polynomial model. Only used for polynomial models. |
burnin |
the number of burnin samples to take (MCMC only) |
ewald |
perform Wald CI computation instead of the default profile likelihood computation. This is the the 'FAST BMD' method of Ewald et al (2021) |
transform |
Transforms doses using \log(dose+√{dose^2+1}). Note: this is a log transform that has a derivative defined when dose =0. |
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α) 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+√{x^2+1}) transformed?
When MCMC is specified, an additional variable mcmc_result
has the following two variables:
PARM_samples: matrix of parameter samples.
BMD_samples: vector of BMD sampled values.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.