clusteredMSM.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.prodint_AJ()).survival (which ships
with R). Removes the dependency on mstate that limited
earlier implementations to progressive models.The package exposes a single user-facing function,
patp(), with a formula-based interface modelled after
survival::Surv():
# 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.
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()).
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.