# Inverse probability of treatment weighted (IPTW) estimator for a binary outcome

Recently, there are several estimators have been proposed to estimate the average treatment effect (ATE) in observation studies, such as IPTW, doubly-robust estimator, etc. It fully makes senses to me for using these estimators to estimate ATE when outcome variable is continuous. However, it does not make any sense to me at all to use these estimators for a binary outcome. There are many researchers have published their papers in statistical journals such as "statistics in medicine" to demonstrate how to use these estimators to estimate ATE (risk difference, OR, RR) when outcome variable is "dichotomous /binary" variable. The IPTW estimator is

$\hat{\Delta} = \frac{1}{N}\{\sum_{i=1}^{N}\frac{Z_iY_i}{\hat{e}_i} - \sum_{i=1}^{N}\frac{(1-Z_i)Y_i}{1-\hat{e}_i}\}$,

where $N$ is sample size, $\hat{e}_i$ is an estimated weight, $Z_i$ is the treatment assignment (control/trt or 0/1) for $i^{th}$ subject and $Y_i$ is the outcome (0/1 or No/Yes) of $i^{th}$ subject.

My question is that $Z_i$ and $Y_i$ are categorical variables and $\hat{e}_i$ is a continuous variable, which is between 0 and 1. How can categorical variables be divided by a continuous variable?

$\hat e_i$ is I believe the propensity score; i.e., the probability of $Z_i = 1 | X_i$, so treatment patients are weighted by the inverse of the propensity score, while control patients are weighted by (1- propensity score).