Learn R Programming

⚠️There's a newer version (0.7.4) 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")
# GitHub
devtools::install_github("adibender/pammtools")

Overview

pammtools offers various utilities and convenience functions that facilitate working with Piece-wise exponential Additive Mixed Models (PAMMs).

To get started, see the Articles section.

An overview over the packages functionality is given in

  • Andreas Bender and Fabian Scheipl, 2018: "pammtools: Piece-wise exponential

Additive Mixed Modeling tools", arXiv eprint, 2018, https://arxiv.org/abs/1806.01042

For a tutorial-like introduction to PAMMs see:

A general framework for the representation and estimation of cumulative effects (or exposure-lag-response associations) is described in:

  • Andreas Bender, Fabian Scheipl, Wolfgang Hartl, Andrew G Day, Helmut Küchenhoff; "Penalized estimation of complex, non-linear exposure-lag-response associations", Biostatistics, , kxy003, https://doi.org/10.1093/biostatistics/kxy003

Copy Link

Version

Install

install.packages('pammtools')

Monthly Downloads

5,663

Version

0.1.9

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Andreas Bender

Last Published

March 14th, 2019

Functions in pammtools (0.1.9)

combine_cut

Extract unique cut points when time-dependent covariates present
geom_hazard

(Cumulative) (Step-) Hazard Plots.
get_terms

Extract the partial effects of non-linear model terms
geom_stepribbon

Step ribbon plots.
get_surv_prob

Calculate survival probabilities
get_sim_ci

Calculate simulation based confidence intervals
gg_fixed

Forrest plot of fixed coefficients
modus

Calculate the modus
as_ped

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

Add time-dependent covariate to a data set
nest_tdc

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

Add the contribution of a term to the linear predictor to data set
%>%

Pipe operator
calc_ci

Calculate confidence intervals
daily

fcumu

A formula special used to handle cumulative effect specifications
prep_concurrent

Extract information on concurrent effects
dplyr_verbs

dplyr Verbs for ped-Objects
get_cumu_coef

Extract cumulative coefficients (cumulative hazard differences)
get_cumu_coef_baseline

Extract cumulative coefficients (cumulative hazard differences)
compute_cumu_diff

Calculate difference in cumulative hazards and respective standard errors
get_lhs_vars

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

Calculate cumulative hazard
get_cumu_eff

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

tidyr Verbs for ped-Objects
tumor

Stomach area tumor data
gg_re

Plot Normal QQ plots for random effects
get_cumulative

Expand time-dependent covariates to functionals
get_tdc

Extract time-dependent covariates from data set
get_tdc_form

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

Plot smooth 1d terms of gam objects
gg_slice

Plot 1D (smooth) effects
gg_tensor

Plot tensor product effects
split_data

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

Information on intervals in which times fall
warn_about_new_time_points

Warn if new t_j are used
get_laglead

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

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

Extract time-dependent covariates from data set
get_term

Extract partial effects for specified model terms
int_info

Create start/end times and interval information
riskset_info

Extract risk set information for each interval.
split_tdc

Create piece-wise exponential data in case of time-dependent covariates
sample_info

Extract information of the sample contained in a data set
get_ped_form

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

Extract 1d smooth objects in tidy data format.
get_plotinfo

Extract plot information for all special model terms
gg_laglead

Plot Lag-Lead windows
add_hazard

Add predicted (cumulative) hazard to data set
add_surv_prob

Add survival probability estimates
tidy_fixed

Extract fixed coefficient table from model object
gg_partial

Visualize effect estimates for specific covariate combinations
make_time_mat

Create matrix components for cumulative effects
extub_event

Time until extubation
get_cut

Obtain interval break points
patient

Survival data of critically ill ICU patients
get_hazard

Calculate predicted hazard
ped_info

Extract interval information and median/modus values for covariates
make_newdata

Construct a data frame suitable for prediction
seq_range

Generate a sequence over the range of a vector
sim_pexp

Simulate survival times from the piece-wise exponential distribution
pammtools

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

Simulated data with cumulative effects
cumulative

Formula specials for defining time-dependent covariates
tidy_re

Extract random effects in tidy data format.
tidy_smooth2d

Extract 2d smooth objects in tidy format.
combine_df

Create a data frame from all combinations of data frames