View source: R/model_averaging_fits.R
ma_continuous_fit | R Documentation |
Fit a model averaged continuous BMD model.
ma_continuous_fit( D, Y, model_list = NA, fit_type = "laplace", BMD_TYPE = "sd", BMR = 0.1, point_p = 0.01, alpha = 0.05, samples = 21000, burnin = 1000 )
D |
doses matrix |
Y |
response matrix |
model_list |
a list of configurations for the single models (priors, model type). To create a model list, one creates a list of
continuous model priors using |
fit_type |
the method used to fit ("laplace", "mle", or "mcmc") |
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. |
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α)\% . By default, it is set to 0.05. |
samples |
the number of samples to take (MCMC only) |
burnin |
the number of burnin samples to take (MCMC only) |
This function model object containing a list of individual fits and model averaging fits
Individual_Model_X
: Here X
is a number 1≤q X ≤q n, where n
is the number of models in the model average. For each X
, this is an individual model
fit identical to what is returned in 'single_continuous_fit
.'
ma_bmd
: The CDF of the model averaged BMD distribution.
posterior_probs
: The posterior model probabilities used in the MA.
bmd
: The BMD and the 100\times(1-2α)\% confidence intervals.
hill_m <- function(doses){ returnV <- 481 -250.3*doses^1.3/(40^1.3 + doses^1.3) return(returnV) } doses <- rep(c(0,6.25,12.5,25,50,100),each=10) mean <- hill_m(doses) y <- rnorm(length(mean),mean,20.14) model <- ma_continuous_fit(doses, y, fit_type = "laplace", BMD_TYPE = 'sd', BMR = 1) summary(model)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.