# Understanding average treatment effect estimator notation

I want to check that I understand the notation for the average treatment effect (ATE) estimator correctly, and hopefully some of you can double check this. I often try to understand formulas through specific examples. Consider a randomized controlled trial with $$n=10$$, where 6 have been given treatment, so that $$n_1=6$$, and 4 have not so $$n_0=4$$.

Filling in the ATE-estimator:

$$\hat\tau= \frac{1}{n_1} \sum_{n=1}^{n_1} y_i(1) - \frac{1}{n_0} \sum_{n=1}^{n_0} y_i(0)$$

We get,

$$\hat\tau= \frac{1}{6} \sum_{n=1}^{6} y_i(1) - \frac{1}{4} \sum_{n=1}^{4} y_i(0)$$

Which for the following toy data set

i  t  y
1  0  1
2  0  2
3  0  2
4  0  1
5  1  3
6  1  4
7  1  5
8  1  5
9  1  6
10 1  3


corresponds to: $$\hat\tau= 0.33 \frac{3+4+5+5+6+3}{6} - 0.25 \frac{1+2+2+1}{4}=1.43-0.38=1.05$$

Which says that the treatment had a positive effect of, on average, 1.05 for the population who received the treatment.

There are a few problems with what you've written, some of which are minor. First, the true ATE is $$E[y(1)] - E[y(0)]$$where $$y_i(a)$$ is the potential outcome under treatment level $$a$$. Without assumptions, this quantity cannot be estimated because $$y_i(1)$$ and $$y_i(0)$$ are not observed for any units.
Randomization gives us the assumption of exchangeability, meaning that $$y(a) \perp A \ \forall a$$, which implies that $$E[y(a)|A=a]=E[y(a)]$$. Assuming consistency (i.e., that there are no unmeasured versions of treatment), we also have $$y_i = \sum_a{I(A=a)y_i(a)}$$, which implies that we can replace $$y_i(a)$$ with $$y_i$$ when we condition on $$A=a$$.
Under these assumptions, the difference in sample means is unbiased for the ATE. $$\frac{1}{n_1}\sum_{i\in A=1}{y_i}$$ is an unbiased estimator of $$E[y|A=1]$$, which under consistency is equal to $$E[y(1)|A=1]$$, which under exchangeability is equal to $$E[y(1)]$$. The same argument can be made for $$A=0$$, so we have that $$\frac{1}{n_1}\sum_{i\in A=1}{y_i} - \frac{1}{n_0}\sum_{i\in A=0}{y_i}$$ is unbiased for $$E[y(1)] - E[y(0)]$$, the ATE.
I don't know where you got the $$.33$$ and $$.25$$ in your formula. The correct math is $$\frac{3+4+5+5+6+3}{6}-\frac{1+2+2+1}{4}=\frac{26}{6}-\frac{6}{4}=2.833$$