









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










The Pearson product-moment correlation coefficient is probably the single most widely used statistic for summarizing the relationship between two variables. Statistical significance and caveats of interpretation of the correlation coefficient as applied to time series are topics of this lesson. Under certain assumptions, the statistical significance of a correlation coefficient depends on just the sample size, defined as the number of independent observations. If time series are autocorrelated, an “effective” sample size, lower than the actual sample size, should be used when evaluating significance. Transient or spurious relationships can yield significant correlation for some periods and not for others. The time variation of strength of linear correlation can be examined with plots of correlation computed for a sliding window. But if many correlation coefficients are evaluated simultaneously, confidence intervals should be adjusted (“Bonferroni adjustment”) to compensate for the increased likelihood of observing some high correlations where no relationship exists. Interpretation of sliding correlations can be also be complicated by time variations of mean and variance of the series, as the sliding correlation reflects covariation in terms of standardized departures from means in the time window of interest, which may differ from the long-term means. Finally, it should be emphasized that the Pearson correlation coefficient measures strength of linear relationship. Scattersplots are useful for checking whether the relationship is linear.
The Pearson correlation coefficient goes by various names: “product-moment” correlation coefficient, “simple” correlation coefficient, and “ordinary” correlation coefficient. Often it is just called the “correlation coefficient.” The correlation coefficient is the average product of departures of two variable from their respective means divided by the producte of the standard deviations of those variables. The equation for the correlation coefficient is
1 1/ 2 1/ 2 2 2 1/ 2 2 2 1 1
, , 1
cov , (^1) 1
N i i (^) t t i N N i i t^ t i i
N i x i y x y i
N x x y y (^) x x y y r N x x N y y x^ x^ y^ y
x y z z s s N
=
= =
=
where xi , i = 1,..., N and yi , i = 1,..., N are time series of length N with sample means x and
y , and standard deviations s (^) x and s (^) y ; “E” denotes expected value; “cov” denotes covariance;
and zi x (^) ,, zi y (^) , are standardized anomalies (Wilks 1995). Standardized anomalies are variables
scaled to zero mean and unit standard deviation by subtracting the sample mean and dividing by the sample standard deviation. Standardized anomalies are also called “Z-scores.” Equation (1) indicates that the correlation coefficient is approximately equal to the average product of standardized departures of the two variables from their respective means. The correlation coefficient is therefore unaffected by linear scaling of the variables. For example, adding a
Significance of an individual sample r The significance of a sample correlation, r, depends on the sample size and also on the size of r. Significance can be tested with a t-test (Snedecor and Cochran 1989; Haan 2002). The assumptions are:
If these assumptions are satisfied, the statistic
2
follows a t-distribution with N -2 degrees of freedom, where N is the sample size. The null and alternative hypotheses for a test (two-sided) are:
To apply the test, the steps are:
distribution^1
Example. The correlation between a tree-ring index and annual precipitation is r =0.48. The sample size is N =18. The computed test statistic is T =2.1886. Reference to a table of the cdf of the t-distribution shows that the probability of exceeding this value of T by chance is 0.0219.
less than 0.01/2, or less than 0.005.
Background. The test statistic T comes from an analysis of variance for a bivariate regression of y on x. Details can be found in Panofsky (1958) and Snedecor and Cochrane (1989), but a short summary is presented here. In the regression, the total sum-of-squares (SS) of y can be split into two parts: SS for the regression estimates and SS for the residuals from the regression line. The regression model is
partitioning of SS is described by
(^1) In MATLAB the probability point can be found alternatively by calling function tcdf or by using
disttool. One can also refer to tables of Student’s t-distribution, which are available in many statistics texts.
( )
( )
( )
( )
2 2 2 2 2 2
x y
Comparing (8) with (2), we see that
From statistical theory, if F follows an F-distribution with 1 and (N-2) degrees of freedom,
follows a t-distribution with N -2 degrees of freedom. A test for the significance of the correlation between x and y is therefore equivalent to a test for the significance of the slope in a linear regression of y on x. :
Approximation with large sample size
If the sample size is large (say N >25), an approximate confidence interval can be derived to assess whether a sample r is significantly different from zero. The sample correlation coefficient for N observations on two variables x and y is normally distributed with mean
If these assumptions are satisfied, a confidence band for r can be computed from the probability points of the standard normal distribution (Panofsky and Brier 1958; Chatfield 2004). Approximately 95% of a normally distributed variable should fall within ±1.96 standard deviations of the population mean. With a population mean of zero and standard deviation
to N 2 N-
For example, if the sample size is N = 200 , the 95% confidence interval is
to 0.1393 to 0. 200 2 200-
The confidence interval (11) applies to a two-tailed test with null and alternative hypotheses
H0: correlation coefficient is zero H1: correlation coefficient is “different than” zero
A computed correlation coefficient greater in absolute magnitude than 0.1393 is judged “significantly different than zero” at the 0.05 α-level, which corresponds to the 95% significance
Because the normal distribution is symmetrical, the α-threshold a two-tailed test is equivalent to
correlations of main interest, are
H0: correlation coefficient is zero H1: correlation coefficient is “greater than” zero
In the example above, a computed correlation of r = 0.15would indicate rejection of the null hypothesis at the 0.05 level for the two-tailed test and rejection of the null hypothesis at the 0. level for the one-tailed test. Whether to use a one-tailed or two-tailed test depends on the context of the problem. If only positive correlations (or only negative) seem plausible from the physical relationship in question, the one-tailed test is appropriate. Otherwise the two-tailed test should be used.
Example. As a second example, consider a computed correlation of r =0.48 between a tree-ring index and a precipitation series, based on N =102 years of data. From (11), we compute that r must be larger than r =1.96/sqrt(100), or r =>0.196 is required for significance at 95% in a two- tailed test. The computed r greatly exceeds this threshold. The conclusion is therefore to reject
If the sample size were only N =18 years, the normal approximation would yield a required threshold of r =1.96/4=0.49 for significance at 95%. Because our sample r =0.48 is smaller than the threshold, the conclusion using the large-sample approximation would therefore be “do not
samples. We should not have used the large-sample approximation with such a small sample size, but the comparison illustrates that inappropriately using the large-sample approximation is conservative in the sense that we are not increasing the chance of a Type-I error (rejecting H when H0 is false). On the other hand, inappropriate use of the large-sample approximation increases the likelihood of a type-II error – failing to reject the null hypothesis when the null hypothesis is false.
Signifance testing when population correlation is nonzero
Sometimes the question is not whether a sample correlation coefficient is significantly different from zero, but whether one sample non-zero correlation coefficient is significantly different than another non-zero correlation coefficient. Or the question might be whether the sample indicates a population correlation different than some specified non-zero correlation (e.g.,
as a sample from a theoretical normal distribution with mean zero and standard deviation given by (15). Moreover, if the population correlation is nonzero, the distribution of the sample correlations about the population correlation is asymmetrical. A solution is provided by the so-called Fisher transformation, which converts the sample correlation r into another quantity z that is distributed almost normally (Snedecor and Cochran 1989, p. 188). The transformation is:
[ ]
ln(1 ) ln(1 ) 2
z = + r − − r (13)
where r is the sample correlation coefficient and z the transformed coefficient. The standard error of z is given by 1 z N 3 σ = −
Effective sample size
It is assumed that each observation for the correlation analysis represents an independent piece of information, such that a sample size of N represents N distinct pieces of information. In other words, the observations are assumed to be independent of one another. But observations in a time series are seldom independent, especially for time series derived from physical systems characterized by storage – for example, the annual flow of a river. Autocorrelation in physical systems is often reflected by a nonzero first-order autocorrelation coefficient. For a time series of length (^) N , autocorrelation essentially reduces the number of independent observations below N. Recall that the standard deviation of the correlation coefficient depends on N through
For autocorrelated time series, equation (15)should be altered to use an adjusted, or “effective” sample size. Decreasing the number of independent observations has the effect of
otherwise be significantly different than zero might not be so if the series are autocorrelated. Many other statistical tests also assume independence of observations. Below are equations for computing the effective sample size. More information on these adjustments can be found elsewhere (WMO 1966; Dawdy and Matalas 1964). The equations were derived based on the assumption that the autocorrelation in the series is first-order autocorrelation (dependence on lag-1 only). In other words, the governing process is first-order autoregressive , or Markov. Computation of the effective sample size requires only the sample size and first-order sample autocorrelation coefficient. Equations are given below for the effective sample size of a time series, and the effective sample size for computation of a correlation coefficient between two autocorrelated time series.
Effective sample size – univariate adjustment (Mitchell et al. 1966)
1 1
r N N r
where N is the sample size, N’ is the effective samples size, and r 1 is the first-order
autocorrelation coefficient. For example, a series with a sample size of 100 years and a first- order autocorrelation of 0.50 has an adjusted sample size of
' 100 100 33 years 1 0.5 1.
Effective sample size for correlation coefficient (Dawdy and Matalas 1964)
( ) ( )
1, 1, 1, 1,
x y x y
r r N N r r
where r 1, (^) x and r 1, (^) y are the first-order autocorrelation coefficients of time series x and y , and the
other variables are defined as in (18). The adjustment depends on the product of the first-order autocorrelation coefficients in such a way that if either series has zero first-order autocorrelation, the effective sample size equals the original sample size (no reduction in effective samples size).
As an example of the adjustment and the effect on assessment of significance of r , consider two time series of length 200 years with first-order autocorrelations of 0.50 and 0.40:
[ ] [ ]
[ ] [ ]
The 95% confidence interval without the adjustment of sample size is approximately 0 ± (^) ( 1.96 / N − (^2) ) = 0 ± (^) ( 1.96 / (^198) )= ±0.139 , while the 95% interval with adjustment is
0 ± (^) ( 1.96 / (^131) )= ±0.171. Note from equation (18) that if the lag-1 autocorrelation of either
series is zero, the factors in parentheses reduce to 1.0, and the effective sample size equals the original sample size. Because the time series we are working with are typically stochastic, it is possible to get spuriously high autocorrelation coefficients, especially for short series. It is a good idea therefore to first test the first-order autocorrelation coefficient(s) for statistical significance before using these “effective” sample sizes in hypothesis testing.
Bonferonni adjustment To a waiter at The Olive Garden, the word “Bonferrroni” brings to mind just another bland pasta smothered with tomato sauce. To the dendrochronologist, “Bonferroni” brings to mind the famous Italian mathematician Carlo Emilio Bonferroni (1892-1960), after whom a well- known adjustment of confidence intervals for multiple significance testing is named. The “Bonferroni adjustment” is an adjustment made to confidence levels when multiple statistical tests are evaluated simultaneously. If a test is repeated several times and each time a
getting at least one “significant” correlation is actually greater than 0.05. The confidence should be widened to account for the increased probability (Snedecor and Cochran 1989, p. 116, 167). The algorithm for the Bonferroni adjustment can be derived from the binomial distribution, which gives the probability of a least one success in k trials given the probability of
the probability that none of the test results is significant is
k
For any given number of tests and desired probability that no tests results are significant,
k
Substituting (21) into (20) gives
Now the probability of one or more tests being significant is simple 1 minus the probability that none of the tests are significant, so that
Equation (23) can be written
probability that or more of the tests is significant. We can regard any specific desired probability that none of the tests is significant as an alpha-level for a simultaneous confidence interval,
negative correlation. Accordingly, points in quadrants I and III of Figure 9.1 (upper left) contribute to positive correlation, and points in quadrants II and IV to negative correlation. The orientation of the cloud of points is from lower left to upper right, meaning that points are predominantly in quadrants I and III, as reflected by the positive correlation coefficient. The remaining three plots in Figure 9.1 are scatterplots and straight line fits to subsets of observations determined by the x-values (Boles Creek). For example, at lower left are shown points for observations with the lowest third (lowest tercile) of Boles Creek indices. Similarly, the observations for the middle tercile are at upper right, and for the highest tercile at lower right. A significant positive relationship between the indices at the two sites is indicated when Boles Creek index is low and when Boles Creek index is high. No relationship is evident for intermediate values of the Boles Creek index (upper right). The scatterplot for the entire data (upper left) shows a significant correlation even after adjustment of the sample size for persistence. The original sample size is 199 years (1800-1998), while the effective sample size is 123 years. The difference in sample sizes comes from both x and y having significant lag-1 autocorrelation. The lag-1 autocorrelation coefficients are r 1, (^) x = 0.38and r 1, (^) y = 0.62. Substitution of these values into equation (18) yields the effective
sample size of 123 Note that no adjustment of sample size has been made for the tercile subset analyses in Figure 9.1. Each subset has approximately 1/3 of the 199 observations, and the sample size used for the significance testing has not been adjusted downward. No adjustment is made because the data for the subsets are not successive observations arranged in time. Depending on the spacing of the subsets observations, the observations may be more or less random, or independent of one another, even though the original series is autocorrelated. What can be done if the scatterplot of y vs x is nonlinear? If the plan is to apply the data
in methods assuming linear relationships (e.g., multiple linear regression), one option is to transform either or both variables to straighten the scatterplot. Methods of transformation are described by Hoaglin et al. (1983). Two simple transformations that sometimes work are the log transform and power transform. If the original variable is x and the transformed variable y, these transformations are:
o p is usually restricted to positive values o if p is negative, transformation v = − yp preferred
Note that the “z-score” transformation, or transformation to standardized anomalies from the mean, will have no effect of correlation, as the correlation coefficient itself can be written in terms of standardized anomalies ( see equation (1)). The z-score transformation is useful, however, to remove differences of level and scale in time series before plotting.
Causality A significant correlation coefficient between x and y does not necessarily imply that
variations in x ”cause” variations in y , or vice versa. Sometimes the correlation results simply
from both x and y being associated with a third variable that might have some causative
influence on both x^ and y^. For example, a positive correlation between tree-growth variations in
Arizona and Colorado in no way implies that tree-growth in one region affects tree-growth in the other, but merely that trees in both regions are influenced by a third variable – precipitation – which is spatially coherent across the Southwest.
Lagged relationships If two correlated time series, x and y , are shifted so that they are offset in time, the
correlation may decrease or disappear. Likewise, the physical system may build in a natural lag such that simply aligning the time series does not capture the strength of relationship. Or the influence of one variable may be spread over several observations of the other variable. In such cases, simple correlation analysis can be misleading, and methods using the cross-correlation function are more appropriate (Box and Jenkins 1976).
the statistical significance. The practical significance, however, remains the same. For example, consider two time series of length 10,000 years correlated at r = 0.03. The correlation is “significant” at the 0.05 alpha level, but less than 1/10 of a percent of the variance of one variable can be explained by a linear regression on the other.
Changes of strength of correlation with time can be shown graphically by a plot of correlation coefficients computed in a sliding window. For example, for a 3000-year-long series, correlations can be computed and plotted for the 30 distinct 100-year periods. Such a plot can be useful for qualitatively evaluating the time pattern of change in strength of relationsship. Two basic statistical questions that can be addressed with such a plot are:
These questions can be answered by comparing the computed correlations with the threshold
statistical significance can be computed using the probability points of the normal distribution, as described above. Two considerations in computing the threshold level are (1) reduction of effective sample size due to autocorrelation in the two series, and (2) Bonferroni adjustment of the confidence interval to account for multiple, or simultaneous, evaluation of statistics. Methods for the effective sample size and Bonferroni adjustment have already been covered. For the question of whether the relationship is statistically significant for any of the periods, the appropriate null hypothesis is the “universal” null hypothesis: the population correlation coefficient is zero for all sub-periods. Rejection indicates that the population correlation is nonzero for at least one period. The Bonferroni adjustment is essential in this application. For
significance is approximately 0.05/30=0.0017. For the question of which periods the relationship is significant for, the Bonferroni-adjusted confidence interval can also be used, but with the drawback that the risk of a type-II error (failing to reject a false null hypothesis) is increased. An alternative is to specify a sub-period of interest a-prior and compute and test the correlation for just that period. Then no Bonferroni adjustment is necessary, the confidence interval is narrower, and a smaller (in absolute magnitude) correlation is required for significance. An example of sliding, or windowed, correlation plots for the Boles Creek and Antelope Lake tree-ring series is shown in Figure 9.2. The series and period of analysis are the same as for the example discussed previously (Figure 9.1). The selected window has a width of 50 years and is offset by 50 years (no overlap). The plotted correlations indicate that the universal null
significant for at least one of the sub-periods. In fact, the correlation for the middle period ( r = 0.75)greatly exceeds the threshold. When evaluating sliding correlations, it is important to also consider variations in the sub- sample means and standard deviations of the individual series. (The sub-sample means for the example above are plotted in Figure 9, middle.). Because the correlation coefficients are computed from scaled departures from the sub-sample means (recall equation (1)), the correlation might be low for a period in which the sub-period means of both variables are anomalously high or low and the variation around those means anomalously small. A conclusion of “no relationship” could be misleading in this case. For example if two tree-ring series plunged to
extremely low levels over an entire 50-year period and the variability within that period was small, the correlation for the sub-period might be close to zero, but the “relationship” between the series still be strong -- at least in the context of the longer record.
The separate question whether the correlation in some period is significantly different than the correlation in another period cannot be addressed with the confidence intervals as computed in this lesson. For this question, the section “Significance testing when population correlation is nonzero” (see above) applies, and it is necessary to transform the sample correlations before significance testing. Fluctuations in sliding correlations between two correlated time series are sometimes over-interpreted. If two time series are strongly correlated, windowed correlations are expected to wander to some extent purely as a result of stochastic behavior. Gershunov et al. (2001) emphasize this point, and suggest that bootstrap methods be applied to evaluate significance of fluctuations in windowed correlation.
0
2
(^4) Z-S cores of Original S eries (^) B OLE S A NTE L
0
2
(^4) S liding 50-yr M eans of Z-S cores (delta t = 50 Y ears) (^) B OLE S A NTE L
1800 -1 1820 1840 1860 1880 1900 1920 1940 1960 1980 2000
-0.
0
1
E NDING Y E A R OF W INDOW
S liding Correlation 95% CI
Figure 9.2. Sliding correlations for Boles Creek and Antelope Lake tree-ring indices for analysis period 1800-1998. Correlations for 50-year window plotted at the end of each windowed period. Confidence interval adjusted for autocorrelation and multiple testing (Bonferroni adjustment). Top: time series plots of series transformed to “z-scores”, or standardized anomalies. Middle: sample means of the annual z-scores for 50-year sub-periods. Bottom: sample correlations, with 95% confidence interval.