knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(JMP)

Introduction

As an emerging clinical specialty, palliative care involves multiple sectors such as medicine, nursing, social work, and volunteering. Palliative care emphasizes more on relieving the suffering of patients due to the advanced disease status. The knowledge of terminal trend of quality of life (QOL) becomes an important tool to allow practitioners to provide care in a better and more efficient way. To determine the efficacy of a new palliative care treatment, analyses regarding longitudinal measurements of QOL are at greater interests than survival outcomes. However, statistical challenges are present in analyzing palliative care data as QOL decreases as patients approach the end of life. Such correlation between longitudinal QOL and survival outcomes promotes us to model them jointly in order to offer accurate interpretation and estimations.

In the paper (see reference [1]), we propose a semiparametric terminal trend model with the following two sub-models:

The R package "JMP" was aim to offer a implementation of the analyses for palliative care clinical trials from the perspective of joint modeling.

Input and output

The package "JMP" consists of a main function, JMP, that is calling other sub-functions in order to implement the joint model proposed. Firstly, we can install the package from Github.

require(devtools)
devtools::install_github("https://github.com/gitlzg/JMP", build_vignettes = TRUE)
library(JMP)

The main function JMP is the actual function that will be applied by users. Users need to supply arguments of

The final return elements from the JMP function are the following:

  1. A list of analysis results

  2. monthly QOL results for each treatment group

  3. the overall p value for testing the entire model
  4. knot.combinations: different combinations of knots for longitudinal and survival submodels
  5. maximum likelihood estimates (mle) results

and

  1. Four figures saved in the current working directory

  2. estimated terminal trend in a png file called "Longitudinal_trajectories.png"

  3. the time-varying treatment effect in a png file called "Longitudinal_spline_treatment_effect.png"
  4. estimated survival function and in a png file "Survival_function.png"
  5. estimated cumulative hazard function in a png file "Cumulative_hazard.png"

Examples

An example dataset, "dat_JMP", is included in the package. A total of 118 observations and 36 variables are saved in the "dat_JMP" data frame with the data dictionary:

To access the example dataset, simply type:

data(dat_JMP)

We will demonstrate the JMP function on the example dataset. To adjust for variables "sex" and baseline QOL "qol_0", we fill in the covariates.fields by them. Other arguments are also filled in by the corresponding variable names in the dataset.

results <- JMP(dat=dat_JMP,
covariate.fields = c("sex", "qol_0"),
qol.prefix="qol_", qol.time.prefix="time_",
id.field = "id", survival.time.field = "survival_time",
censoring.status.field = "death", treatment.status.field = "trt")

The first element in the results list is the monthly QOL results:

results$monthlyResults

Secondly, the overall p value for testing the entire model is shown.

results$overallPvalueModel

The third element is the knots combination (range specified by a input argument) with their corresponding AIC and BIC values.

results$knot.combinations

The last element "mle" is a list with all results from maximum likelihood estimations and confidence intervals.

results$mle

Additionally, to provide visualizations on the longitudinal and survival trend, four plots are generated and saved in the user's current R working directory.

References

[1] Li Z, Frost HR, Tosteson TD, et al. A Semiparametric Joint Model for Terminal Trend of Quality of Life and Survival in Palliative Care Research. Statistics in Medicine. 2017;36:4692–4704. https://doi.org/10.1002/sim.7445



gitlzg/JMP documentation built on March 7, 2020, 6:35 a.m.