Hi,
I am trying to obtain the heteroskedasticity consitent standard errors
(HCSE) after apply 2SLS. I obtain 2SLS through tsls from package sem or
systemfit:
#### tsls ####
library (sem)
Reg2SLS <-tsls(LnP~Sc+Ag+Ag2+Var+R+D,~I2+Ag+Ag2+Var+R+D)
summary (Reg2SLS)
#### systemfit ####
library (systemfit)
RS <- LnP~Sc+Ag+Ag2+Var+R+D
Inst <- ~I2+Ag+Ag2+Var+R+D
labels <-list("RS")
system <-list(RS)
Reg2SLS <- systemfit("2SLS", system, labels, Inst, saveMemory=TRUE)
summary (Reg2SLS)
If I try to obtain the HCSE with robcov I obtain the following error message
in both cases:
Error in rep.default(1, p) : rep() incorrect type for second argument
If I tried to apply vcovHAC or vcovHC in the systemfit output of 2SLS I
receive the following messages of errors respectively:
Error in estfun(x) : no applicable method for "estfun" (for vcovHAC)
Error in terms.default(object) : no terms component (for vcovHC)
If somebody can help me to solve this problem I will thank you a lot.
Best regards
Guillermo
[[alternative HTML version deleted]]
______________________________________________
[email protected] 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.