Suppose I have three variables, $X, Y, Z$. And I am interested in knowing how $X, Z$ are correlated to $Y$. Suppose that $$ corr(Y, X) = a=0.6; \quad \text{and} \quad corr(Y, Z) = b=0.4; $$ My question is, is there a way to test the whether the two correlation coefficients are significantly different? Or am I going to the wrong direction when doing this?
120509
I have a group of correlation coefficients (more than two). They are all dependent on one variable A in the form of r_A1, r_A2, r_A3....r_Ak, where 1, 2 ...k denote other variables; they all have the same sample size.   My question is: what statistics should I use when I want to know whether any one of the correlation coefficients is any different to any of the others? I know if there are only two dependent correlation coefficients, this can be easily compared using most statistical tools, but this is a multiple correlations test. I know that a Chi-square test can be used to compare equality of several correlation coefficients (see  for an example), but to my knowledge this approach is for testing the difference between INDEPENDENT correlation coefficients. So I am wondering whether there is any approach that is equivalent to Fisher's least significant difference that can be used to make comparisons among several dependent correlation coefficients?  EDIT: thanks @russ-lenth for your answer. In general, I found that CIs computed from lsmeans are larger than those computed using Fisher's Z method. Here's an example of the CIs that I get through the lsmeans function:   rep.meas      lsmean         SE df   lower.CL  upper.CL  M1        0.76914236 0.13325688 23  0.4934795 1.0448052  M2        0.82346705 0.11830361 23  0.5787374 1.0681967  M3        0.89294217 0.09386717 23  0.6987631 1.0871212  M4       -0.09985512 0.20747224 23 -0.5290441 0.3293339  M5        0.56183690 0.17249315 23  0.2050076 0.9186662  M6        0.79086279 0.12760947 23  0.5268825 1.0548431  M7        0.14667681 0.20625924 23 -0.2800029 0.5733566   Take M1 whose r = 0.769 as an example: the width of the CI from lsmeans is (1.0448-0.4935) 0.5513. The width of the CI computed from Fisher’s Z is (0.8948-0.5302) 0.3646, which is much smaller than the former. Is the difference between the widths of the two confidence intervals too large?
25624
I have several hundred measurements. Now, I am considering utilizing some kind of software to correlate every measure with every measure. This means that there are thousands of correlations. Among these there should (statistically) be a high correlation, even if the data is completely random (each measure has only about 100 datapoints).  When I find a correlation, how do I include the information about how hard I looked for a correlation, into it?   I am not at a high level in statistics, so please bear with me.
17418
Suppose you fit a model $y = x_1 + x_2 + x_1\times x_2$. Are there any practical implications for estimation of the interaction effect if $x_1$ and $x_2$ are correlated?   I understand there could be collinearity issues if $x_1$ and $x_2$ are very correlated but that shouldn't affect the interaction term right?
98743
I'm sorry if this seems a bit too basic, but I guess I'm just looking to confirm understanding here. I get the sense I'd have to do this in two steps, and I've started trying to grok correlation matrices, but it's just starting to seem really involved. I'm looking for a concise explanation (ideally with hints towards a pseudocode solution) of a good, ideally quick way to generate correlated random numbers.   Given two pseudorandom variables height and weight with known means and variances, and a given correlation, I think I'm basically trying to understand what this second step should look like:     height = gaussianPdf(height.mean, height.variance)    weight = gaussianPdf(correlated_mean(height.mean, correlation_coefficient),                          correlated_variance(height.variance,                          correlation_coefficient))    How do I calculate the correlated mean and variance? But I want to confirm that's really the relevant problem here.  Do I need to resort to matrix manipulation? Or do I have something else very wrong in my basic approach to this problem?
24472
My professor was discussing correlation and when it implies independence. It was fairly clear to me that, if $X$ and $Y$ are independent, then their correlation is zero. The reverse direction is less clear. Correlation being zero doesn't imply independence. This makes some sense to me because correlation measures linear association in some sense, but I am having trouble coming up with a concrete example of this. He also stated that, if $X$ and $Y$ are bivariate normal and correlation is zero, then $X$ and $Y$ are independent. Can someone provide a proof/intuition about this?
55419
I am having a problem computing the pearson correlation coefficient of data sets with possibly zero standard deviation (i.e. all data has the same value).  Suppose that I have the following two data sets:  float x[] = {2, 2, 2, 3, 2}; float y[] = {2, 2, 2, 2, 2};   The correlation coefficient "r", would be computed using the following equation:  float r = covariance(x, y) / (std_dev(x) * std_dev(y));   However, because all data in data set "y" has the same value, the standard deviation std_dev(y) would be zero and "r" would be undefined.  Is there any solution for this problem? Or should I use other methods to measure data relationship in this case?
11136
How can you show that the magnitude of the sample correlation coefficient is at most $1$?  The formula is huge, I'm not even sure how to approach this. Can anyone point me in the right direction?  Note that this is the sample correlation coefficient:  $$r_{xy} = \dfrac{\displaystyle \sum_{i=1}^n (x_i - \bar{x})(y_i - \bar{y})}{(n-1)s_xs_y} = \dfrac{\displaystyle \sum_{i=1}^n (x_i - \bar{x})(y_i - \bar{y})}{\sqrt{\displaystyle \sum_{i=1}^{n} (x_i - \bar{x})^2 \displaystyle \sum_{i=1}^{n} (y_i - \bar{y})^2}}$$
9969
I am building a regression model and I need to calculate the below to check for correlations   Correlation between 2 Multi level categorical variables Correlation between a Multi level categorical variable and continuous variable  VIF(variance inflation factor) for a Multi level categorical variables   I believe its wrong to use Pearson correlation coefficient for the above scenarios because Pearson only works for 2 continuous variables.   Please answer the below questions   Which correlation coefficient works best for the above cases ?  VIF calculation only works for continuous data so what is the alternative?  What are the assumptions I need to check before I use the correlation coefficient you suggest?  How to implement them in SAS &amp; R?
41336
I know that for the $2$-dimensional case: given a correlation $\rho$ you can generate the first and second values, $ X_1 $ and $X_2$, from the standard normal distribution. Then from there make $X_3$ a linear combination of the two $X_3 = \rho X_1 + \sqrt{1-\rho^2}\,X_2$ then take  $$ Y_1 = \mu_1  + \sigma_1 X_1, \quad Y_2 = \mu_2 + \sigma_2 X_3$$  So that now $Y_1$ and $Y_2$ have correlation $\rho$.  How would this be scaled to $n$ variables? With the condition that the end variables satisfy a given correlation matrix? I'm guessing at least n variables will need to be generated then a reassignment through a linear combination of them all will be required... but I'm not sure how to approach it.
111581
Suppose $X,Y$ and $Z$ are multivariate normal with means and full covariance matrix. The conditional expectation $E(X | Y)$ is well know. What is the conditional expectation of $E(X | Y,Z)$ if $Y$ and $Z$ (and $X$) are correlated? Standard textbooks only seem to cover the case when $Y$ and $Z$ are uncorrelated.
114299
I have observed that, on average, the absolute value of Pearson correlation coefficient is a constant close to 0.560.42 for any pair of independent random walks, regardless of the walk length.  Can someone explain this phenomenon?  I expected the correlations to get smaller as the walk length increases, like with any random sequence.  For my experiments I used random gaussian walks with step mean 0 and step standard deviation 1.  UPDATE:  I forgot to center the data, that's why it was 0.56 instead of 0.42.  Here is the Python script to compute the correlations:  import numpy as np from itertools import combinations, accumulate import random  def compute(length, count, seed, center=True):     random.seed(seed)     basis = []     for _i in range(count):         walk = np.array(list(accumulate( random.gauss(0, 1) for _j in range(length) )))         if center:             walk -= np.mean(walk)         basis.append(walk / np.sqrt(np.dot(walk, walk)))     return np.mean([ abs(np.dot(x, y)) for x, y in combinations(basis, 2) ])  print(compute(10000, 1000, 123))
97343
What is the best statistical test for investigating if there is any correlation between 2 categorical variables? Both are satisfaction scores: 1st variable is:  Overall satisfaction with the service. 1: Not at all satisfied; 10: Completely satisfied  2nd variable is:  Satisfaction with the availability of information for the service&quot; 1: Not at all satisfied; 10: Completely satisfied.
117145
Given two vectors of random variables $X$ and $Y$, Canonical Correlation Analysis (CCA) finds the transformation matrices $A$ and $B$ so that $\operatorname{corr}(A_{1*} X, B_{1*} Y)$ is first maximal, $\operatorname{corr}(A_{2*} X, B_{2*} Y)$ is then maximal subject to $\operatorname{corr}(A_{1*} X, A_{2*} X) = 0$ and $\operatorname{corr}(B_{1*} Y, B_{2*} Y) = 0$, etc.  Is there any global objective function that $A$ and $B$ also optimize? For instance, do they maximize $\sum_i \operatorname{corr}(A_{i*} X, B_{i*} Y)$ subject to $A^TA=I$ and $B^TB=I$, or something around this line?  Related to that, if we define a transformation matrix $W = B^{-1}A$, is there any relation between $WX$ and $Y$ for which $W$ is optimal? In particular, is it possible to establish some connection between this transformation $W$ and the optimization objective of Ordinary Least Squares (OLS)?
17128
I have two datasets, one containing the percentage of people with flu and one which has the number of searches for Tea-recipes in google. Problem is, I get different results when i choose to include the percentage number instead of the real number of people with flu.  Im using Excel function Correl(peoplwithflupercentage, teasearches)  My question is, can I somehow use percentages to look for correlation with real numbers. Like correlation between a dataset (percentage numbers) and another dataset (real numbers)? I know this probably is a simple question, but  can't seem to find a good example in the forum or google.
65782
If you want to test whether two variables follow the same distribution, would it be a good test to simply sort both variables, and then check their correlation? If it is high (at least 0.9?), then the variables most likely come from the same distribution.  With distribution here I mean "normal", "chi-square", "gamma" etc.
31422
Suppose that $X\sim N(0,1)$, $Y\sim N(0,1)$ with correlation $(X, Y) =ρ$ where $ρ ∈ (−1, 1)$.  Show the following,   Correlation $(Φ(X),Φ(Y))=\dfrac6π \arcsin\dfrac ρ2 $.  Here $Φ(X)$, and $Φ(Y)$ denote the CDF of Random variables $X$ and $Y$ respectively.  What I know so far:  $$\text{Cov}( Φ(X),Φ(Y)) =E(Φ(X)Φ(Y)) - E(Φ(X)) ×E(Φ(Y)) $$  We also know since  $X \sim N(0,1)$ and $Y\sim N(0,1)$;  $Φ(X)\sim\text{unif}(0,1)$, $Φ(Y)\sim\text{unif}(0,1)$. Hence $$E(Φ(X)) =E(Φ(Y)) =\frac12.$$  I am stuck in finding $E(Φ(X)Φ(Y))$ [I tried to find it using double expectation].  What I have written may be the wrong way of attempting the question. So I am thankful for any help.
40177
Let $X,A,B,C,D$ be time-series variables and the covariance between any two pairs of these are known.  Suppose we want to find $\textrm{cov}(X,aA + bB + cC + dD)$, where $a,b,c,d$ are constants.  Is there any way of doing this without expanding out $E[(X-E[X])(aA+......)]$?