Dear R users,
I have a question here
library(AER)
library(plm)
library(sandwich)
## take the following data
data("Gasoline", package="plm")
Gasoline$f.year=as.factor(Gasoline$year)
Now I run the following regression
rhs <- "-1 + f.year + lincomep+lrpmg+lcarpcap"
m1<- lm(as.formula(paste("lgaspcar ~", rhs)), data=Gasoline)
###Now I want to find the autocorrelation,heteroskedasticity adjusted
standard errors as a part of coeftest
### Basically I would like to take care of the within country serial
correlaion
###that is I want to do
coeftest(m1, vcov=function(x) vcovHAC(x,order.by=...))
Please suggest what should be the argument of order.by and whether that will
give me the desired result
[[alternative HTML version deleted]]
On Tue, 8 Dec 2009, sayan dasgupta wrote:> Dear R users, > I have a question here > > library(AER) > library(plm)??? > library(sandwich) > ## take the following data > data("Gasoline", package="plm") > Gasoline$f.year=as.factor(Gasoline$year) > > Now I run the following regression > > rhs <- "-1 + f.year + lincomep+lrpmg+lcarpcap" > m1<- lm(as.formula(paste("lgaspcar ~", rhs)), data=Gasoline) > ###Now I want to find the autocorrelation,heteroskedasticity adjusted > standard errors as a part of coeftest > ### Basically I would like to take care of the within country serial > correlaion > > ###that is I want to do > coeftest(m1, vcov=function(x) vcovHAC(x,order.by=...)) > > Please suggest what should be the argument of order.by and whether that will > give me the desired resultCurrently, the default vcovHAC() method just implements the time series case. A generalization to panel data is not yet available. Maybe Yves and Giovanni (authors of "plm") have done something in that direction... sorry, Z
Reasonably Related Threads
- plm Issues
- Urgent: How to obtain the Consistent Standard Errors after apply 2SLS through tsls() from sem or systemfit("2SLS") without this error message !!!!!!!!!!!!!
- Robust SE for lrm object
- latex output of regressions with standardized regression coefficients and t-statistics based on Huber-White
- Heteroskedasticity and Autocorrelation in SemiPar package