Learn R Programming

mets (version 1.3.11)

WA_reg: While-Alive Regression for Recurrent Events

Description

Performs regression analysis for the "While-Alive" mean of events per time unit, defined as \(Z(t) = N(\min(D,t)) / \min(D,t)\). This function models how covariates affect the rate of recurrent events per unit of time alive.

Usage

WA_reg(
  formula,
  data,
  time = NULL,
  cens.code = 0,
  cause = 1,
  death.code = 2,
  marks = NULL,
  ...,
  trans = 1
)

Value

An object of class "binreg" containing coefficient estimates, standard errors, confidence intervals, and influence functions for the regression of the event rate per time alive.

Arguments

formula

Formula with regression design. The first covariate on the RHS must be the treatment factor. Can include other covariates and cluster(id).

data

Data frame.

time

Time point \(t\) for estimation.

cens.code

Censoring code.

cause

Event cause code.

death.code

Death code.

marks

Marks for composite outcomes.

...

Additional arguments passed to binreg.

trans

Power transformation for the outcome (default 1).

Author

Thomas Scheike

Details

The estimation is based on IPCW (Inverse Probability of Censoring Weighting) and calls binreg after constructing the outcome variable. It supports double robust estimation if covariate augmentation is specified.

References

Ragni, A., Martinussen, T., & Scheike, T. H. (2023). Nonparametric estimation of the Patient Weighted While-Alive Estimand. arXiv preprint.

Examples

Run this code
data(hfactioncpx12)
hfactioncpx12$age <- rnorm(741)[hfactioncpx12$id] 
dtable(hfactioncpx12,~status)
## exp-link regression 
dd <- WA_reg(Event(entry,time,status)~treatment+age+cluster(id),data=hfactioncpx12,
                    time=2,death.code=2)
summary(dd)

Run the code above in your browser using DataLab