How to calculate expected Average Treatment Effect on the Treated (ATT) from a data generating process? I'm running comparisons of different counterfactual modeling methodologies (exact matching, propensity score matching, regression, etc.) on simulated data in order to see which methods produce the most precise estimates of the "true" population treatment effects.
This works great for the Average Treatment Effect (ATE) - you can directly compute the expected ATE from the data generating process in the following R code:
### Simulation data from "Targeted Maximum Likelihood Estimation for Causal Inference in  ###
### Observational Studies", Schuler & Rose, 2016                                          ###
x1 <- rbinom(n=10000, size=1, prob=0.55)
x2 <- rbinom(n=10000, size=1, prob=0.3)
# x3 <- rbinom(n=10000, size=1, prob=0.1)

# Binary treatment variable
A <- rbinom(n=10000, size=1, prob=exp(-.5 + .75*x1 + x2)/(1 + exp(-.5 + .75*x1 + x2)))

# Continuous confounder variable
Z <- rnorm(n=10000, mean=100, sd=10)

# Outcome variable
Y <- rnorm(n=10000, mean=24 - 3*A + 3*x1 - 4*x2 + 7*x1*x2 + 5*A*x1 - 10*A*x2 + 15*A*x1*x2, sd=4.5)
# Expected ATE for Y = E(Y|A=1) - E(Y|A=0)
#                    = .45*.70*(-3) + .55*.70*(-3 + 5) + .45*.30*(-3 - 10) + .55*.30*(-3 + 5 - 10 + 15)
#                    = -0.775

However, many techniques find the Average Treatment Effect on the Treated (ATT), not the ATE. How would you find the expected ATT using the same data generating process formulas in the above example?
 A: Sadly, there is no closed-form solution for the ATT except in certain cases. The formula for the ATE is the combined coefficient on the A when evaluating the predictors at their means, i.e.,
-3 + 5*.55 - 10*.3 + 15*(.55*.3) 

which does equal -.775 as you have figured out. (Note that the final term should include the mean of x1*x2, which in this case happens to be the product of the means of x1 and x2, but won't always). To find the ATT, you would need to evaluate the combined coefficient on A at the predictor means in the treated group. The unfortunate part is that there is in general no clear way to find the predictor means in the treated group analytically.
You can use simulations to estimate the ATT given that you know the parameters of the outcome-genertaing process: in a large dataset, compute the predictor means at A==1 (i.e., mean(x1[A==1]), mean(x2[A==1]), and mean((x1*x2)[A==1])), and then plug those into the formula, i.e.,
-3 + 5*mean(x1[A==1]) - 10*mean(x2[A==1]) + 15*mean((x1*x2)[A==1]) 

That should produce an estimate close to the true ATT. You can do this many times and average them to get even closer to the true ATT. When I did this, I got approximately -.21 for the ATT.
