New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
parentheses unbalanced error when using IV #146
Comments
I should note that if I install the SSC version I don't get the error. |
My bad, the error message is not quite clear: I moved the IV code of reghdfe into ivreghdfe, so you need to install and use that package in order to do IV (technically, there is no "IV" code, as I was just wrapping ivreg2) |
Ok great. Many thanks indeed. While I'm here, I also note that if I write (at least with the SSC version: reghdfe price (length = gear) weight, absorb(turn trunk) I get an error. This is easy to address as a user - but I wondered if it was intentional? |
I now have a different problem with the ivreghdfe.ado file -- Am I being stupid?
|
About the first thing, it's because I only coded it to expect parenthesis after the other regressors (now it will just do whatever ivreg2 does) About the second, that's an ivreg2 error. Can you double check that ivreg2 is installed and more importantly up-to-date, and try running a regression with that? |
Thanks again. Turns out I somehow had multiple vintages of ivreg2 installed. Works beautifully now. |
Hi Dot, I'm a reghdfe user facing a similar problem, only my error is occurring while loading ivreg2_p.ado. I was just curious what precisely your problem was. Did you have two copies of a file named ivreg2.ado and/or ivreg2_p.ado installed in different system directories? I'm working on a gov server without internet access, so no ssc or netinstall. Any extra information here might be quite helpful. Thanks, |
I had ivreg2 files in multiple places, more than two, in my ado directories and so I deleted them all and started over again. Hope this helps. |
Dear Sergio, thank you for the very nice package. I also encountered a problem when trying to estimate IV with regdhfe. I then installed ivregdhfe and everything worked perfect. However, I like to implement three-way clustering, but ivregdhfe only supports two-way clustering because it is based on ivreg2. Is there any possibility to (a) either use IV with regdhfe, so that one can allow for three-way clustering, or (b) extend ivregdhfe to make three-way clustering possible? Thank you very much, |
@Sebastian1612 as a workaround you can always resort to the "old" option of reghdfe, which allows both IV and three way clustering. Best, |
Thank you very much, but I got the following error message when using the old command with three-way clustering: (running historical version of reghdfe) |
You are right; it's sadly not supported. The only alternative would be to implement IV regressions within reghdfe, which is not particularly appealing for obvious reasons, so we're sadly out of luck. (That said, I'm not aware of many fields were clustering at 3+ levels is common practice, so you might not need to do so) |
I also stumbled across this when I made the most recent update (the new indication of FE is great! Thank you!). It seems that just updating this in the help file would prevent future questions since the current IV example doesn't work. |
Point taken! I have a bit of a backlog in other things, but I definitely need to update the help file and give a more sane error message. |
Hi Sergio,
With both real data and the auto dataset I get the error parentheses unbalanced when trying to run an IV regression. Please see below. I believe I'm running the latest version of reghdfe and ftools, although I only have Stata 14.2.
Thanks as always for all your hard work,
Dot
. sysuse auto
(1978 Automobile Data)
. reghdfe price weight length, absorb(turn trunk)
(dropped 9 singleton observations)
(MWFE estimator converged in 11 iterations)
HDFE Linear regression Number of obs = 65
Absorbing 2 HDFE groups F( 2, 38) = 12.85
Prob > F = 0.0001
R-squared = 0.6403
Adj R-squared = 0.3942
Within R-sq. = 0.4035
Root MSE = 2254.6288
-------------+----------------------------------------------------------------
weight | 5.688144 1.302818 4.37 0.000 3.050727 8.325561
length | -44.21191 57.60797 -0.77 0.448 -160.8332 72.40933
_cons | -2627.673 8851.647 -0.30 0.768 -20546.9 15291.55
Absorbed degrees of freedom:
-----------------------------------------------------+
Absorbed FE | Categories - Redundant = Num. Coefs |
-------------+---------------------------------------|
turn | 13 0 13 |
trunk | 13 1 12 |
-----------------------------------------------------+
. reghdfe price weight (length = gear), absorb(turn trunk)
parentheses unbalanced
r(132);
. reghdfe, version
Library/Application Support/Stata/ado/plus/r/reghdfe.ado
*! version 5.2.9 06aug2018
Required packages installed?
. ftools, version
Library/Application Support/Stata/ado/plus/f/ftools.ado
*! version 2.30.3 02aug2018
Required packages installed?
. di c(stata_version)
14.2
. di c(os)
MacOSX
The text was updated successfully, but these errors were encountered: