0
$\begingroup$

I wonder if I use model like

age = c(14,23,35,48,52,67)
pitch = c(252,244,240,233,212,204)
my.df = data.frame(age, pitch)
xmdl = lm(pitch ~ age, my.df)
summary(xmdl)

I have continuous predictor values (age) but it prints

F-statistic: 33.64 on 1 and 4 DF, p-value: 0.004395

I expected F-statistic works only for categorical predictors like sex (like in ANOVA). I do not understand the role of degrees of freedom and how actually the F statistics is computed in this particular case.

The code is from http://www.bodowinter.com/tutorial/bw_LME_tutorial1.pdf

$\endgroup$
  • $\begingroup$ Please read an introductionary textbook about linear regression. $\endgroup$ – Roland Dec 10 '14 at 12:35
2
$\begingroup$

Using the code you provided, a snippet of the output is below.

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept) 267.0765     6.8522   38.98 2.59e-06 ***
age          -0.9099     0.1569   -5.80  0.00439 ** 
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 6.886 on 4 degrees of freedom
Multiple R-squared:  0.8937,    Adjusted R-squared:  0.8672 
F-statistic: 33.64 on 1 and 4 DF,  p-value: 0.004395

The F-test in this case can be considered a test of whether a slope term is beneficial (in a statistical sense, compared to a 'null' model of only an intercept term. i.e. the slope is 0). You will notice that the p-value (Pr(>|t|)) for the age coefficient is the same as the p-value for the F-test (0.004395). You can view the F-test as a generalisation of t-tests, much like calculus in two or more dimensions is a generalisation of the calculus we learn in high school. But in this case the the F-test and t-test are one and the same as there is only one coefficient (or the multivariate calculus is reduced to one dimension as the analogy goes).

In more complicated examples of many predictors other than just age (say, sex as well), the F-test is testing whether at least one of age and sex have significant (non-zero) coefficients. You would first look at the F-test to see whether the model is an improvement on an intercept term only, then go on to work out which coefficients significantly differ from 0 using the t-tests, if the F-test tells you at least one of the coefficients differs from 0 (is significant). This is similar to hypothesis tests in ANOVA: if at least one mean differs from the rest, only then are you justified to perform post-hoc tests to find out which means do differ.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy