2
$\begingroup$

p-value for y, cor.test and F-test is the same 0.24 for below code. I assume this is due to F = t^2, but not entirely sure why.

set.seed(1234)
x = rnorm(20, 10, 5)
y = rnorm(20, 50, 15)
cor(x,y)
summary(lm(x~y))
cor.test(x,y)
anova(lm(x~y))
$\endgroup$

0

Your Answer

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