run_fit.Rd
Confidence intervals of activity metrics can be obtained through bootstrap approach. The bootstrap samples are generated by adding the residuals (the difference between the original responses and the Hill fit) to the fitted response (strictly to Hill equation).
run_fit( d, modls = c("hill", "cnst"), keep_sets = c("fit_set", "resp_set"), n_samples = NULL, ... )
d | Datasets with concentration-response data. An example is zfishbeh. mask column is optional. |
---|---|
modls | The model types for the fitting. Multiple values are allowed. Currently Hill model (hill) and constant model (cnst) are implemented. Default = c("hill", "cnst"). |
keep_sets | Output datasets. Multiple values are allowed. Default values are fit_set and resp_set. fit_set is a must.
|
n_samples | NULL (default) for no bootstrap samples are generated or number of samples to be generated from bootstrapping. When n_samples is not NULL, fit_modls = "hill" will be set automatically. |
... | The named input configurations for replacing the default configurations. The input configuration needs to add model type as the prefix. For example, hill_pdir = -1 will set the Hill fit only to the decreasing direction. |
A list of named components: result and result_nested. The result component is also a list of output sets depending on the parameter, keep_sets. The result_nested component is a tibble with input data nested in a column, input, and output data nested in a column, output.
The prefix of the column names in the fit_set are the used models. The win_modl is the winning model.
fit_modls()
for model fit information and the following analyses using summarize_fit_output()
.
for dichotomous response (see zfishdev), use create_dataset()
first.
# default fitd <- run_fit(zfishbeh) # use only hill model and fit only to the decreasing direction, keep only the fit_set output fitd <- run_fit(zfishbeh, modls = "hill", keep_sets = "fit_set", hill_pdir = -1) # fit to the bootstrap samples fitd <- run_fit(zfishbeh, n_samples = 2)