I'm fitting a time-series model with independent $X$ variables coded as months of the year (so there are 12 of them) and the dependent $y$ variable is some proportion, bounded between 0 and 1. As a result, I'm using a GLM with logit link function. The fit is pretty good.

I notice, however, that my residuals are autocorrelated (and this is corroborated by a DW statistic close to 0).

I'm able to fit an AR(1) model to the residuals and I'd like to see what the impact has on my GLM-fitted model. However, when my $X$ variables are categorical, what does it mean to add an AR(1) term? Can I just do the same thing as if they were continuous, i.e. $X_{t}$ = $\phi$$X_{t-1}$? It seems odd since my $X$'s take on values of 1 or 0.


I do believe you should recode your values. They are not categorical, they are time-based. Say your first month is January 1995. THen that would be 1, then 2, then 3...January 1999 would take the value 4*12.

This is what you should fit the AR(1) on. It is fine to fit the GLM part of the model with the categorical equivalent if you believe that there is an effect of "January". This is essentially assuming there is cyclic behavior every 12 months and estimating that effect. Something that is necessary in order to fit an AR(1) model to begin with.

I am not wholly sure what the implications of using a glm and an AR(1) model together are of your covariance structures/inference.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.