0
$\begingroup$

I have a very urgent issue that I need to solve this weekend.
If I create a linear model between 2 variables and look for the R square with this code:

Var1_lm<- lm(Var1 ~ Var2, data = data)  
summary(Var1_lm) 

this is what I get: Multiple R-squared: 0.5335, Adjusted R-squared: 0.5044
It is much smaller than the Pearson coefficient displayed in a correlation matrix that contain the same variables which is 0.93 (in the matrix box of Var1/Var2)
When I run a Pearson test
cor.test(data$var1, data$var2,
method = "pearson")
I get 0.73 :
t = 4.2778, df = 16, p-value = 0.0005767
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
0.3999465 0.8928301
sample estimates:
cor
0.7304287
So basically I have 3 different numbers and I have read on many websites that the Rsquare is the squared Pearson coefficient, which is not the case here. My understanding is that the Pearson coefficient could be smaller than the Rsquare as it is on a -1 to 1 scale but is not supposed to be that much higher? And why is the Pearson test different than the Pearson coefficient in the correlation matrix?

$\endgroup$
4
  • $\begingroup$ Welcome to Cross Validated! Please format your post as I began to do with my edit. It is difficult to read, which may deter people from answering. $\endgroup$
    – Dave
    Commented Aug 27, 2021 at 19:22
  • 2
    $\begingroup$ Does this answer your question? How does the correlation coefficient differ from regression slope? Please read that thread, which I think contains answers to yours. If not, please edit this question to specify what remains at issue given what you read in the other question. $\endgroup$
    – EdM
    Commented Aug 27, 2021 at 19:48
  • 2
    $\begingroup$ What number do you get when you square the correlation , r from your cor.test? How close is it to r-squared? What leads you to think the 0.93 is the correlation of var1 and var2 $\endgroup$
    – Glen_b
    Commented Aug 28, 2021 at 6:47
  • 1
    $\begingroup$ Notice that $0.73043^2=0.5335.$ This leads me to disbelieve your report of a raw correlation of $0.93$ between the variables. That's either a misreading or a programming error. $\endgroup$
    – whuber
    Commented Aug 28, 2021 at 19:08

0