Description Usage Arguments Value Examples
Cb calculations for a Cox proportional hazard model.
1 |
reg_object |
An object of class 'coxph' that contains the model. IMPORTANT: the coxph function call for fitting the model must have model=TRUE as an input argument such that the underlying data becomes part of the returned object (this is the case by default for glm) |
tx_var |
A string containing the name of the treatment indicator variable. |
semi_parametric |
Optional (default=FALSE). If TRUE, the semi-parametric estimator for Cb will be returned. |
time |
Optional (default=1). The value of time at which Cb is calculated. |
This function returns an object of class Cb_output, which includes Cb as a member.
1 2 3 4 5 6 7 8 9 | data("rct_data")
#Create an event indicator and update the tte (time-to-event) variable to be equal to follpow-up time for censored individuals.
event<-(!is.na(rct_data[,'tte']))*1
ids<-which(event==0)
rct_data[ids,'tte']<-rct_data[ids,'time']
rct_data['event']<-event
reg.coxph<-coxph(Surv(time=tte,event=event) ~ tx + tx:female + tx:age + sgrq + prev_hosp + prev_ster + fev1, data=rct_data, model=TRUE)
res.coxph<-Cb.coxph(reg.coxph,tx_var = "tx",semi_parametric = T)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.