Announcement

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

  • Problem on "statsby" function

    Dear all,

    I am doing a banking competition analysis of EU28 countries with the data for the year 2011-2016. The dataset is unbalanced. I have to calculate a few competition measures by running a Stochastic Frontier Analysis and few fixed effect regression for each country and year.

    Then I would like to save the results of coefficients for each country and year. I have tried the following command but what I get is just a dataset with all missing data. Can anyone suggest how can I do it properly? I have run the following command for two of the measures:


    1. Boone indicator
    Code:
    statsby bi=_b[lac], by(year country) clear nodots: xtreg roa lac leqast lta lloanast ldeptf, fe
    2. H-statistic
    Code:
    statsby _b[lp1] _b[lp2] _b[lp3], by(year country) clear nodots : xtreg ltrta lp1 lp2 lp3 leqast lta lloanast ldeptf, fe
    Also, how can I save down vit of the error term from Stochastic Frontiere Analysis?

    Many thanks,
    Cedric
    Last edited by Cedric Hung; 20 Aug 2018, 10:38.

  • #2
    You're asking for a separate xtreg for each country-year combination. Each such combination defines a single observation in the data if it's been xtset. You can't fit a model with several predictors to a single observation. So the syntax is legal, but the request makes no statistical or economic sense and the result is inevitable.

    Code:
     xtreg roa lac leqast lta lloanast ldeptf, fe
    may make sense by itself (it seems that you have at most 28 x 6 observations to play with). A regression for each country is likely to be out of the question; you don't have enough data.

    (NB: statsby is a command, not a function.)

    Sorry, but I don't know anything much about stochastic frontier analysis.

    Comment


    • #3
      Dear Nick,

      Thanks for the response. Here is the table showing the numbers of observations I have for each country:
      Country Freq. Percent Cum.
      Austria 2,367 35 35
      Belgium 115 1.7 36.71
      Bulgaria 89 1.32 38.02
      Croatia 141 2.09 40.11
      Cyprus 103 1.52 41.63
      Czech 84 1.24 42.87
      Denmark 283 4.19 47.06
      Estonia 30 0.44 47.5
      Finland 102 1.51 49.01
      France 502 7.42 56.43
      Greece 37 0.55 56.98
      Hungary 84 1.24 58.22
      Ireland 29 0.43 58.65
      Italy 514 7.6 66.25
      Latvia 61 0.9 67.15
      Lithuania 38 0.56 67.72
      Luxembourg 267 3.95 71.67
      Malta 42 0.62 72.29
      Netherlands 122 1.8 74.09
      Poland 273 4.04 78.13
      Portugal 326 4.82 82.95
      Romania 99 1.46 84.41
      Slovakia 54 0.8 85.21
      Slovenia 44 0.65 85.86
      Spain 222 3.28 89.15
      Sweden 318 4.7 93.85
      United Kingdom 416 6.15 100
      Total 6,762 100
      year
      Country 2011 2012 2013 2014 2015 2016 Total
      Austria 368 368 434 368 420 409 2,367
      Belgium 13 15 20 20 23 24 115
      Bulgaria 9 9 18 18 18 17 89
      Croatia 19 19 26 26 26 25 141
      Cyprus 4 4 13 26 27 29 103
      Czech 6 6 18 18 18 18 84
      Denmark 32 31 53 53 57 57 283
      Estonia 2 2 6 6 7 7 30
      Finland 3 3 15 24 32 25 102
      France 27 29 104 114 115 113 502
      Greece 6 6 7 6 6 6 37
      Hungary 6 6 18 18 18 18 84
      Ireland 3 3 6 6 5 6 29
      Italy 74 76 87 92 91 94 514
      Latvia 1 1 15 15 14 15 61
      Lithuania 5 5 8 8 6 6 38
      Luxembourg 25 27 54 57 54 50 267
      Malta 4 4 8 9 9 8 42
      Netherlands 13 14 23 24 25 23 122
      Poland 16 18 50 55 61 73 273
      Portugal 4 4 20 95 99 104 326
      Romania 8 8 19 21 21 22 99
      Slovakia 6 6 11 11 11 9 54
      Slovenia 7 7 7 8 7 8 44
      Spain 12 13 48 50 50 49 222
      Sweden 7 7 71 75 78 80 318
      United Kingdom 30 30 83 89 93 91 416
      Total 710 721 1,242 1,312 1,391 1,386 6,762
      .

      cannot be run which I only get a dataset of all missing data when I use the "statsby" to save the coefficients?


      Many thanks,
      Cedric
      Last edited by Cedric Hung; 20 Aug 2018, 10:42.

      Comment


      • #4
        So, you have multiple observations for each year for many countries, but by no means all. What then was your xtset command?

        Comment

        Working...
        X