add_trans_prob() and add_trans_ci() no longer require the input data to
be pre-sorted; the internal arrange call is now handled automatically,
fixing the user-facing sorting dependency reported in #255 and related to
#227.add_trans_prob() / add_trans_ci() / get_trans_prob() now consistently
thread time_var and interval_length, removing hardcoded tend paths and
fixing argument forwarding when add_trans_prob() calls add_cumu_hazard()
with nonstandard column names.add_counterfactual_transitions() now fully honors from_col, to_col,
and transition_col.get_trans_prob() now supports non-integer (categorical) state labels
(e.g. "healthy->ill") in addition to integer-coded transitions.gg_state_occupation() is now exported. Dead parameters group_labels and
nrow have been removed; user-supplied ncol is now respected.make_newdata() output no longer contains internal PED columns (tstart, intlen, interval, offset, ped_status). Output now contains tend + id + user covariates (plus cause/transition for competing risks / multi-state models). ped_info() output is unchanged.intlen is now reconstructed on demand by downstream functions (add_cumu_hazard, add_surv_prob, add_cif, add_trans_prob) via the new internal helper reconstruct_intlen(), and dropped from user-facing output.add_cif() now uses the exact closed-form integral of the cumulative incidence function under piecewise-exponential hazards ((h_j / Σh) · S(t_{i-1}) · (1 - exp(-Σh · Δt))) instead of the previous left-Riemann approximation. CIF estimates from existing user code will change numerically; results are now invariant to the time grid passed to make_newdata().add_cif() now supports arbitrary time points in make_newdata() (parity with add_cumu_hazard()); missing breakpoints are inserted internally so CIF estimates are independent of the chosen prediction grid.expand_df() preserves the cause column when make_newdata() is called with only tend and cause, fixing a competing-risks edge case.predictSurvProb.pamm() now respects non-default id column names and works when trafo_args are not attached to the fitted object.trafo_args argument of pamm() is deprecated; convert data with as_ped() before calling pamm().id to global variables for dplyr compatibility (#260)add_trans_prob: better documentation, proper examples, attribute attachment, and base R speeduppamm() when data does not contain an offset columnbroom to Suggestsadd_trans_prob help page with proper parameter descriptions and working examplegeom_stepribbonmethods from pamm. Can be specified via .... Fixes #200warn_about_new_time_points when original data not stored in model object. Fixes #203split_data function that now accepts Surv(start, stop, event) type inputs, e.g., to construct left-truncated data.as_ped.ped now also works for transformations with time-dependent covariatespamm, which is a thin wrapper
around mgcv::gam with some arguments pre-set.predictSurvProb.pammpecas_ped changed. The vertical bar | is no longer necessary to indicate concurrent or cumulative effectsFunctions get_hazard and add_hazard also gain reference argument.
Allows to calculate (log-)hazard ratios.
Introduces breaking changes to add_term function. Argument relative is replaced by reference, makes calculation of relative (log-)hazards, i.e. hazard ratios, more flexible. Argument se.fit is replaced by ci.
make_newdataconcurrent now has a lag = 0 argument, can be set to positive integer valuesas_ped accepts multiple concurrent specials with different lag specificationsmake-newdata.fpedgg_laglead and gg_partial_ll did not
calculate the lag-lead-window correctly when applied to ped datamake_newdata loses arguments expand and n and
gains ... where arbitrary covariate specifications can be placed, i.e.
e.g. age=seq_range(age, n=20). Multiple such expression can be provided and
a data frame with one row for each combination of the evaluated expressions
will be returned. All variables not specified in \code{...} will be set to
respective mean or modus values. For data of class ped or fped make_newdata will try to specify time-dependent variables intelligently.
te_var argument in concurrent and cumulative was renamed to
tz_var
te arguments have been replaced by tz (time points at which z was observed) in all functions to avoid confusion with mgcv::te
(e.g., gg_laglead)
Overall better support for cumulative effects
Added convenience functions for work with cumulative effects, namely
gg_partial andgg_sliceAdded helper functions to calculate and visualize Lag-lead windows
get_lagleadgg_lagleadAdded convenience geoms for piece-wise constant hazards (see examples in
?geom_hazard, cumulative hazards and survival probabilities (usually
aes(x=time, y = surv_prob), but data set doesn't contain extra row for
time = 0), thus
geom_stephazard adds row (x=0, y = y[1]) to the data before plottinggeom_hazard adds row (x = 0, y = 0) before plotting (can also be used
for cumulative hazard)geom_surv add row (x = 0, y = 1) before plottingAll data transformation is now handled using as_ped (see
data transformation vignette)
Data transformation now handles
Added functionality to flexibly simulate data from PEXP including cumulative effects, see ?sim_pexp
Added functionality to calculate Aalen-model style cumulative coefficients,
see ?cumulative_coefficient
Breaking change in split_data (as_ped now main data trafo function):
max.end argumentmax_time argument to introduce administrative censoring at
max_time when no custom interval split points are providedtidyeval adaptationstidyevalpamm package to pammtools due to naming conflicts with PAMM
package on CRAN