[R-sig-ME] gls function - goodness of fit

Ben Bolker bbolker at gmail.com
Tue Jul 8 09:09:44 CEST 2014


Hebert, Issac (MNR <Issac.Hebert at ...> writes:

>  Hello, I am using the gls function to model lake whitefish growth
> rates in response to selected climate variables.  I am comparing
> models using AIC and I would also like to report the goodness of fit
> of each model. However, I am having difficulty finding a method that
> can be used with the gls function. For several of the models I am
> including an ARMA correlation to correct for temporal
> autocorrelation within the models and therefore cannot simply use
> the r-squared values within a linear model.  Do you have any advice
> on this matter or know of a method that I can use?  Any
> help/guidance would be greatly appreciated.  Regards, Issac Hébert

  I don't know the answer (sorry), but I will suggest that this might be
a non-trivial statistical question; in general, 'simple' goodness-of-fit
questions become more difficult as soon as you encounter anything
more complicated than simple least-squares problem.  You can compare
your model to a null model and see if it is significantly better,
but I don't know whether any of the standard strategies (e.g. comparing
proportion of sum of squared residuals to those of a null model)
make sense in this case.               

library(nlme)
fm1 <- gls(follicles ~ sin(2*pi*Time) + cos(2*pi*Time), Ovary,
            correlation = corAR1(form = ~ 1 | Mare), method="ML")
fm0 <- update(fm1,.~1)
anova(fm0,fm1)
## ???

A Google Scholar search finds Buse (1973)
"Goodness of Fit in Generalized Least Squares Estimation"
DOI: 10.1080/00031305.1973.10479003

  Buse gives an expression for R^2 (eq. 15), although (1) this isn't
completely trivial (you have to set up an estimated
variance-covariance matrix for the residuals) and (2) Buse warns that
it shouldn't be taken too seriously (e.g. shouldn't be used for
statistical tests).
fo



More information about the R-sig-mixed-models mailing list