[R] Lack of Fit test
Bill Venables
William.Venables at cmis.CSIRO.AU
Wed Feb 23 03:48:49 CET 2000
Alan T. Arnholt asks:
> Does anyone know of a "Lack of Fit" program for regression or
> have any thoughts on how one might work with "lm" to create
> such code? Many thanks in advance.
There is no canonical way of doing this. This is primarily why
people use regression diagnostics.
Most standard tests for lack of fit, such as chi-squared tests,
amount to testing the current model within some global model that
contains all realistic models as special cases. With regression
models that information has to be used to estimate the variance,
and indeed if you knew sigma^2 beforehand you could use the RSS
for a chi-squared test of lack of fit, but mostly you do not know
sigma^2 beforehand.
The same idea can be used to produce a special purpose test for
lack of fit, even if it must lack the global aspect of standard
chi-squared test. What you do is dream up a larger model that
contains the model you are considering as a special case but has
enough flexibility to cater for any of the kinds of lack of fit
you think might be worth checking for. The larger model still
has to have enough residual degrees of freedom, though, to allow
you to estimate sigma^2 in a fairly stable manner (you might even
consider doing it robustly). Then test the chosen model within
the outer model in the standard way.
Of course this demands that you have enough knowledge of the
situation to choose the outer model satisfactorily. It makes it
impossible to write code to do it automatically, but if you know
what you are doing the procedure is simple with the software you
have. As with so many things in statistics, it is not a matter
of good software so much as of having a good understanding of the
problem in hand.
Bill Venables.
--
Bill Venables, Statistician, CMIS Environmetrics Project
CSIRO Marine Labs, PO Box 120, Cleveland, Qld, AUSTRALIA. 4163
Tel: +61 7 3826 7251 Email: Bill.Venables at cmis.csiro.au
Fax: +61 7 3826 7304 http://www.cmis.csiro.au/bill.venables/
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list