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? 
 A: You seem to be slightly misunderstanding the purpose of the weights in IPTW. You are right it would not make sense to have a fractional value for a binary outcome, but the goal of weighting here is not to get a "corrected" outcome value for each individual. 
Instead, you are creating a pseudo-population the composition of which is the individuals in the original population weighted by the inverse of their probability of treatment, given some covariates. In the pseudo-population, there is no longer any association between those covariates and treatment (and therefore no confounding). The goal of weighting, therefore, is to get a contribution to the average outcome value that each individual makes. You can now have fractional values, because these are fractional contributions, not fractional outcome values. 
A: $\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).
A: To expand on what Ellie said, the "inverse" part of the weighting means that if a subject has a low probability of receiving the treatment given the other covariates, they receive more representation in the IPTW "population." If your propensity model is correct (spoiler: it isn't), then the IPTW estimator is the naive treatment effect estimate (just the average difference between the treatment and control group) where the samples have been weighted to be representative of the population.
As a sanity check, if the treatment is truly randomly assigned, then the modeled propensity to be treated will be roughly the proportion of treated units in the sample (regardless of the covariates, which are independent of the treatment by hypothesis). Then the treatment variables and propensities will cancel out, leaving the simple mean difference in the outcome.
