Description Usage Arguments Value Examples
Cb calculations for a logistic regression model.
1 | Cb.logistic(reg_object, tx_var, semi_parametric = FALSE)
|
reg_object |
An object of class 'glm' that contains the resuls of the logit model. |
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. |
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")
#Creating a binary variable indicating whether an exacerbation happened during the first 6 months.
#Because everyone is followed for at least 6 months, there is no censoring.
rct_data[,'b_exac']<-rct_data[,'tte']<0.5
rct_data[which(is.na(rct_data[,'b_exac'])),'b_exac']<-FALSE
reg.logostic<-glm(formula = b_exac ~ tx + sgrq + prev_hosp + prev_ster + fev1, data = rct_data, family = binomial(link="logit"))
res.logistic<-Cb.logistic(reg.logostic,tx_var = "tx", semi_parametric = T)
print(res.logistic)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.