View source: R/dichotomous_wrappers.R
single_dichotomous_fit | R Documentation |
Fit a single dichotomous dose-response model to data.
single_dichotomous_fit( D, Y, N, model_type, fit_type = "laplace", prior = NULL, BMR = 0.1, alpha = 0.05, degree = 2, samples = 21000, burnin = 1000 )
D |
A numeric vector or matrix of doses. |
Y |
A numeric vector or matrix of responses. |
N |
A numeric vector or matrix of the number of replicates at a dose. |
model_type |
The mean model for the dichotomous model fit. It can be one of the following: |
fit_type |
the method used to fit (laplace, mle, or mcmc) |
prior |
Used if you want to specify a prior for the data. |
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." |
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-α)\% . For the interval (BMDL,BMDU) this is a 100\times(1-2α)\% confidence interval. By default, it is set to 0.05. |
degree |
the number of degrees of a polynomial model. Only used for polynomial models. |
samples |
the number of samples to take (MCMC only) |
burnin |
the number of burnin samples to take (MCMC only) |
Returns a model object class with the following structure:
full_model
: The model along with the likelihood distribution.
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(σ^2).
covariance
: The variance-covariance matrix for the parameters.
bmd_dist
: Quantiles for the BMD distribution.
bmd
: A vector containing the benchmark dose (BMD) and 100\times(1-2α) confidence intervals.
maximum
: The maximum value of the likelihod/posterior.
gof_p_value
: GOF p-value for the Pearson χ^2 GOF test.
gof_chi_sqr_statistic
: The GOF statistic.
prior
: This value gives the prior for the Bayesian analysis.
model
: Parameter specifies t mean model used.
data
: The data used in the fit.
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.
mData <- matrix(c(0, 2,50, 1, 2,50, 3, 10, 50, 16, 18,50, 32, 18,50, 33, 17,50),nrow=6,ncol=3,byrow=TRUE) D <- mData[,1] Y <- mData[,2] N <- mData[,3] model = single_dichotomous_fit(D, Y, N, model_type = "hill", fit_type = "laplace") summary(model)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.