LRfit {WA} | R Documentation |
Estimate the while-alive loss (event) rate
Description
Estimate and make inference on the while-alive loss (or event) rate
across J
groups under a user-specified loss function
Usage
LRfit(id, time, status, trt, Dweight = 0, wH = NULL, wD = NULL)
Arguments
id |
A vector of id variable. |
time |
A vector of follow-up times. |
status |
A vector of event type variable; 1 = recurrent event, 2 = death, and 0 = censoring. |
trt |
A vector of categorical (binary or multiclass) variable for treatment group. |
Dweight |
A non-negative weight for death relative to the recurrent event; Default is 0. |
wH |
A function of |
wD |
A function of |
Value
An object of class LRfit
. See LRfit.object
for details.
See Also
LRfit.object
,
summary.LRfit
, plot.LRfit
.
Examples
# load the HF-ACTION trial data
head(hfaction_cpx12)
# fit the data
dat<-hfaction_cpx12
obj<-LRfit(dat$id,dat$time,dat$status,dat$trt)
# print the event numbers by group
obj
# summarize the inference results for tau=3.5 years
# with joint test with RMST
summary(obj,tau=3.5,joint.test=TRUE)
# plot the estimated survival-completed cumulative loss
# by group, with 95% confidence intervals
plot(obj,conf=TRUE,xlab="Time (years)",xlim=c(0, 3.5),ylim=c(0,3),
ylab="Survival-completed cumulative frequency")