The conventional term for "sinuous" data is that they are circular or angular variables. These are values that exhibit inherent periodicity and can therefore be thought of as if they were angles or, equivalently, "phases" during a repeating set of "seasons."
"Circular statistics" is that branch of data analysis comprising techniques specifically applicable to angular variables. It includes many definitions of coefficients of correlation between angular variables, corresponding roughly to the several well-known kinds of correlation between any two quantitative variables (such as the Pearson and Spearman coefficients). Typically these coefficients are computed in terms of the sines and cosines of the angular variables in a way that is strongly reminiscent of their ordinary counterparts. This makes them relatively easy to calculate and interpret. There are similar analogs of distribution-fitting procedures, linear regression, t-tests, and more.
In the present context, the phase of the moon (to a very good approximation) depends only on the time modulo the moon's period: it is an angular variable. This alone indicates that methods of circular statistics are needed. If the annual "behavioral patterns" can be recorded as times during the year, then their patterns also can be considered to be an angular variable. (If not, there are methods of "circular regression", as described in the references below, that relate conventional quantitative variables to angular variables.)
A circular statistics package
circular exists in
R. It includes natural counterparts to standard correlation tests, such as
cor.circular, an analog of
cor (correlation matrix). The sample code from the manual page generates bivariate circular data using the Von Mises distribution, the circular analog of a Normal distribution, and induces a linear relationship among them:
n <- 50
x <- rvonmises(n, mu=circular(0), kappa=3)
y <- x + rvonmises(n, mu=circular(pi), kappa=10)
Let's visualize these data: first alone, on circular plots in which position along a circle represents phase within a season; next together, as scatterplots.
plot(x, main="x"); plot(y, main="y")
plot(unclass(x) %% (2*pi), unclass(y)%% (2*pi),
xlab="Phase of x", ylab="Phase of y", main="Reduced Scatterplot")
abline(lm(y %% (2*pi) ~ I(x %% (2*pi))), col="Gray", lty=2)
plot(unclass(x), unclass(y), xlab="x", ylab="y", main="Raw Scatterplot")
abline(lm(y ~ x), col="Gray", lty=2)
The $x$ variable tends to be near an angle of zero: that is, it is observed around the beginning and end of each cycle. The $y$ variable tends to be near the midpoint of each cycle (an angle of $\pi$). But from this information alone we cannot tell anything about how $x$ and $y$ might be related. For this purpose one would naturally draw a scatterplot. Since only the phase matters, we typically would record only the phases of the variables, producing the "reduced scatterplot" of the bottom left. The dashed gray line is the ordinary least-squares line (which does not recognize the angular nature of the variables). It is a poor fit. Instead, if we judiciously modify how some of the y-values are recorded by adding one (or more) whole seasons to them (seasons are measured in radians for these data, so a whole season is $2\pi \approx 6.3$ on each scale), we can make the data line up as shown in the "raw scatterplot" at lower right. This time the least-squares line closely fits the data and indicates a strong positive correlation.
That correlation can be measured without having to figure out how many whole seasons to add to the $y$ (and/or) $x$ coordinates:
cor.circular(x, y, test=TRUE)
The output consists of three numbers:
cor, a particular circular correlation coefficient (which can be interpreted in roughly the same way as the familiar Pearson coefficient), a test statistic, and a p-value. In this case the tiny p-value indicates this is a strongly significant correlation (which we already had guessed from the scatterplots) and the coefficient of $0.86$ indicates the association between $x$ and $y$ is strong and positive, with little scatter around the fitted line.
A classic (and highly readable) reference is
- Edward Batschelet, Circular Statistics in Biology. Academic Press, 1981.
An original account of a circular correlation coefficient, an estimator, and tests using it, is available through JSTOR:
- N.I. Fisher and A.J. Lee, A correlation coefficient for circular data. Biometrika 70 no 2, pp 327-32, 1983.
Fisher is the author of a more recent textbook on circular statistics.
- N.I. Fisher, Statistical Analysis of Circular Data. Cambridge University Press, 1995