Learn R Programming

⚠️There's a newer version (0.7.3) of this package.Take me there.

pammtools: Piece-Wise Exponential Additive Mixed Modeling Tools

Installation

Install from CRAN or GitHub using:

# CRAN
install.packages("pammtools")

Overview

pammtools facilitates the estimation of Piece-wise exponential Additive Mixed Models (PAMMs) for time-to-event data. PAMMs can be represented as generalized additive models and can therefore be estimated using GAM software (e.g. mgcv), which, compared to other packages for survival analysis, often offers more flexibility w.r.t. to the specification of covariate effects (e.g. non-linear, time-varying effects, cumulative effects, etc.).

To get started, see the Articles section.

Copy Link

Version

Install

install.packages('pammtools')

Monthly Downloads

5,283

Version

0.5.93

License

MIT + file LICENSE

Maintainer

Andreas Bender

Last Published

February 25th, 2024

Functions in pammtools (0.5.93)

get_cumu_coef

Extract cumulative coefficients (cumulative hazard differences)
fcumu

A formula special used to handle cumulative effect specifications
get_cif

Calculate CIF for one cause
daily

Time-dependent covariates of the patient data set.
make_time_mat

Create matrix components for cumulative effects
get_lhs_vars

Extract variables from the left-hand-side of a formula
compute_cumu_diff

Calculate difference in cumulative hazards and respective standard errors
dplyr_verbs

dplyr Verbs for ped-Objects
geom_stepribbon

Step ribbon plots.
geom_hazard

(Cumulative) (Step-) Hazard Plots.
get_intervals

Information on intervals in which times fall
get_event_types

Exctract event types
get_hazard

Calculate predicted hazard
get_cumulative

Expand time-dependent covariates to functionals
get_cumu_eff

Calculate (or plot) cumulative effect for all time-points of the follow-up
get_cumu_hazard

Calculate cumulative hazard
get_laglead

Construct or extract data that represents a lag-lead window
gg_laglead

Plot Lag-Lead windows
gg_fixed

Forrest plot of fixed coefficients
get_sim_ci

Calculate simulation based confidence intervals
get_surv_prob

Calculate survival probabilities
gg_partial

Visualize effect estimates for specific covariate combinations
gg_slice

Plot 1D (smooth) effects
gg_smooth

Plot smooth 1d terms of gam objects
gg_re

Plot Normal QQ plots for random effects
get_cut

Obtain interval break points
get_terms

Extract the partial effects of non-linear model terms
get_term

Extract partial effects for specified model terms
sim_pexp

Simulate survival times from the piece-wise exponential distribution
int_info

Create start/end times and interval information
modus

Calculate the modus
make_newdata

Construct a data frame suitable for prediction
pammtools

pammtools: Piece-wise exponential Additive Mixed Modeling tools.
get_tdc_vars

Extract variables from the left-hand-side of a formula
get_tdc_form

Extract variables from the left-hand-side of a formula
rpexp

Draw random numbers from piece-wise exponential distribution.
sim_pexp_cr

Simulate data for competing risks scenario
ped_info

Extract interval information and median/modus values for covariates
get_plotinfo

Extract plot information for all special model terms
gg_tensor

Plot tensor product effects
pamm

Fit a piece-wise exponential additive model
sample_info

Extract information of the sample contained in a data set
prep_concurrent

Extract information on concurrent effects
nest_tdc

Create nested data frame from data with time-dependent covariates
tidy_smooth2d

Extract 2d smooth objects in tidy format.
seq_range

Generate a sequence over the range of a vector
has_tdc

Checks if data contains timd-dependent covariates
simdf_elra

Simulated data with cumulative effects
tidy_fixed

Extract fixed coefficient table from model object
get_ped_form

Extract variables from the left-hand-side of a formula
patient

Survival data of critically ill ICU patients
staph

Time until staphylococcus aureaus infection in children, with possible recurrence
warn_about_new_time_points

Warn if new t_j are used
tumor

Stomach area tumor data
tidy_smooth

Extract 1d smooth objects in tidy data format.
tidy_re

Extract random effects in tidy data format.
%>%

Pipe operator
cumulative

Formula specials for defining time-dependent covariates
split_data_multistate

Split data to obtain recurrent event data in PED format
predictSurvProb.pamm

S3 method for pamm objects for compatibility with package pec
split_data

Function to transform data without time-dependent covariates into piece-wise exponential data format
as_ped

Transform data to Piece-wise Exponential Data (PED)
add_cif

Add cumulative incidence function to data
add_term

Embeds the data set with the specified (relative) term contribution
add_surv_prob

Add survival probability estimates
add_tdc

Add time-dependent covariate to a data set
add_hazard

Add predicted (cumulative) hazard to data set
as.data.frame.crps

Transform crps object to data.frame
calc_ci

Calculate confidence intervals
as_ped_cr

Competing risks trafo
combine_df

Create a data frame from all combinations of data frames