Unless I'm reading you incorrectly you would have approximately this many degrees of freedom in a standard repeated measures ANOVA. The ANOVA error is the interaction between subjects and the effect and requires degrees of freedom from both. However, if you are making multiple measures at each time interval then yes, the degrees for freedom are much higher for the mixed effects model.

It's not the standard pseudoreplication problem you'd have if you were doing a repeated measures ANOVA. With the ANOVA you are only modelling the effects in question and should aggregate your data to get better estimates of each effect for each S. With mixed effects modelling you are potentially modelling each data point, even those pseudoreplicated measurements you take for accuracies sake. You can do that because you're explicitly saying these individual measures are grouped within subjects and within this factor, etc. Therefore, you can often have more degrees of freedom. Although, as I stated before, it doesn't sound like that's the case here anyway.

The answer by @user20637 is mostly correct. However, the problem here is not that there is a lack of fit in the 3rd-order polynomial model, nor is the 4th-order polynomial necessarily a better fit. In fact, the particular values of the residuals doesn't matter to the question of why the p-values go down when you add a new term to the model.

Your p-values are calculated using t-statistics, which are computed by dividing the `Estimate`

column by the `Std. Error`

column in the results tables. Since you're using orthogonal polynomials, the estimated values for polynomial terms 0-3 don't change when you add the 4th term.

But the standard errors are proportional to "residual sum of squares divided by residual degrees of freedom". Adding an additional term to your regression model will always cause the residual sum of squares to go down. It also decreases the residual degrees of freedom by one (from 10 to 9). In your case,

```
RSS(4)/9 < RSS(3)/10,
```

where `RSS(4)`

is the residual sum of squares for the 4th-order model and `RSS(3)`

is the residual sum of squares for the 3rd-order model. Therefore (and since the proportionality constant doesn't change), adding the 4th polynomial term decreases the standard error for the previous coefficient estimates. This makes them appear more statistically significant.

However, coefficient p-values cannot be used to compare the two models because each p-value here has a specific interpretation that is in terms of comparing the complete model with that variable to the model where that variable is dropped. This is why the p-value for the 4th polynomial term in your second table is identical to the p-value of the 4th-order model in your ANOVA table. I mean that the ANOVA is comparing your 3rd-order model to your 4th-order model, and this is exactly what the p-value for `poly(x, 4)4`

in your second table is doing, too.

That's all well and good for the 4th term, but the p-value of `poly(x, 2)4`

is comparing a model with 0th, 1st, 3rd, and 4th order orthogonal polynomial terms to a model with all 0th - 4th terms. And even worse, you have to decide in advance that *that* is the only comparison you want to make, because once you look at a second p-value (or third or...) your comparisons no longer have the p=0.05 level for statistical significance. In fact, you cannot know what the true level of the test is without some very advanced stats.

## Best Answer

When dealing with predictive models it is maybe better in some sense to think about the number of parameters in the model. The number of parameters shows in some sense how flexible the model is. Parameters may be dependent, e.g. in hierarchical models, so then you need to look at the effective number of parameters, which is another way to quantify the flexibility of the model.

This is mostly to account for overfitting, (although that is not the whole truth).

Imagine that you are fitting an n-th degree polynomial to n+1 data points. The polynomial has n+1 parameters and will hit every single one of your data points. The polynomial may have huge parameters and fluctuate very high up and down. This is probably not the true underlying model in most cases.

Thus you can for example regularize the parameters, e.g. by penalizing the norm of the parameters. This reduces the effective number of parameters, thus restricting the degrees of freedom in the model. Another option is to fit a lower degree polynomial and see how that looks.

If a model has a degree of freedom $p$, you would need at least $p$ data points to get an estimate of the parameters in the model, otherwise you have an underdetermined system. If you are fitting some $n$ data points with large errors you usually want $n$ to be pretty much larger than $p$. Otherwise you risk overfitting. The case where it is "ok" to have $n$ close to $p$ is when the errors are very small and you really know the true underlying model,

which in most cases is not true.Degrees of freedom for test statistics is the number $\nu=n-p$, so they are not entirely the same thing but very closely related.

To summarizeSo if the degrees of freedom in your model are on the scale of the number of data points, you will most likely overfit and have very bad predictions.

This blog summarizes this quite well.

To completely understand degrees of freedom, in the sense of tests and parameter estimates, check out this CV post