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?