how to include an error term with structure AR(1) in the fixed effects model in R?
Use the package orcutt and the function
cochrane.orcutt() to handle the AR(1) part. If you have a modest number of fixed effects you can just make the relevant variable a factor and
lm() will do the fixed effects.
thank you for the feedback. But I forgot to specify that it's for a plm() panel template. To correct the autocorrelation, the indication of the literature of the subject that I am researching, indicates to model an AR(1) structure for the error term inside the model.
You may find the panelAR package helpful. (I haven't tried it.)
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.
If you have a query related to it or one of the replies, start a new topic and refer back with a link.