sergiocorreia / reghdfe

Linear, IV and GMM Regressions With Any Number of Fixed Effects
http://scorreia.com/software/reghdfe/
MIT License
219 stars 57 forks source link

[BUG] attempt to use standardized variables in a regression, get "r 3498 stdevs are missing" #207

Closed jczelaya closed 4 years ago

jczelaya commented 4 years ago

  1. Hi Sergio, I'm using the latest version as indicated and my Stata is up to date (SE 16.1 28apr2020) OS Windows 10.

I am trying to run of a non-standardized y-variable on 2 standardized x variables, the interaction of the 2 standardized x variables (c.x1#c.x2), and several non-standardized control variables. I expected to see the usual reghdfe regression output (which I get without standardizing the x variables), but instead get this:

     _assert_abort():  3498  stdevs are missing; is N==1?
        assert_msg():     -  function returned error

reghdfe_standardize(): - function returned error FixedEffects::_partial_out(): - function returned error FixedEffects::partial_out(): - function returned error

: - function returned error Can you please shed some light on this case? Thank you.
sergiocorreia commented 4 years ago

Can you show me a minimum working example; perhaps something with toy data that I can replicate over here?

Thanks!

jczelaya commented 4 years ago

Thanks for your prompt reply Sergio! It worked with dummy data and this helped me identify a mistake in my code. Apologies for the misreported bug; I'm new to Stata (and Github).

Aimeeli847 commented 3 years ago

Hi sergio I try to use ivreghdfe.

my code is: ivreghdfe SD_Invest SD_CF (NCOMBANKER=CRISIS CRCF) lag_Q QCF Firm_size FSCF SD_board_size BSCF board_Indep BICF MBoTenure MBoTenCF,absorb(i.fyear##c.Cash_Flow i.ff_48##c.Cash_Flow) cluster(gvkey) first savefirst savefprefix(s1)

But received the follwing errors:

_assert_abort(): 3498 stdevs are missing; is N==1? assert_msg(): - function returned error reghdfe_standardize(): - function returned error FixedEffects::_partial_out(): - function returned error FixedEffects::partial_out(): - function returned error

: - function returned error r(3498); **Could you please teach me how to fix this error?**
sergiocorreia commented 3 years ago

Hi Aimee, I wouldn't know what's wrong without looking at the data. If you can share an example it would be very useful

Aimeeli847 commented 3 years ago

Thanks sergio.

This is my data link https://github.com/Aimeeli847/Aimeeli/blob/master/exercise1.dta

My code is: ivreghdfe SD_Invest SD_CF lag_Q QCF Firm_size FSCF SD_board_size BSCF board_Indep BICF MBoTenure MBoTenCF (NCOMBCF NCOMBANKER=CRISIS CRCF),absorb(fyear##c.Cash_Flow ff_48##c.Cash_Flow) cluster(gvkey) first savefirst savefprefix(s1)

My aim is to:

  1. use CRISIS CRCF to instrument NCOMBCF NCOMBANKER
  2. include fyear##c.Cash_Flow ff_48##c.Cash_Flow as fixed effects
  3. get a 2 stage 2SLS.

But I received errors like: _assert_abort(): 3498 stdevs are missing; is N==1? assert_msg(): - function returned error reghdfe_standardize(): - function returned error FixedEffects::_partial_out(): - function returned error FixedEffects::partial_out(): - function returned error

: - function returned error r(3498); could you help me figure out why? Thanks and regrads.
bztxb commented 3 years ago

I came across this problem when using command 'rifhdreg' in Stata16MP. However, I still cannot find the solution! Hope someone helps!

sergiocorreia commented 3 years ago

Can you explain me a bit what's that command? thanks

On Thu, Feb 25, 2021, 2:28 AM olijheojl015 notifications@github.com wrote:

I came across this problem when using command 'rifhdreg' in Stata16MP. However, I still cannot find the solution! Hope someone helps!

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/sergiocorreia/reghdfe/issues/207#issuecomment-785681925, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABUIKE5IYG2ALJDNM2CXELTAX3YTANCNFSM4NCQRBUQ .