Questions tagged [ivreg]
9 questions
3
votes
2 answers
Why does ivreg function generate strange error
I'm trying to use instrument variables for the following three variables: pwtopen, inc, incsqr with the following three instruments: elhsfs, incf, incfsqr. polity is an exegenous variable.
answer<- ivreg(sulfdm ~ polity + pwtopen + inc +…

DJF
- 103
- 1
- 9
2
votes
1 answer
How can I round metrics in modelsummary package?
I enjoy the option metrics="all" in modelsummary package that gives excellent summary statistics of instrument variable models (e.g. ivreg), namely the Wu-Hausman test.
data(mtcars)
library(ivreg)
iv_model <- ivreg(mpg ~ qsec + cyl + drat | disp |…

Marco
- 2,368
- 6
- 22
- 48
1
vote
2 answers
IV Regression With Clustered Standard Errors
On R, I have panel dataset with observations for individual, year and variables y, x and z. I am trying to estimate an IV regression so that:
$$y = \beta x + e$$
$$x = \alpha z + u$$
Is there a way to estimate the IV regression while clustering…

Student In Need
- 31
- 6
1
vote
1 answer
2SLS standard errors with ivreg and plm in R
Could someone please confirm whether ivreg is calculating correct 2SLS standard errors by default or do I still have to manually correct them? I have an instrumental variable Z1 in my regression.
library(ivreg)
ivreg1 <- ivreg(log(Y) ~ log(X) + W1 +…

TFT
- 129
- 10
0
votes
1 answer
Insufficient Number of Instruments Error PLM IV on Unbalanced Panel
I am attempting to run the following IV regression on an unbalanced panel dataset. The variables TOTAL_E, TOURISM_5k_SUM and TOURISM_10K_SUM are endogenous, while HHSIZE2 and SEX are exogenous explanatory variables, and Z_b_100,tourism_5KM_ZSCORE…

Matt
- 97
- 10
0
votes
0 answers
Ivreg and clustering in R
Struggling to get clustering to work with ivreg in R. Clustering is based on a variable with 255 unique values.
I've been trying to translate this stata code to R
ivreg2 X (Y = A?) iv1 iv2 iv3 if year==`year',
cluster(clustervariable)
Currently…

ThankfulStudent
- 1
- 3
0
votes
1 answer
Model summary and diagnostics for instrumental variables in R
I run instrumental variable regression (2SLS) with ivreg package.
library(ivreg)
as_tibble(mtcars)
model_iv <- ivreg(formula = mpg ~ disp + drat |
drat + carb,
data = mtcars)
As many other…

Marco
- 2,368
- 6
- 22
- 48
0
votes
0 answers
Cannot Save IV Regression Summary
I ran three IV regressions with the ivreg command. I am trying to save the results of the diagnostic tests so I can then add them to a stargazer table:
summ.reg <- summary(iv_reg, vcov. = function(x) vcovHC(x, type="HC0"), diagnostics=T)
The only…

Student In Need
- 31
- 6
0
votes
1 answer
Instrument variable three-part right side notation with ivreg in R
The vignette of ivreg https://cran.r-project.org/web/packages/ivreg/vignettes/ivreg.html says As listing exogenous variables in both parts on the right-hand side of the formula may become tedious if there are many of them, an additional convenience…

Marco
- 2,368
- 6
- 22
- 48