Reputation: 21
Im currently doing linear regression for data set. I need to test hypothesis H0:B1=0 vs H1:B1=/=0 for significance lvl a = 0.05 and find p-value. I run command summary(lm(y~x~))
and the p-value was 0.02781
However when I tried t.test(x,y)
I got p-value = 5.71e-15
Why is that?
Upvotes: 2
Views: 594
Reputation: 400
the p-value of the summary corresponds to the t-test of the beta of your regression model. If you run t.test(x,y) you test whether the means of x and y are equal to each other, that has nothing to do with the test whether B1 is equal/unequal to zero.
Upvotes: 2