Code covered by the BSD License  

Highlights from
lofrtest

Be the first to rate this file! 5 Downloads (last 30 days) File Size: 4.05 KB File ID: #7074

lofrtest

by Antonio Trujillo-Ortiz

 

07 Mar 2005 (Updated 22 Jun 2005)

Lack-of-fit test for regression model with independent replicate values.

| Watch this File

File Information
Description

This m-file provides a statistical test that gives information on the form of the model under consideration. A significant lack-of-fit suggest that there may be some systematic variation unaccounted for in the hypothesized model (chosen model does not well describe the data). It arises when there are exact replicate values of the independent variable in the model that provide an estimate of pure error. Pure error is in essence the amount of error that cannot be accounted for by any model. Then allows a test on whether there is error present aside from pure error. For the construction of the lack-of-fit test we need to examine three common types of linear models:
    - single mean (one parameter)
    - slope and intercept or common regression model (two parameters)
    - separate means for each x-value or one-way ANOVA (many parameters).

So, the pure error is the error of the separate means on ANOVA and the total error in the residual resulting in the regression analysis. So, the lack-of-fit results to be the difference between this two sources of error,

       SS(LOF) = SSR(Model) - SSE(ANOVA).

It needs to input D-matrix data (=[X Y]) (last column must be the Y-dependent variable). (X-independent variable entry can be for a simple [X], multiple [X1,X2,X3,...Xp] or polynomial [X,X^2,X^3,...,X^p] regression model.), and alpha-significance level (default = 0.05).

It outputs a complete summary (table) of analysis of variance partitioning sources of variation for testing lack-of-fit.

MATLAB release MATLAB 5.3 (R11)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Updates
10 Mar 2005

It was added an appropriate format to cite this file.

10 Mar 2005

File help was improved.

11 Mar 2005

Text was improved.

29 Mar 2005

Output was improved.

22 Jun 2005

Text was improved.

Tag Activity for this File
Tag Applied By Date/Time
statistics Antonio Trujillo-Ortiz 22 Oct 2008 07:42:52
probability Antonio Trujillo-Ortiz 22 Oct 2008 07:42:52
lackoffit Antonio Trujillo-Ortiz 22 Oct 2008 07:42:52
replicate values Antonio Trujillo-Ortiz 22 Oct 2008 07:42:52
linearity testing Antonio Trujillo-Ortiz 22 Oct 2008 07:42:52
regression Antonio Trujillo-Ortiz 22 Oct 2008 07:42:52
lackoffit Liu 04 Aug 2011 10:46:34

Contact us at files@mathworks.com