Loading [MathJax]/jax/output/HTML-CSS/jax.js
Skip to main content
Library homepage
 

Text Color

Text Size

 

Margin Size

 

Font Type

Enable Dyslexic Font
Statistics LibreTexts

Test for Lack of Fit

( \newcommand{\kernel}{\mathrm{null}\,}\)

Lack of Fit

When we have repeated measurements for different values of the predictor variables X, it is possible to test whether a linear model fits the data.

Suppose that we have data that can be expressed in the form:

{(Xj,Yij):i=1,...,nj;j=1,...,c}where c>2.

Assume that the data come from the model :

Yij=μj+εij,i=1,...,nj;j=1,...,c(1).

The null hypothesis in which the linear model holds is: H0:μj=β0+β1Xj, for all j=1,...,c.

Here (1) is the full model and the model specified by H0 is the reduced model. We follow the usual procedure for the ANOVA, by computing the sum of squares due to errors for the full and reduced models.

Let ˉY=1njnji=1Yij, and ˉY=1ccj=1njˉYj=1nnj=1nji=1Yij, where n=cj=1nj.

SSTO=cj=1nji=1(YijˉY)2 and

SSPE=SSEfull=cj=1nji=1(YijˉYj)2=cj=1nji=1Y2ijcj=1njˉY2j

SSEred=SSE=cj=1nji=1(Yijβ0β1Xj)2

SSLF=SSEredSSEfull.

Degrees of freedom

d.f.(SSPE)=nc;d.f.(SSLF)=d.f.(SSEred)d.f.(SSPE)=(n2)(nc)=c2.

ANOVA Table
Source d.f. SS MS=SS/d.f. F-statistic
Regression 1 SSR MSR MSR/MSE
Error n-2 SSE=SSLF+SSPE MSE
Lack of fit c-2 SSLF MSLF MSLF/MSPE
Pure error n-c SSPE MSPE
Total n-1 SSTO=SSR+SSLF+SSPE

Reject H0:(μj=β0+β1Xjforallj) at level α if FLF=MSLFMSPE>F(1α;c2,nc).

Example: Growth rate data

In the following example, data are available on the effect of dietary supplement on the growth rates of rats. Here X= dose of dietary supplement and Y= growth rate. The following table presents the data in a form suitable for the analysis.

j=1
X1=10
n1=2

j=2
X2=15
n2=2

j=3
X3=20
n3=2

j=4
X4=25
n4=3

j=5
X5=30
n5=1

\(j = 6\)
X6=35
n6=2

Y11=73
Y21=78
Y12=85
Y22=88
Y13=90
Y23=91
Y14=87
Y24=86
Y34=91
Y15=75 Y16=65
Y26=63
ˉY1=75.5 ˉY2=86.5 ˉY3=90.5 ˉY4=88 ˉY5=75 ˉY6=64

So, for this data, c=6,n=cj=1nj=12.

SSTO=ji(YijˉY)2=1096.00

SSPE=jiY2ijjnjˉY2j=7982879704.5=33.50

SSEred=ij(Yijβ0β1Xj)2=891.73(Note:β0=92.003,β1=0.498)

SSLF=SSEredSSPE=891.7333.50=858.23

d.f.(SSPE)=nc=6

d.f.(SSLF)=c2=4

MSLF=SSLFc2=214.5575

MSPE=SSPEnc=5.5833

ANOVA Table:

Source d.f. SS MS F*
Regression
Error
1
10
204.27
891.73
204.27
89.173
MSRMSE= 2.29
Lack of fit
Pure error
4
6
858.23
33.50
214.56
5.583
MSLFMSPE= 38.43
Total 11 1096.00

F(0.95;4,6)=4.534. Since FLF=38.43>4.534, reject H0: μj=β0+β1Xj for all j at 5% level of significance.

Also, if you are testing H0: β1=0 against H1: β10, assuming that the linear model holds, as in the
usual ANOVA for linear regression, then the corresponding test statistic F=MSRMSE=2.29. Which is less than
F(0.95;1,n2)=F(0.95;1,10)=4.964. So, if one assumes that linear model holds then the test cannot reject H0 at 5% level of significance.

Contributors

  • Joy Wei
  • Debashis Paul

This page titled Test for Lack of Fit is shared under a not declared license and was authored, remixed, and/or curated by Debashis Paul.

Support Center

How can we help?