| make_4pl_formula | R Documentation |
Constructs the joint 4PL with the disjoint-bounds reparameterisation on the
asymptotes (low, up) and a positivity reparam on k. All four 4PL
sub-parameters (lowraw, upraw, logk, mid) get a temp_c slope — the
model assumes temperature can affect every aspect of the dose-response curve.
Random intercepts (if any) attach to mid.
make_4pl_formula(
random_effects = NULL,
bounds = NULL,
family = brms::beta_binomial(link = "identity"),
response_var = "survival",
temp_effects = c("low", "up", "k", "mid"),
ctmax = NULL,
z = NULL,
up = NULL,
low = NULL,
k = NULL,
mid = NULL,
by = NULL,
threshold = c("relative", "absolute"),
p = 0.5,
log10_tref = 0,
lower = 0,
upper = 1,
censored = FALSE
)
random_effects |
Optional character vector of grouping variables for
random intercepts on |
bounds |
Length-2 numeric |
family |
brms family. Default |
response_var |
Response column name for a |
temp_effects |
Character vector naming which 4PL sub-parameters carry a
|
ctmax, z |
One-sided formulas for the direct parameterisation.
Supplying either switches |
up, low, k |
Optional one-sided formulas for the asymptote and
steepness sub-parameters. In direct mode, when
omitted they inherit the |
mid |
Midpoint mode only. Optional one-sided formula for
the midpoint sub-parameter (whose |
by |
Midpoint mode only. Optional character vector of
moderator column(s). A shortcut that fits |
threshold |
|
p |
Survival fraction defining the absolute threshold.
Default |
log10_tref |
|
lower, upper |
Response-scale bounds for the asymptotes. Default
|
censored |
Logical. |
The response term depends on the family:
Count families (binomial, beta_binomial): the response is
n_surv | trials(n_total) ~ <4PL>.
Beta family (continuous proportion): the response is
<response_var> ~ <4PL> with no trials() term. With link = "identity"
the 4PL value is the mean directly (safe because the reparam keeps it in
(0, 1)); with link = "logit" the 4PL is wrapped in logit() so the mean
is still the 4PL value. With censored = TRUE the response becomes
<response_var> | cens(censored) ~ <4PL>: rows flagged "left" or
"right" in a censored column contribute the probability of lying below
or above their recorded limit instead of a density (see the
detection_limit argument of standardize_data()).
If a parameter has no real temperature effect, its temp_c slope shrinks
toward zero under the prior and the fit reduces cleanly to the simpler case.
A brmsformula object.
make_4pl_formula()
make_4pl_formula(family = binomial(link = "identity"))
make_4pl_formula(temp_effects = "mid") # constant-shape TDT
make_4pl_formula(family = brms::Beta(link = "identity"),
response_var = "survival")
make_4pl_formula(family = brms::Beta(link = "identity"),
censored = TRUE) # censored readings
make_4pl_formula(ctmax = ~ life_stage, z = ~ life_stage) # direct CTmax/z
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.