How do I deal with a violation of sample independence in a Pearson's correlation? There was a concern raised by reviewers of a manuscript of mine over the proper execution of a Pearson's correlation. In brief, this was undertaken in order to determine the relationship between the extent of wheel running (y axis) and ethanol intake (x axis) across three, separate 10 day periods in 7 animals. 
In the paper, the correlational plots for each 10 day-period had 70 data points: One point for each day and each animal across 10 days of experimentation. The reviewers, however, appropriately pointed out that this is a violation of the assumption of sample independence for Pearson's test, and I should have had only 7 points, which would reflect the means of my two variables for each individual animal across 10 days. Is this appropriate or is there a means of accounting for repeated sampling with a correlation test?
 A: I think this situation calls for either a mixed model (aka multilevel model, hierarchical linear model etc) or a generalized estimating equations approach.
Re the multilevel models: The lm() approach doesn't allow for different slopes in different rats (do rats get better at wheel running? I don't know). This would be PROC MIXED in SAS or lme4() or something similar in R. Both of these also allow you to play with the covariance structure, which the lm() approach does not.
In addition, if you happen to have missing data, multilevel models deal with it better. 
A: I suggest a linear model that predicts wheel running from ethanol intake and rat/mouse id.
In R your data (called data) would look something like this
Wheel   Eth  RatID
30.2   12.1      1
25.2   10.5      1
...

where RatID is a factor. You then do
anova(lm(data))

which gives you a couple of numbers, including a test for the slope, which is the relationship between wheel turning and ethanol uptake.
A: I think that going from $70$ points to $7$ just to force independence is wasteful of the information in the data.  It is not the calculated value of the correlation that is the problem, it is its distribution under the null hypothesis.  Because of repeated testing on the animals the $x$ coordinate for a given animal on one day is correlated with the $x$ coordinate on another day and similarly for the y coordinate so intuitively the variance of the estimate is really higher than what it would be for independent samples of size $n$ ($70$).  But the correlation is not $1$ so the equivalent sample size should be more than $7$.  To give you an idea of what I mean take a look at another problem Suppose I have observations $X_1, X_2, X_3, ..., X_n$ and I want to estimate the sample mean.  However the sequence is dependent and follows an AR(1) model $X_i = \rho X_{i-1} + \varepsilon_i$, $0<\rho<1$ and the $\varepsilon_i$ are iid. and independent of previous $X_i$s.  Then the sequence is stationary. Let $\sigma^2$ be the variance of the $\varepsilon_i$s and the mean be $0$. Then using stationarity it can be shown that the variance of $X_i$ is  $\sigma^2/(1-\rho^2)$.  Say the  $ε_i$ are Gaussian.  Then $\rho = 0$ is the independent case.  Now in the indpendent case $Var(X_i)=Var(\varepsilon_i)$ = $\sigma^2$ and Var(the sample mean)$=\sigma^2$. Now in principle we can find a larger $n$ so that the variance of the sample mean for the autoregressive sequence is the same as for the independence case.  That defines an equivalent sample size.  Of course this depends on the unknown $\rho$.  But a sample size of 7 in the independent case should not equate to $70$ in the dependent case.  Your problem is complicated.  So I suggest bootstrapping the pairs preserving the order and from that get a bootstrap distribution for your Pearson correlation estimate and base your inference on the bootstrap distribution under the null hypothesis.  Preserving the time dependence is important.  I haven't worked through the details but I think the bootstrap will be consistent or easily modified to be consistent.
