Cb.logistic: Cb calculations for a logistic regression model.

Description Usage Arguments Value Examples

View source: R/Cb.R

Description

Cb calculations for a logistic regression model.

Usage

1
Cb.logistic(reg_object, tx_var, semi_parametric = FALSE)

Arguments

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.

Value

This function returns an object of class Cb_output, which includes Cb as a member.

Examples

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)

msadatsafavi/txBenefit documentation built on Feb. 3, 2020, 10:32 a.m.