Open remlapmot opened 8 years ago
Thank you for pointing this out. Code for the homoskedastic standard errors was written by there was no way to call it. I have changed things so that the default show
method gives these standard errors as default
using RDatasets
using DataFramesMeta
cig = dataset("Ecdat", "Cigarette")
cig[:lrincome] = @with(cig, log(:Income./:POP./:CPI));
cig[:lrprice] = @with(cig, log(:AvgPrs./:CPI));
cig[:tdiff] = @with(cig, (:Taxs - :Tax)./:CPI)
cig[:rtax] = @with(cig, :Tax./:CPI)
cig95 = @ix(cig, :Year .== 1995)
y = convert(Array, log(cig95[:PackPC]));
x = convert(Array, [ones(size(cig95,1)) cig95[:lrincome] cig95[:lrprice]])
z = convert(Array, [ones(size(cig95,1)) cig95[:lrincome] cig95[:tdiff] cig95[:rtax]])
iv = ivreg(x, z, y)
InstrumentalVariables.LinearIVModel{InstrumentalVariables.DenseIVPredChol{Float64,Base.LinAlg.Cholesky{Float64,Array{Float64,2}}}}:
Coefficients:
Estimate Std.Error t value Pr(>|t|)
x1 9.89496 1.05856 9.34756 <1e-99
x2 0.280405 0.238565 1.17538 0.0836
x3 -1.27742 0.263199 -4.85346 <1e-99
To get the HC1() standard errors --- the default in STATA when ,rob
is used
coeftable(iv, HC1())
It's great that you have interfaced to the heteroskedasticity robust standard errors but would you mind adding the standard TSLS SEs. For the example you're using from the AER R package the default SEs from the
ivreg()
output are as follows:cheers, Tom