centile_chart() draws fitted response centile curves against one
covariate, holding every other predictor at a reference value (numeric
predictors at their fitted mean, factors at their first fitted level; see
prediction_grid()). Each curve is predict(object, newdata = grid, type = "quantile", prob = p) for one p in prob.
Arguments
- object
A
drmTMBfit.- covariate
Character scalar naming the predictor to vary.
- prob
Numeric vector of probabilities in (0, 1) giving the centiles to draw.
- ...
Reserved for future options.
- dpar
Distributional parameter identifying the response; see
predict.drmTMB(). IfNULL, the first fitted distributional parameter is used (for bivariatebiv_gaussianfits,dparselects the response – seepredict.drmTMB()'s Details for the marginal-only scope).- n
Number of grid points spanning
covariate's fitted range; passed toprediction_grid().
Details
centile_chart() is a MODEL-CONDITIONAL summary at predict_parameters()'s
fixed-effect, population-level parameter estimates theta_hat – it is
not a WHO-style or other population reference standard. The reference
values every non-focal covariate is held at are reported in the plot
subtitle so a reader is not left guessing what "conditional" means here.
Examples
set.seed(20260712)
n <- 60
x <- stats::rnorm(n)
dat <- data.frame(y = 0.5 + 0.8 * x + stats::rnorm(n), x = x)
fit <- drmTMB(bf(y ~ x, sigma ~ 1), family = gaussian(), data = dat)
if (requireNamespace("ggplot2", quietly = TRUE)) {
centile_chart(fit, covariate = "x")
}