Dear Sayan,
 
no, unfortunately I don't think it will. 
 
Here's basically how coeftest() works: if you call the coeftest() function on a 
model object, say: 'mymodel', it will apply both a 'coef' and a 'vcov' method 
to mymodel in order to extract beta and vcov(beta) and do a Wald test. 
coeftest() works with many different kinds of models, represented by 'lm', 
'glm', 'plm' objects and so on, each containing a 'standard' covariance matrix, 
so that the default behaviour is just to extract this latter.
 
Alternatively, you can supply a vcov method of your choice to coeftest() and 
have it do robust testing etc., but it will still have to be one that fits your 
kind of model. So if 'mymodel' is a plm object, then 
 
> coeftest(mymodel, vcov=vcovHC)
 
will use the White-Arellano covariance matrix, which as observed is robust vs. 
serial correlation in its peculiar way, different from the Newey-West-based 
vcovHAC for 'lm' objects.
 
I'm too ignorant of the subject to give advice on tobit models, but a quick 
glance (?tobit) reveals that 'tobit' class objects inherit from 'survreg' ones, 
so that's the direction in which to look.
 
Maybe you are in a position to simply pool the data and use standard tobit and 
vcovHAC? Panel data would have N observations out of NT that are serially 
uncorrelated by construction, and of course this would imply the assumption of 
no individual effects whatsoever (but I am just guessing here...). 
 
Best wishes,
Giovanni

________________________________

Da: sayan dasgupta [mailto:kitt...@gmail.com] 
Inviato: mercoledì 9 dicembre 2009 06:59
A: Millo Giovanni; Achim Zeileis; yves.croiss...@let.ish-lyon.cnrs.fr
Cc: r-help@r-project.org
Oggetto: Re: Serial Correlation in panel data regression



Dear Sir,
Thanks for your reply
But still exists a trick . Basically I want to do Panel Tobit. I am using the 
tobit function from the package (AER) on a panel data .
Suppose that Gasoline$lgaspcar is  a 0 inflated data and I do 
m1<- tobit (as.formula(paste("lgaspcar ~", rhs)), data=Gasoline)

then if I do library(lmtest)

coeftest(m1,vcovHC)
Will it take account of the heteroskedasticity and serial correlation( within 
country ) of the data


Regards 
Sayan Dasgupta






On Tue, Dec 8, 2009 at 8:29 PM, Millo Giovanni <giovanni_mi...@generali.com> 
wrote:


        Dear Sayan,
        
        there is a vcovHC method for panel models doing the White-Arellano 
covariance matrix, which is robust vs. heteroskedasticity *and* serial 
correlation, although in a different way from that of vcovHAC. You can supply 
it to coeftest as well, just as you did. The point is in estimating the model 
as a panel model in the first place.
        
        So this should do what you need: 


        data("Gasoline", package="plm")
        Gasoline$f.year=as.factor(Gasoline$year)
        
        library(plm) 

        rhs <- "-1 + f.year + lincomep+lrpmg+lcarpcap"
        
        pm1<- plm(as.formula(paste("lgaspcar ~", rhs)), data=Gasoline, 
model="pooling")
        library(lmtest)
        coeftest(pm1, vcov=vcovHC)
        
        Please refer to the package vignette for 'plm' to check what it does 
exactly. Let me know if there are any issues.
        
        Best,
        Giovanni 




        -----Original Message-----
        From: Achim Zeileis [mailto:achim.zeil...@wu-wien.ac.at]
        Sent: Tue 08/12/2009 13.48
        To: sayan dasgupta
        Cc: r-help@R-project.org; yves.croiss...@let.ish-lyon.cnrs.fr; Millo 
Giovanni
        Subject: Re: Serial Correlation in panel data regression
        
        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 result
        
        Currently, 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
        
        

        

         
        Ai sensi del D.Lgs. 196/2003 si precisa che le informazioni contenute 
in questo messaggio sono riservate ed a uso esclusivo del destinatario. Qualora 
il messaggio in parola Le fosse pervenuto per errore, La invitiamo ad 
eliminarlo senza copiarlo e a non inoltrarlo a terzi, dandocene gentilmente 
comunicazione. Grazie.
        
        Pursuant to Legislative Decree No. 196/2003, you are hereby informed 
that this message contains confidential information intended only for the use 
of the addressee. If you are not the addressee, and have received this message 
by mistake, please delete it and immediately notify us. You may not copy or 
disseminate this message to anyone. Thank you.
        
        



        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to