3

I was wondering what is the F test (in general) that is done by the function $\texttt{lm()}$ in R.

I mean you can do different F tests, which one does it chose and how? For instance in a linear regression setting, I can fit a certain model with $\texttt{lm()}$ , but (before running the code) how do we know against which model it will be compared to?

For instance look at this: enter image description here

For instance my model here is of the form $$Y_i= \beta_0+\beta_1x_{i1}+\beta_2x_{i2}+\beta_3x_{i1}^2+\beta_4x_{i2}^2+\beta_5x_{i1}x_{i2}+\epsilon_i$$ but, before running this code, what F-test could I have expected to get out of $\texttt{lm()}$? And what test (here) has actually been performed?

Euler_Salter
  • 1,426
  • 14
  • 33
  • 1
    The f-test compares the fit of an intercept only model to the model you've specified and verifies if the additional terms has any significant difference. When your p-value is lesser than the desired significance you would conclude that your model is indeed "better" than just using an intercept. – Arun Jose May 11 '17 at 10:37
  • 2
    See [Interpretation of R's lm() output](https://stats.stackexchange.com/questions/5135/interpretation-of-rs-lm-output) and [How to interpret the output of the summary method for an lm object in R?](https://stats.stackexchange.com/questions/59250/how-to-interpret-the-output-of-the-summary-method-for-an-lm-object-in-r/59251#59251) each of which have an answer that gives some information relating to this question – Glen_b May 11 '17 at 10:52

1 Answers1

7

The $F$ test always tests against the intercept-only model (y ~ 1) unless the model has not intercept, then a zero-mean model is used (y ~ 0). In your case, this means that the null hypothesis $\beta_1 = \dots = \beta_5 = 0$ is tested.

Achim Zeileis
  • 13,510
  • 1
  • 29
  • 53