new_tdt_grid: Build a prediction grid for a fitted TDT workflow

View source: R/predict_survival_curves.R

new_tdt_gridR Documentation

Build a prediction grid for a fitted TDT workflow

Description

Constructs a newdata tibble covering all combinations of temps and durations, adds the derived logd and temp_c columns the model needs, and fills random-effect grouping columns with their first observed level (these are marginalised out at prediction time via re_formula = NA).

Usage

new_tdt_grid(workflow, temps, durations, n_total = NULL, by = NULL)

Arguments

workflow

A bayes_tls object.

temps

Numeric vector of assay temperatures (°C).

durations

Numeric vector of exposure durations (same unit as the training data, typically hours).

n_total

Integer trials count for count families. NULL (default) uses the median of the training data. Ignored for a continuous-proportion (Beta) fit, which has no denominator.

by

Optional moderator column(s) to cross with the temp x duration grid (one block of rows per group, tagged in .grp). NULL (default) builds the ungrouped grid.

Value

A tibble with one row per ⁠(temp, duration)⁠ pair (per group when by is supplied).


bayesTLS documentation built on Nov. 29, 2026, 1:06 a.m.