Skip to content

Commit

Permalink
Ready next CRAN version with cosmetic updates
Browse files Browse the repository at this point in the history
  • Loading branch information
graemeleehickey committed Dec 30, 2024
1 parent ca1d211 commit 9128bd9
Show file tree
Hide file tree
Showing 12 changed files with 185 additions and 150 deletions.
61 changes: 41 additions & 20 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -1,30 +1,51 @@
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches:
- main
- master
branches: [main, master]
pull_request:
branches:
- main
- master

name: R-CMD-check
name: R-CMD-check.yaml

permissions: read-all

jobs:
R-CMD-check:
runs-on: macOS-latest
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@v1
- name: Install dependencies
run: |
install.packages(c("remotes", "rcmdcheck"))
remotes::install_deps(dependencies = TRUE)
shell: Rscript {0}
- name: Check
run: rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "error")
shell: Rscript {0}
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
85 changes: 0 additions & 85 deletions .github/workflows/check-standard.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: joineR
Type: Package
Title: Joint Modelling of Repeated Measurements and Time-to-Event Data
Version: 1.2.8
Version: 1.2.8-9000
Authors@R: c(
person("Pete", "Philipson", email = "[email protected]",
role = "aut",
Expand Down Expand Up @@ -62,4 +62,4 @@ Suggests:
testthat,
covr
VignetteBuilder: knitr
RoxygenNote: 7.1.2
RoxygenNote: 7.3.2
10 changes: 10 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# joineR 1.2.8-9000

## Housekeeping

* Update README: new MRC logo, fixed badges

* Update GitHub actions workflows

* Fixed deprecated documentation for `joineR-package.R`.

# joineR 1.2.8

## Bugs
Expand Down
8 changes: 4 additions & 4 deletions R/joineR-package.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#' joineR
#' @keywords internal
"_PACKAGE"
#' @name joineR
#' @title joineR
#'
#' @description The joineR package implements methods for analyzing data from
#' longitudinal studies in which the response from each subject consists of a
Expand Down Expand Up @@ -58,7 +61,4 @@
#' Williamson PR, Kolamunnage-Dona R, Philipson P, Marson AG. Joint modelling of
#' longitudinal and competing risks data. \emph{Stat Med.} 2008; \strong{27}:
#' 6426-6438.
#'
#' @docType package
#' @name joineR
NULL
105 changes: 78 additions & 27 deletions README.Rmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
output: github_document
editor_options:
markdown:
wrap: 72
---

<!-- README.md is generated from README.Rmd. Please edit that file -->
Expand All @@ -12,26 +15,50 @@ knitr::opts_chunk$set(
)
```

# joineR <img src="man/figures/hex.png" width = "175" height = "200" align="right" />
# joineR <img src="man/figures/hex.png" width="175" height="200" align="right"/>

<!-- badges: start -->
[![R build status](https://github.com/graemeleehickey/joineR/workflows/R-CMD-check/badge.svg)](https://github.com/graemeleehickey/joineR/actions)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/graemeleehickey/joineR?branch=master&svg=true)](https://ci.appveyor.com/project/graemeleehickey/joineR)
[![R-CMD-check](https://github.com/graemeleehickey/joineR/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/graemeleehickey/joineR/actions/workflows/R-CMD-check.yaml)
[![AppVeyor Build
Status](https://ci.appveyor.com/api/projects/status/github/graemeleehickey/joineR?branch=master&svg=true)](https://ci.appveyor.com/project/graemeleehickey/joineR)
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/joineR)](https://CRAN.R-project.org/package=joineR)
[![](https://cranlogs.r-pkg.org/badges/joineR)](https://CRAN.R-project.org/package=joineR)
[![](https://cranlogs.r-pkg.org/badges/grand-total/joineR)](https://CRAN.R-project.org/package=joineR)
[![codecov](https://codecov.io/gh/graemeleehickey/joineR/branch/master/graph/badge.svg)](https://app.codecov.io/gh/graemeleehickey/joineR)
[![Research software impact](http://depsy.org/api/package/cran/joineR/badge.svg)](http://depsy.org/package/r/joineR)
[![Research software
impact](http://depsy.org/api/package/cran/joineR/badge.svg)](http://depsy.org/package/r/joineR)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1167708.svg)](https://doi.org/10.5281/zenodo.1167708)
<!-- badges: end -->

The `joineR` package implements methods for analyzing data from longitudinal studies in which the response from each subject consists of a time-sequence of repeated measurements and a possibly censored time-to-event outcome. The modelling framework for the repeated measurements is the linear model with random effects and/or correlated error structure (Laird and Ware, 1982). The model for the time-to-event outcome is a Cox proportional hazards model with log-Gaussian frailty (Cox, 1972). Stochastic dependence is captured by allowing the Gaussian random effects of the linear model to be correlated with the frailty term of the Cox proportional hazards model. The methodology used to fit the model is described in Henderson et al. (2002) and Wulfsohn and Tsiatis (1997).

The `joineR` package also allows competing risks data to be jointly modelled through a cause-specific hazards model. The importance of accounting for competing risks is detailed in Williamson et al. (2007a,b). The methodology used to fit this model is described in Williamson et al. (2008).
The `joineR` package implements methods for analyzing data from
longitudinal studies in which the response from each subject consists of
a time-sequence of repeated measurements and a possibly censored
time-to-event outcome. The modelling framework for the repeated
measurements is the linear model with random effects and/or correlated
error structure (Laird and Ware, 1982). The model for the time-to-event
outcome is a Cox proportional hazards model with log-Gaussian frailty
(Cox, 1972). Stochastic dependence is captured by allowing the Gaussian
random effects of the linear model to be correlated with the frailty
term of the Cox proportional hazards model. The methodology used to fit
the model is described in Henderson et al. (2002) and Wulfsohn and
Tsiatis (1997).

The `joineR` package also allows competing risks data to be jointly
modelled through a cause-specific hazards model. The importance of
accounting for competing risks is detailed in Williamson et al.
(2007a,b). The methodology used to fit this model is described in
Williamson et al. (2008).

# Example

The `joineR` package comes with several data sets including one the describes the survival of patients who underwent aortic valve replacement surgery. The patients were routinely followed up in clinic, where the left ventricular mass index (LVMI) was calculated. To fit a joint model, we must first create a `jointdata` object, which holds the survival, longitudinal, and baseline covariate data, along with the names of the columns that identify the patient identifiers and repeated time outcomes.
The `joineR` package comes with several data sets including one the
describes the survival of patients who underwent aortic valve
replacement surgery. The patients were routinely followed up in clinic,
where the left ventricular mass index (LVMI) was calculated. To fit a
joint model, we must first create a `jointdata` object, which holds the
survival, longitudinal, and baseline covariate data, along with the
names of the columns that identify the patient identifiers and repeated
time outcomes.

```{r joint_data}
library(joineR)
Expand All @@ -50,12 +77,14 @@ heart.valve.jd <- jointdata(longitudinal = heart.long,
time.col = "time")
```

With the creation of the `heart.valve.jd` object, we can fit a joint model using the `joint` function. For this, we need 4 arguments:
With the creation of the `heart.valve.jd` object, we can fit a joint
model using the `joint` function. For this, we need 4 arguments:

- `jointdata`: the data object we created above
- `long.formula`: the linear mixed effects model formula for the longitudinal sub-model
- `surv.formula`: the survival formula the survival sub-model
- `model`: the latent association structure.
- `jointdata`: the data object we created above
- `long.formula`: the linear mixed effects model formula for the
longitudinal sub-model
- `surv.formula`: the survival formula the survival sub-model
- `model`: the latent association structure.

```{r joint_model}
fit <- joint(data = heart.valve.jd,
Expand All @@ -66,41 +95,63 @@ fit <- joint(data = heart.valve.jd,
summary(fit)
```

Full details on the data and the functions are provided in the help documentation and package vignette. The purpose of this code is to simply illustrate the ease and speed in fitting the models.
Full details on the data and the functions are provided in the help
documentation and package vignette. The purpose of this code is to
simply illustrate the ease and speed in fitting the models.

# Multivariate data

`joineR` only models a single repeated measurement and a single event time. If multiple longitudinal outcomes are available (see Hickey et al., 2016), a separate package is available: [`joineRML`](https://CRAN.R-project.org/package=joineRML).
`joineR` only models a single repeated measurement and a single event
time. If multiple longitudinal outcomes are available (see Hickey et
al., 2016), a separate package is available:
[`joineRML`](https://CRAN.R-project.org/package=joineRML).

# Funding

This project was funded by the [Medical Research Council](http://www.mrc.ac.uk) (Grant numbers G0400615 and MR/M013227/1).
This project was funded by the [Medical Research
Council](http://www.mrc.ac.uk) (Grant numbers G0400615 and
MR/M013227/1).

![](http://www.mrc.ac.uk/mrc/includes/themes/MRC/images/template/desktop/logo.png)
![](https://www.ukri.org/wp-content/themes/ukri/assets/img/ukri-mrc-standard-logo.png)

# Using the latest developmental version

To install the latest **developmental version**, you will need the R package `devtools` and to run the following code
To install the latest **developmental version**, you will need the R
package `devtools` and to run the following code

```r
``` r
library('devtools')
install_github('graemeleehickey/joineR', build_vignettes = FALSE)
```

# References

1. Cox DR. Regression models and life-tables. *J R Stat Soc Ser B Stat Methodol.* 1972; **34(2)**: 187-220.
1. Cox DR. Regression models and life-tables. *J R Stat Soc Ser B Stat
Methodol.* 1972; **34(2)**: 187-220.

2. Henderson R, Diggle PJ, Dobson A. Joint modelling of longitudinal measurements and event time data. *Biostatistics.* 2000; **1(4)**: 465-480.
2. Henderson R, Diggle PJ, Dobson A. Joint modelling of longitudinal
measurements and event time data. *Biostatistics.* 2000; **1(4)**:
465-480.

3. Hickey GL, Philipson P, Jorgensen A, Kolamunnage-Dona R. Joint modelling of time-to-event and multivariate longitudinal outcomes: recent developments and issues. *BMC Med Res Methodol.* 2016; **16(1)**: 117.
3. Hickey GL, Philipson P, Jorgensen A, Kolamunnage-Dona R. Joint
modelling of time-to-event and multivariate longitudinal outcomes:
recent developments and issues. *BMC Med Res Methodol.* 2016;
**16(1)**: 117.

4. Laird NM, Ware JH. Random-effects models for longitudinal data. *Biometrics.* 1982; **38(4)**: 963-974.
4. Laird NM, Ware JH. Random-effects models for longitudinal data.
*Biometrics.* 1982; **38(4)**: 963-974.

5. Williamson PR, Kolamunnage-Dona R, Tudur-Smith C. The influence of competing-risks setting on the choice of hypothesis test for treatment effect. *Biostatistics.* 2007; **8(4)**: 689–694.
5. Williamson PR, Kolamunnage-Dona R, Tudur-Smith C. The influence of
competing-risks setting on the choice of hypothesis test for
treatment effect. *Biostatistics.* 2007; **8(4)**: 689–694.

6. Williamson PR., Tudur-Smith C, Sander JW, Marson AG. Importance of competing risks in the analysis of anti-epileptic drug failure. *Trials.* 2007; **8**: 12.
6. Williamson PR., Tudur-Smith C, Sander JW, Marson AG. Importance of
competing risks in the analysis of anti-epileptic drug failure.
*Trials.* 2007; **8**: 12.

7. Williamson PR, Kolamunnage-Dona R, Philipson P, Marson AG. Joint modelling of longitudinal and competing risks data. *Stat Med.* 2008; **27**: 6426–6438.
7. Williamson PR, Kolamunnage-Dona R, Philipson P, Marson AG. Joint
modelling of longitudinal and competing risks data. *Stat Med.*
2008; **27**: 6426–6438.

8. Wulfsohn MS, Tsiatis AA. A joint model for survival and longitudinal data measured with error. *Biometrics.* 1997; **53(1)**: 330-339.
8. Wulfsohn MS, Tsiatis AA. A joint model for survival and longitudinal
data measured with error. *Biometrics.* 1997; **53(1)**: 330-339.
Loading

0 comments on commit 9128bd9

Please sign in to comment.