# Lack-of-Fit Test

• Dec 17th 2009, 09:30 AM
hueteluis
Lack-of-Fit Test
Any one know why there is no lack of fit (null hypothesis is simple linear regression is correct) when you have a sinewave ramping upward? There is lack of fit when you have a wave ramping upward. Thanks.
• Dec 17th 2009, 10:49 PM
theodds
If this is the LOF Test that involves partitioning SS(Residual) into SS(Lack of Fit) and SS(Pure Error), you can use that one to test for a lack-of-fit for any kind of model, it's just somewhat unusual to get enough reps at the same levels to make the test very effective when you have multiple predictors. If the model is, say

$Y_i = \beta_0 + \beta_1 X + \beta_2 \mbox{sin} (2 \pi X) + \epsilon_i
$

or something like that (I'm a little rusty on sinusoidal models, I know they usually have some other stuff going on) you could do a standard LOF test by partitioning SS(Residual) (or SSE/SS(Error)/whatever you want to feel like calling it). If we have C distinct levels of X and N total observations, we would have C - 3 degrees of freedom on SS(Lack of Fit), and N - C degrees of freedom on on SS(Pure Error), the intuition being that when you are looking at the deviations of the individual points from their local means, you have N points and must estimate C distinct means, and when looking at the deviations of the means from the predicted values, you have C means but must estimate, in this particular case, three parameters (the Betas).