[R] Problems with obtaining t-tests of regression
Millo Giovanni
Giovanni_Millo at Generali.com
Wed Feb 21 12:53:07 CET 2007
Guillermo,
I am dropping most of your mail because my answer is very generic.
First, why doesn't it work as you tried it: technically speaking,
coeftest() and the like expect to be feed an lm or a glm object and for
this reason won't accept the result of systemfit(), which is a much
different object. I suppose the same goes for the rest.
Second, what can you do: I'd do at least one step by hand.
a) as you have only one structural equation, maybe the easiest is to get
an lm object equivalent to the 2sls model you need, then apply
coeftest() and the like to this object. The two-step procedure outlined
in any textbook (e.g. Wooldridge, Econometrics of cross section and
panel data, MIT 2002, page 91) *should* produce a suitable object.
Please note: I cannot guarantee, though, that SEs are still appropriate:
see Wooldridge, bottom of page 91.
b) it could be safer to explicitly compute HC SEs by formula 5.34 in
Wooldridge, based on the 2sls residuals you got from systemfit().
c??) Maybe there's a shorter way: I suspect that the following could
work:
- regress Sc on the rest, get Sc_hat
- estimate step2model<-lm(lnP~Ag+Ag2+Var+R+D+Sc_hat)
and now I think coeftest(step2model,vcov=vcovHC) should compute exactly
formula (5.34) in Wooldridge, but *please check this out*, as it is only
an intuition!!
Best,
Giovanni
------------------------------
Message: 3
Date: Tue, 20 Feb 2007 14:00:56 +0100
From: " Guillermo Juli?n San Mart?n "
<guillermojsanmartin at googlemail.com>
Subject: [R] Problems with obtaining t-tests of regression
coefficients applying consistent standard errors after run
2SLS
estimation. Clearer !!!!!
To: r-help at stat.math.ethz.ch
Message-ID: <48a5ea80702200500tc57d76r67d48d918af57244 at mail.gmail.com>
Content-Type: text/plain
First I have to say I am sorry because I have not been so clear in my
previous e-mails. I will try to explain clearer what it is my problem.
I have the following model:
lnP=Sc+Ag+Ag2+Var+R+D
In this model the variable Sc is endogenous and the rest are all
objective exogenous variables. I verified that Sc is endogenous through
a standard Hausman test. To determine this I defined before a new
instrumental variable, I2. Also I detected through a Breusch Pagan Test
a problem of heteroskedasticity.
With the intention to avoid the problem of the endogenous variable and
the heteroskedasticity I want to apply first the technique 2SLS and then
based in these results I want to obtain the t-tests of the coefficients
applying Heteroskedasticity Consistent Standard Errors (HCSE) or
Huber-White errors.
Like I showed above I have just one structural equation in the model. In
this situation, to apply 2SLS in R until I know there two possible ways:
First to use the function tsls() from package sem, or second, to use the
function systemfit() from package systemfit. I thought that systemfit
was for situations when there are more than one structural equation in
the model. Anyway I probed with the two ways and I obtained similar
results. Below, I show the program lines:
(dropped)
Ai sensi del D.Lgs. 196/2003 si precisa che le informazioni ...{{dropped}}
More information about the R-help
mailing list