[R] pearson's correlation and cross-correlation issue

2013-02-14 Thread Pierre Antoine DuBoDeNa
Hello, I want to compute the pearson's correlation, but even for signals that are shifted. For example having two signals like: 1 1 2 1 1 and 1 2 1 1 1 the correlation is very low.. but if we shift them in the right we get much better correlation. I know that cross-correlation is used to find

Re: [R] pearson's correlation

2008-04-05 Thread Eik Vettorazzi
The difference may be due to different handling of missing values. If you do cor(x,y) "by hand" in excel, you use all available information of x and y to calculate sd(x) and sd(y) seperately. But cov(x,y) in excel will use only complete pairs of (x,y), which is likely not the same set. So your

Re: [R] pearson's correlation

2008-04-05 Thread Claus Wilke
> I used the function cor to calculate the pearson correlation coefficient > between variables. However, the resulting values do not correspond to the > outcome of my excel-calculations, for which I used the formula > Cor(x,y)=Cov(x,y)/(SD(x)*SD(y)) So my question is: How does the function > "cor"

[R] pearson's correlation

2008-04-05 Thread Ake Nauta
Hello, I used the function cor to calculate the pearson correlation coefficient between variables. However, the resulting values do not correspond to the outcome of my excel-calculations, for which I used the formula Cor(x,y)=Cov(x,y)/(SD(x)*SD(y)) So my question is: How does the function "cor