I am evaluating three independent samples (1-3). For each sample I have calculated a correlation of variables A and B.

I am now interested if there is a linear trend in the development of the correlations from sample 1 to sample 3. I have already detected that the correlations for the three samples are significantly different from one another.

For linear trend analyses I have only found ways, in which you can analyze the development of one variable over different samples, but not of the correlation of two variables over different samples.

Is there a way to calculate this?

UPDATE: I think I need to specify a little more: I have the data of 3 classes (3rd, 5th and 7th). The students have all been tested in the same tests. I am interested in the relation of the two variables AxB and therefore I have calculated the correlation for these two variables (for all three class-levels). For the 3rd grade the correlation is close to zero. For the 5th grade the correlation is somewhat higher but still very small and for the 7th grade the correlation is moderate. I have already detected that the correlations are significantly different from one another. I am now interested if the obvious change in the correlation is following a trend and I am trying to find a way to calculate this.

UPDATE 2: Unfortunately I cannot comment because I still need more reputation-points. Based on your question, what I am interested in is a way to find out, if the change of the relation of variable A and Variable B between groups/class levels (shown in significant different correlations from grade 3 to 7) is due to a linear change of variables A and B in between groups/class levels. I don't have any well-grounded theoretical base to assume which of both variables influences the other.

  • $\begingroup$ Could you please explain what you mean by a "linear trend" in the correlations? A casual reader would understand it as a linear relationship between the correlation coefficient (or maybe its square?) and some other variable--but what other variable? Also, any such model (although possibly useful for limited purposes) would be inherently implausible, because projecting such trends would suggest correlations could fall beyond the bounds of $\pm 1$. Could you tell us the ultimate objective of your analysis? $\endgroup$
    – whuber
    Commented Jul 23, 2015 at 18:15
  • $\begingroup$ According to the update, you have nothing left to do: you have found significant differences among the correlations and the correlations increase with grade. Done! The hard part may be to connect this result with any meaningful question about the students (or tests) and to interpret what it means. $\endgroup$
    – whuber
    Commented Jul 23, 2015 at 19:21
  • $\begingroup$ I removed my answer until there is a little more clarity. Is the change in correlation truly what you are interested in? Two variables being more related after length of instruction is impossible to interpret. Do you want to know if the effect of B on A is stronger after instruction? Or do you want to know if length of instruction reduces noise in A and/or B? Or neither and you really only care about the correlation as a whole? $\endgroup$
    – le_andrew
    Commented Jul 23, 2015 at 19:51
  • $\begingroup$ Please register & merge your accounts (you can find out how in the My Account section of our help center), then you will be able to comment on & edit your own question. $\endgroup$ Commented Jul 23, 2015 at 20:37

1 Answer 1


Correlations can change in strength between groups for 2 reasons. 1) The covariance between variables can differ between groups. 2) The variance of the variables can differ between groups. I don't think you are directly interested in either of those (though where I am going is not entirely different, just a different way to frame the problem). You said you are interested in the change in the relationship between 2 variables between 3 groups of students. Let's say you are interested in sleep affecting grades. Let's say within your measurements an extra hour of sleep is associated with an extra 5 points in grades, and that is constant across grade level. Even though the relationship is the same, the correlations could be larger in 7th grade compared to 3rd because of measurement error. Maybe 3rd graders cannot accurately report how much they slept, but the error is random across 3rd graders. Some people who sleep 8 hours reported 6 and some who slept 6 hours reported 8. There will be more noise in the data, weakening the correlation.

On the other hand, maybe sleep doesn't have much of an effect on grades for 3rd grades (1 hour of sleep is associated with 0 points increase in grades), but for 7th graders it has a big effect (1 hour is associated with 10 point increase in grades). Your correlation will also be larger for 7th graders compared to 3rd graders. I am assuming this is the scenario you care about. The regression methods I discuss below test these kind of questions. It does not directly answer the question of whether there is a linear trend in the correlation between two variables (a question that is nearly meaningless as whuber pointed out since correlation coefficients are bounded at -1 and 1). Instead it answers a highly related question -- a question that is likely what you are actually trying to figure out.

These questions are most easily answered using general linear models (GLM, i.e. regression/ANOVA). Before I begin, know that GLMs rely on a set of assumptions that you should be checking before finalizing analysis. Your differences in correlations may be due to less noise in the variables at higher grade levels, not a stronger relationship. That would likely cause heteroskedasticity in your data, which violates one of the assumptions.

If what you are interested in is whether the size of the relationship between A and B differs linearly across grade levels, this is equivalent to asking if there is a group by predictor variable interaction (if this is not what you are interested in, let me know so I can delete this answer permanently). More specifically, a linear-group-contrast by predictor variable interaction component. The GLM would be $$A_{ij}=\beta_0+\beta_1B_i+\beta_2G1_{j}+\beta_3G2_{j}+\beta_4B_iG1_{j}+\beta_5B_iG2_{j}+\epsilon_i$$ B is your predictor variable of interest. A is your criterion variable of interest. G1 and G2 are the linear and quadratic contrasts for your group assignment factor (e.g -1, 0, 1 for 3rd, 5th and 7th grade for a linear trend, and 1, -2, 1 for 3rd, 5th, and 7th grade for a quadratic trend). You are interested in whether $\beta_4$ is significant. If $\beta_4$ is significant, it means that the effect of your predictor variable on your criterion variable changes linearly from grade 3 to 5 to 7. If $\beta_5$ is significant, then your story is little more complex. The trend is not necessarily linear. Instead the trend itself changes as you go from group 1 to 2 to 3.

  • $\begingroup$ I'm having trouble seeing how assessing an interaction addresses the situation in the question. Correlations increase when the dispersion of the bivariate data around a regression line decreases. Doesn't that automatically put the OP in a potentially heteroscedastic situation? How would introducing an interaction deal with that? In fact, this could happen even in the absence of any interaction when the regression lines for all three datasets are nearly the same. $\endgroup$
    – whuber
    Commented Jul 23, 2015 at 18:10
  • $\begingroup$ Yes, I made several assumptions. I incorporated them into the answer. Mainly, though, changes in dispersion is not the only way for correlations to change in strength. $\endgroup$
    – le_andrew
    Commented Jul 23, 2015 at 18:43
  • $\begingroup$ That's right--but because changes in dispersion can cause changes in correlations, it is essential to accommodate that possibility in your model and your fitting procedure. It doesn't even handle the possibility of changing covariances (unless you implicitly assume the $\epsilon_i$ are not identically distributed). $\endgroup$
    – whuber
    Commented Jul 23, 2015 at 19:18
  • $\begingroup$ Thank you for your answer! It does help me to understand my question better and also solves the question I was looking for an answer for. $\endgroup$
    – Wambird
    Commented Jul 24, 2015 at 7:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.