Relationships between the corr(x,y) and corr(x,y) on a subset Suppose two sets of data $\mathbf{X}$ and $\mathbf{Y}$ have a correlation of $\rho_0$. Can anything be said about the correlation between $\mathbf{X}_1$ and $\mathbf{Y}_1$ and $\mathbf{X}_2$ and $\mathbf{Y}_2$ where $\mathbf{X}_1\cup \mathbf{X}_2=\mathbf{X}$ and $\mathbf{Y}_1\cup\mathbf{Y}_2 = \mathbf{Y}$ and $0<|\mathbf{X}_1| = |\mathbf{Y}_1|<|\mathbf{X}|$?
In a practical sense, would there be any relationship (or constraint) between $r$ and $r_1$ and $r_2$ in the below example?
df.0 # some data frame containing x and y
df.1 <- df.0[df.0$x>5, ]
df.2 <- df.0[df.0$x<=5, ]
r <- cor(df.0$x, df.0$y)
r1<- cor(df.1$x, df.1$y)
r2<- cor(df.2$x, df.2$y)

I'm thinking something like $r \leq \max\{|r_1|,|r_2|\}$. Quite happy if there is none!
 A: In general, there is no formula of the type you suggest. For example, take $x_1  = (1.1, 1, 0.9)$, $x_2 = -x_1$, $y_1 = (1.1, 0.8, 1.1)$, and $y_2 = -y_1$. Then $r_1 = r_2 = 0$, but $r$ is almost 1.
A: The following is a rigorous exposition of a simple intuitive idea: you can take any single point out of a point cloud and, by moving it sufficiently far away, make the correlation coefficient equal to any value you please in the interval $(-1, 1)$.  Think about how you would draw the scatterplot: the point cloud would be an unresolved mass of points at one location and the lone point would be at another location.  If it's to the right and up, the correlation will be near $+1$; if at the right and down, the correlation will be near $-1$; and as you move that point between those two locations, the correlation must vary smoothly from $+1$ down to $-1$.
Repeating this process with two points shows how you can first create a scatterplot with any desired correlation and then, by adjoining another point, change it to any other correlation.  This shows there is no general relationship whatsoever between correlations of a subset and the correlation of a set of points.

The (Pearson) correlation coefficient of $\left((0,0), (1,1), (x,1-x)\right)$ equals 
$$-1+\frac{3}{2 (1+(-1+x) x)}.$$
Clearly as $x$ grows large this approaches $-1$ asymptotically.  It also equals $1$ when $x = 1/2$.  Because this function is continuous in the interval $[1/2, \infty)$, it must therefore attain all possible correlations in the interval $(-1, 1]$.
Now let $a \gt 0$ and throw in a fourth point $(a, y)$.  The correlation coefficient becomes
$$\frac{a (x+3 y-2)+x^2-x (y+1)-y+2}{\sqrt{3 a^2-2 a (x+1)+x (3 x-2)+3} \sqrt{3 x^2+2 x (y-2)+y (3 y-4)+4}}.$$
When $a$ is extremely large, this expression grows arbitrarily close to 
$$\frac{x+3 y-2}{\sqrt{3} \sqrt{3 x^2+2 x (y-2)+y (3 y-4)+4}}.$$
For any given $x \ge 1/2$, we can adjust $y$ to make this equal to any desired value in the interval $(-1,1)$.  Rather than do the Calculus, let's just look at a plot of this function of $y$ for $x = 1/2, 1, 2, 4$ (blue, red, gold, green):

