Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Regressions one bank per country over 15 years

    Hello, I have have a sample of banks in 68 countries over 15 years. The sample is dominated by US and German banks. In my robustness tests, I am trying to run the regressions with one bank per country over 15 years. Can you please advise on how I can run such a regression?

  • #2
    Assuming you want to select one bank at random from each country and use the same bank for all 15 years:

    Code:
    set seed 1234 // OR ANY OTHER RANDOM NUMBER SEED
    
    gen double shuffle = runiform()
    by country (shuffle), sort: gen byte to_use = _n == 1
    by country (to_use), sort: keep if bank == bank[_N]
    // NOW YOU CAN RUN YOUR REGRESSION
    Added: Actually, the above can be shortened to:

    Code:
    set seed 1234
    gen double shuffle = runiform()
    by country (shuffle), sort: keep if bank == bank[1]
    Last edited by Clyde Schechter; 23 Nov 2021, 08:49.

    Comment


    • #3
      Thank you, Clyde!

      Comment

      Working...
      X