Description Usage Arguments Value References See Also Examples
Fit a semiparametric proportional means regression model for the weighted composite endpoint of recurrent event and death (Mao and Lin, 2016). (Jared D. Huling (ORCID: 0000-0003-0670-4845) contributed to the optimization of this code.)
1 |
id |
A vector of unique patient identifiers. |
time |
A vector of event times. |
status |
A vector of event type labels. 0: censoring; 1: death; 2, 3,..., K: different types of (possibly recurrent) nonfatal event. |
Z |
Covariate matrix (must be time-constant). |
w |
A K-vector of weights assigned to event types 1 (death), 2, ..., K
(nonfatal events); If |
ep |
Convergence threshold for the Newton-Raphson algorithm. |
An object of class CompoML
with the following components.
beta
: a vector of estimated regression coefficients (log-mean ratios);
var
: estimated covariance matrix for beta
;
t
: unique event times;
y
: estimated baseline mean function (of t
).
Mao, L. and Lin, D. Y. (2016). Semiparametric regression for the weighted composite endpoint of recurrent and terminal events. Biostatistics, 17, 390-403.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ## load package and data
library(Wcompo)
head(hfmock)
## fit a weighted PM (w_D=2, w_1=1)
obj <- CompoML(hfmock$id,hfmock$time,hfmock$status,hfmock[,c("Training","HF.etiology")],
w=c(2,1))
## print out the result
obj
oldpar <- par(mfrow = par("mfrow"))
par(mfrow=c(1,2))
## plot the estimated mean function for
## non-ischemic patients by treatment
plot(obj,c(1,0),ylim=c(0,1.5),xlim=c(0,50),
main="Non-ischemic",
xlab="Time (months)",cex.main=1.2,lwd=2)
plot(obj,c(0,0),add=TRUE,cex.main=1.2,lwd=2,lty=2)
legend("topleft",lty=1:2,lwd=2,c("Exercise training","Usual care"))
## plot the estimated mean function for
## ischemic patients by treatment
plot(obj,c(1,1),ylim=c(0,1.5),xlim=c(0,50),
main="Ischemic",
xlab="Time (months)",cex.main=1.2,lwd=2)
plot(obj,c(0,1),add=TRUE,cex.main=1.2,lwd=2,lty=2)
legend("topleft",lty=1:2,lwd=2,c("Exercise training","Usual care"))
par(oldpar)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.