# Does a data-dependent sampling rule induce correlation?

[This question is cross-posted on math SE here ]

Suppose I have two iid streams of data that are independent of each other: $$X = (X_1, X_2, \ldots)$$ and $$Y = (Y_1, Y_2, \ldots)$$. I want to estimate the difference in means between the two groups. Between the two streams, I want to sample a total of $$n$$ points. For notation's sake, say I'm sampling one point per unit of time for $$T$$ total time units.

Now consider the following sampling scheme which divides up the $$T$$ time period into two halves:

• Up until time $$t = T/2$$, sample from $$X$$ and $$Y$$ with equal probability.
• From $$t = (T/2+1)$$ until $$T$$, sample from $$X$$ with probability $$p$$ and from $$Y$$ with probability $$1-p$$, where $$p$$ is some function of the data I observed in the first half.

Now consider $$\hat{\theta}_1 := \bar{X}_1 - \bar{Y}_1$$, the difference in sample means calculated from only the data collected up until time $$t=T/2$$ and $$\hat{\theta}_2 := \bar{X}_2 - \bar{Y}_2$$ calculated from only the data collected from time $$t=(T/2+1)$$ to $$t=T$$.

Question: Without knowing more about how $$p$$ depends on the data in the first half, can we tell whether $$\hat{\theta}_1$$ and $$\hat{\theta}_2$$ are correlated?

Obviously, $$\hat{\theta}_1$$ and $$\hat{\theta}_2$$ are not independent, but nevertheless I thought they would be uncorrelated. My reasoning was that the dependence of $$p$$ only affects the allocation between $$X$$ and $$Y$$, and doesn't introduce any bias as far as the expected value of $$\bar{X} - \bar{Y}$$. I feel like I oversimplified this, but I'm a bit stuck as to how to work this out rigorously.

• This is not very rigorous, but under the assumptions that $E[Y]$ and $E[X]$ are stationary, and * $E[X] - E[Y] \neq 0$, then it should hold that $\hat{\theta}_1 = c \cdot \hat{\theta}_2$, where $c = p \frac{E[X] + E[Y]}{E[X] - E[Y]} + E[Y]$. Note that $c$ is a linear relationship, hence suggesting that there can be a non-zero correlation. – NofP Oct 21 '18 at 23:36
• Did you prove that "Obviously, $\hat{\theta}_1$ and $\hat{\theta}_2$ are not independent"? – user158565 Oct 22 '18 at 2:25
• @a_statistician I don't know if this is a proof, but the variance of $\hat{\theta}_2$ depends on $p$, so if $p$ depends in turn on $\hat{\theta}_1$ (or the data used to generate it) then that clearly implies that they are dependent, no? – gogurt Oct 22 '18 at 4:09
• How $Var(\hat \theta_2)$ depends on $p$? – user158565 Oct 22 '18 at 14:39