Skip to content

clusteredMSM

0.1.0Package record

Nonparametric Analysis of Clustered Multistate Processes

0packages depend
1.4Kdownloads / year
87.5%test coverage
13/13flavors OK

Overview

About

Nonparametric estimation of population-averaged transition probabilities, with cluster-bootstrap pointwise confidence intervals, simultaneous confidence bands, and two-sample Kolmogorov-Smirnov-type tests for clustered or independent multistate process data. Estimation follows Bakoyannis (2021) doi:10.1111/biom.13327; two-sample inference for the cluster-randomized and independent-samples designs follows Bakoyannis and Bandyopadhyay (2022) doi:10.1007/s10463-021-00819-x. Both methods use the working-independence Aalen-Johansen estimator. The package supports both progressive (acyclic) and non-monotone (e.g., illness-death with recovery) multistate processes, right censoring, left truncation, and informative cluster size. The user supplies data in interval format (one row per mutually-exclusive time interval per subject) and interacts with the package through a single formula-based function, patp().

Changes in 0.1.0

Initial CRAN release

  • Initial CRAN release of clusteredMSM.

Highlights

  • Nonparametric estimation of population-averaged transition probabilities for clustered or independent multistate process data, with cluster-bootstrap pointwise confidence intervals and simultaneous confidence bands.
  • Two-sample Kolmogorov-Smirnov-type test, dispatched automatically when a grouping variable appears on the formula's right-hand side. Three regimes via a design argument: "shared" (multicenter, every cluster carries both groups), "cluster_random" (cluster-randomized trial, stratified cluster bootstrap), and "indep_random" (independent observational comparison, unstratified cluster bootstrap). "auto" infers the regime from the data.
Show all changes in 0.1.0Hide the rest of the changes in 0.1.0
  • Native support for non-monotone (recovery) multistate processes via a generic product-integral estimator (prodint_AJ()).
  • Self-contained: depends only on survival (which ships with R). Removes the dependency on mstate that limited earlier implementations to progressive models.
  • Estimation methodology from Bakoyannis (2021) <doi:10.1111/biom.13327>; two-sample inference for the cluster-randomized and independent-samples designs follows Bakoyannis and Bandyopadhyay (2022) <doi:10.1007/s10463-021-00819-x>.

Public API

The package exposes a single user-facing function, patp(), with a

formula-based interface modelled after survival::Surv():

``` r

One-sample

patp(msm(Tstart, Tstop, Sstart, Sstop) ~ 1,

data = mydata, tmat = tmat,

id = "subj_id", cluster = "site",

h = 1, j = 2, B = 1000, cband = TRUE)

Two-sample (estimate + test)

patp(msm(Tstart, Tstop, Sstart, Sstop) ~ treatment,

data = mydata, tmat = tmat,

id = "subj_id", cluster = "site",

h = 1, j = 2, B = 1000)

```

patp() returns an S3 object of class patp with print() and

summary() methods.

Input format

Data are supplied in **interval format**: one row per mutually-exclusive

time interval per subject, with columns for interval start time, end

time, starting state, and ending state. Censoring is encoded as

Sstart == Sstop on the final row. Within each subject, intervals must

be temporally and spatially contiguous; this is enforced by strict

validation (validate_intervals()).

Known limitations

  • The two-sample Kolmogorov-Smirnov-type test uses **unit weight** at every time point. Bakoyannis (2021) Section 2.5 recommends the harmonic-mean weight W(t) = prod_p Y_p(t) / sum_p Y_p(t), which downweights regions where one group's at-risk set is small and tames tail instability of the difference estimator. A weighted variant following Bakoyannis (2021) Section 2.5 and Bakoyannis & Bandyopadhyay (2022) is planned for v0.2, alongside the linear and L2 tests.
  • Confidence bands use an equal-precision-type construction on the cloglog scale; the Hall-Wellner-type construction from Bakoyannis (2021) Section 2.3 will be added in v0.2.

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 5.2 min · r-oldrel-windows-x86_64
Status changes
  • OK13 OK2026-08-05
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK7 OK2026-05-28
Advisories

none known

Documentation

In release 0.1.0
READMEYes · 572 wordsVignettesYes · 1 · dynamicNEWSYes · 67% structured · mentions 0.1.0Citation fileYes · cites a publicationWebsitenot declared in DESCRIPTION
Help pages
20 (5 internal)
Examples that run
100%11 run in a plain check
Exported functions with examples
77%
Documented parameters
100%
Return-value docs
100%
Help pages citing references
20%

Downloads

1.4K
CRAN downloads in the past year
Rank #16,642 · ~4/day · ~118/mo
Daily download trend is not available in this view yet.
28930 days
75290 days
1.4K1 year
Compare downloads with other packages →
Also on30 r2u6 autocran

Repository

0Stars
1Forks
0Open issues
0Open PRs
0Releases
31Commits
3Commit identities
biostatisticsmultistate-modelsnonparametric-statisticsrr-packagesurvival-analysisclustered-data
31 commits · Last activity 2026-05-20
Responsiveness
not measured

Forks over time

2026-05-14 · 12026-07-07 · 1
PracticesBeta

3 development-tooling and community-health practices detected across 2 families in the upstream repository

Checks run against github.com/gbakoyannis/clusteredmsm on 2026-10-18.

Reproducibility and dev environment (1)
data-raw/
CRAN release process (2)
cran-comments.mdCRAN-SUBMISSION
How this is detected·Detection ruleset v3 (2026-09-26)
AI coding toolsBeta

This repository shows signs of AI coding tools.

  • Claude Codefirst seen on or before 2026-05-07
    Seen in the repository: CLAUDE.md
    Named in .Rbuildignore: CLAUDE.md
    Commits: at least 29 crediting it in the message
Models named in its commits
  • Claude Opus 4.729 commits · May 2026
Counts are commits, not lines of code. Commits by a tool's accounts count once across all of its accounts. Commits crediting it are the largest count among its credit lines, a minimum.How this is detected·Detection ruleset v4 (updated 2026-09-27)

Dependencies

Declared dependencies
4 external dependencies (excludes base and recommended)

Installing clusteredMSM adds no packages beyond those that come with R.

Depends (1)
R >= 3.5.0
Imports (3)
survivalstatsutils
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

Datasets

People & History

People (1)
Author, Maintainer since 0.1.0 (2026)
Releases (1)
  • 0.1.0Latest
    2026-05-27 · current release
  • R
    R 4.6.0 released · 2026-04-24

Package metadata

First published
2026-05-27
Total releases
1 / 1 yrs
License
GPL-3 OSI
Minimum R
≥ 3.5.0
Bundled data
1.3 KB / 1 file
Download size
66 KB

Cite

Cite this package

Run in R for the authors' entry:

citation("clusteredMSM")

The package provides a citation file, so citation() returns the authors' own entry.

It points to 10.1111/biom.13327, 10.1007/s10463-021-00819-x.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for clusteredMSM version 0.1.0 [Data set]. HJJB, LLC. Data release v2026-10-21. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-21, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy