2

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?

Tushar Lad
  • 490
  • 1
  • 4
  • 17
Worldman
  • 21
  • 1
  • Please provide a [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) – Conor Neilson Mar 19 '20 at 14:19

1 Answers1

2

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.

Erin Sprünken
  • 400
  • 2
  • 13