View source: R/mixed-methods.R
| get_demand_param_trends | R Documentation |
Computes the trend (slope) of Q0 and/or alpha with respect to one or more
continuous covariates using emmeans::emtrends() on a fitted beezdemand_nlme
model. Trends are computed on the parameter estimation scale (log10), consistent
with how parameters are modeled.
get_demand_param_trends(
fit_obj,
params = c("Q0", "alpha"),
covariates,
specs = ~1,
at = NULL,
ci_level = 0.95,
...
)
fit_obj |
A |
params |
Character vector of parameters to analyze: any of "Q0", "alpha".
Default |
covariates |
Character vector of continuous covariate names for which to compute trends. |
specs |
A formula specifying the factors over which to produce trends
(e.g., |
at |
Optional named list to condition variables (factors or continuous)
when computing trends (passed through to |
ci_level |
Confidence level for intervals. Default 0.95. |
... |
Additional args passed to |
A tibble combining trends for each requested parameter and covariate,
including columns for grouping factors (from specs), parameter,
covariate, trend (slope on log10 scale), and its CI (lower.CL, upper.CL).
data(ko)
ko$dose_num <- as.numeric(as.character(ko$dose))
fit <- fit_demand_mixed(ko, y_var = "y_ll4", x_var = "x",
id_var = "monkey", factors = "drug",
equation_form = "zben")
trends <- get_demand_param_trends(fit, covariates = "dose_num",
specs = ~ drug)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.