Wilson, Andrew
2006-Oct-10 07:18 UTC
[R] Goodness of fit measures for model with autocorrelation?
I wonder if anyone can help me with this query? I am undertaking textual content analyses which result in time series data (i.e., relative frequency counts of word categories in successive segments of a larger text or in successive individual texts in a temporal order). In regard to the content category that interests me, previous research has suggested an underlying five-stage psychological process and has proposed a fifth-degree polynomial as a general model for this in texts: cat_freq ~ I(time) + I(time^2) + I(time^3) + I(time^4) + I(time^5) I want to test the adequacy of this model on new data. If I fit the model using lm, I get two measures of goodness of fit: RSq and the significance of the ANOVA. However, autocorrelation is normally present in these data, so I should instead be using gls with an appropriate autocorrelation process such as cor(AR1). However, gls in R does not offer the RSq and ANOVA measures. Is there any way of getting these measures for a gls fit, or is there perhaps even a better way of testing the theoretical model on new data? Many thanks, Andrew Wilson Email: eiaaw at exchange.lancs.ac.uk