Learn R Programming

MJMbamlss

The goal of MJMbamlss is to provide a working implementation of the proposed approach found in Volkmann, Umlauf, Greven (2023): “Flexible joint models for multivariate longitudinal and time-to-event data using multivariate functional principal components”.

You can find more information on the package in the README.txt file in the inst/ folder. As a general outline for the usage of MJMbamlss refer to the following steps:

  1. Preprocess the data to be of long format with fixed variable name ‘marker’ for the longitudinal outcomes factor variable.

  2. To estimate the MFPC basis, first remove observations with too little information. Then use wrapper function ‘preproc_MFPCA’ to estimate MFPCs. The number of MFPCs can be determined looking at the ratio of explained variance.

  3. Prepare the model formula. The formula is a list specifying each additive predictor separately, except for marker-specific predictors. That is, the baseline hazard can be specified with ‘Surv2(.)’ functions on the left of the ‘~’, baseline covariates are specified by ‘gamma ~’, error measurments with ‘sigma ~’. The alpha and mu predictors need to specify the model formulas with interactions of the variable ‘marker’, so exclude the intercept and specify all model terms as marker-interactions. Use the smooth terms ‘bs = “unc_pcre”’ for the functional principal components based random effects. Each ‘unc_pcre’ term needs to be supplied with an ‘xt’ argument ‘“mfpc”’ that contains a multiFunData object of the corresponding MFPC. Note also that each smooth term should contain the ‘xt’ argument ‘“scale” = FALSE’.

  4. Prepare the data for the model fit. Use the wrapper function ‘attach_wfpc’ to add evaluations of the MFPCs to the data set.

  5. Fit the model using ‘bamlss’ by specifying the family ‘mjm_bamlss’.

Please use the provided files in the folder inst/ as a reference for your analysis.

Installation

You can install the stable release version of MJMbamlss from CRAN with:

install.packages("MJMbamlss")

You can install the development version of MJMbamlss from GitHub with:

# install.packages("devtools")
devtools::install_github("alexvolkmann/MJMbamlss")

Copy Link

Version

Install

install.packages('MJMbamlss')

Monthly Downloads

177

Version

0.1.0

License

GPL-3

Maintainer

Alexander Volkmann

Last Published

November 27th, 2023

Functions in MJMbamlss (0.1.0)

simMultiJM

New Simulation Function For Multivariate JMs Based On FPCs
fpca

Functional principal components analysis by smoothed covariance
pbc_subset

PBC Subset
MFPCA_cov

Function to calculate the multivariate FPCA for a given covariance matrix and univariate basis functions
Predict.matrix.unc_pcre.random.effect

mgcv-style constructor for prediction of PC-basis functional random effects
attach_wfpc

Attach Weighted Functional Principal Components to the Data
survint_C

Survival Integral
mjm_bamlss

Family for Flexible Multivariate Joint Model
sim_jmb_predict

Simulation Helper Function - Predict the Results for JMbayes-Models
sim_jmbamlss_eval

Simulation Helper Function - Evaluate the Simulation for JMbamlss Setting
sim_bamlss_predict

Simulation Helper Function - Predict the Results for bamlss-Models
preproc_MFPCA

Preprocessing step to create MFPCA object
varbinq

Flexible Joint Models for Multivariate Longitudinal and Time-to-Event Data
MJM_predict

Prediction of MJM model
sim_jmbayes_eval

Simulation Helper Function - Evaluate the Simulation for JMbayes Setting
smooth.construct.unc_pcre.smooth.spec

mgcv-style constructor for PC-basis functional random effects (no constraint)