Intention to Treat Estimation

The first treatment effect is the Intention To Treat (ITT) effect estimate. This quantifies the causal effect of being randomized to the treatment arm vs. the control arm. In trials with perfect adherence, where all patients receive the treatment they are randomized to receive, this corresponds with the causal effect of receiving treatment.

To estimate the ITT effect, we use pooled logistic regression of the form:

\[logit(Y) = \gamma_{0} + \gamma_{Z} Z + \gamma_{t}t.\]

Which is estimated via the following code:

ITTFit <- glm(Y ~ t0 + Z, 
              data = simulated.data, 
              family = binomial(link="logit"))
ITTFit
## 
## Call:  glm(formula = Y ~ t0 + Z, family = binomial(link = "logit"), 
##     data = simulated.data)
## 
## Coefficients:
## (Intercept)           t0            Z  
##    -9.97641      0.09086      0.18270  
## 
## Degrees of Freedom: 117517 Total (i.e. Null);  117515 Residual
## Null Deviance:       3378 
## Residual Deviance: 3034  AIC: 3040

To calculate the appropriate standard error, p-values, and confidence intervals, extra consideration must be used to account for the clustering of observations in the dataset. As we are using pooled logistic regression, each observation corresponds to a single individual at a given follow-up. This means that observations are not all independent, as we’d expect observations from the same individual to be more alike other than observations from different individuals. We calculate the appropriate uncertainty for each estimate using clustered sandwich estimates of the standard error:

cov.m1 <- vcovCL(ITTFit, type = "HC0", cluster= simulated.data$id)
co.test <- coeftest(ITTFit, vcov = cov.m1)
co.CI <- coefci(ITTFit, vcov = cov.m1, level = 0.95)
cat("ITT effect estimate:", "\n",
        "log(OR)", round(coefficients(ITTFit)[["Z"]],3), "\n",
      "95% CI:", round(co.CI["Z","2.5 %"],3), ",", round(co.CI["Z","97.5 %"],3), "\n",
      "p-value", round(co.test["Z","Pr(>|z|)"],2), "\n",
      "robust standard error", round(sqrt(diag(cov.m1))[["Z"]],3))
## ITT effect estimate: 
##  log(OR) 0.183 
##  95% CI: -0.075 , 0.441 
##  p-value 0.17 
##  robust standard error 0.132

Our ITT estimate concludes that treatment does not have a statistically significant effect on the outcome. We have showed the calculation above in details to explain how exactly clustered sandwich estimates of the standard error are calculated to make proper inference.

Alternatively, we can use summ() function from jtools package to perform the above calculations for log(OR) in a straightforward manner by specifying appropriate arguments.

require(jtools)
summ(ITTFit, robust = "HC0", 
     confint = TRUE, digits = 3, cluster="id", 
     model.info = FALSE, model.fit = FALSE)
## Warning in !is.null(rmarkdown::metadata$output) && rmarkdown::metadata$output
## %in% : 'length(x) = 3 > 1' in coercion to 'logical(1)'
Est. 2.5% 97.5% z val. p
(Intercept) -9.976 -10.602 -9.351 -31.251 0.000
t0 0.091 0.079 0.103 14.462 0.000
Z 0.183 -0.075 0.441 1.388 0.165
Standard errors: Cluster-robust, type = HC0

We can also do the same for OR:

summ(ITTFit, robust = "HC0", exp = TRUE,
     confint = TRUE, digits = 3, cluster="id", 
     model.info = FALSE, model.fit = FALSE)
exp(Est.) 2.5% 97.5% z val. p
(Intercept) 0.000 0.000 0.000 -31.251 0.000
t0 1.095 1.082 1.109 14.462 0.000
Z 1.200 0.928 1.554 1.388 0.165
Standard errors: Cluster-robust, type = HC0