Generic internal function for fitting of dose-response models with the output in a tidy format. Results include nested columns of raw data, fitted models, model parameters and curve data for plotting.

bio_dose_resp(
  data,
  .dose,
  .resp,
  .group = NULL,
  .model = drc::LL.4(names = c("slope", "min", "max", "ec50"))
)

Arguments

.dose

Column name for the dose data.

.resp

Column name for the response data.

.group
.model

Model function from {drc} to be fit to the data. Defaults to drc::LL.4() for the bio_dose_resp() function.

Value

A tibble() with list-columns containing the data, the predictions, the residuals and the coefficients of the model.

Examples

DNase %>%
  bio_dose_resp(conc, density, Run)
#> # A tibble: 11 × 4
#>    Run   data              model  coefs           
#>    <ord> <list>            <list> <list>          
#>  1 1     <tibble [16 × 2]> <drc>  <tibble [4 × 5]>
#>  2 2     <tibble [16 × 2]> <drc>  <tibble [4 × 5]>
#>  3 3     <tibble [16 × 2]> <drc>  <tibble [4 × 5]>
#>  4 4     <tibble [16 × 2]> <drc>  <tibble [4 × 5]>
#>  5 5     <tibble [16 × 2]> <drc>  <tibble [4 × 5]>
#>  6 6     <tibble [16 × 2]> <drc>  <tibble [4 × 5]>
#>  7 7     <tibble [16 × 2]> <drc>  <tibble [4 × 5]>
#>  8 8     <tibble [16 × 2]> <drc>  <tibble [4 × 5]>
#>  9 9     <tibble [16 × 2]> <drc>  <tibble [4 × 5]>
#> 10 10    <tibble [16 × 2]> <drc>  <tibble [4 × 5]>
#> 11 11    <tibble [16 × 2]> <drc>  <tibble [4 × 5]>