Announcement

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

  • Help creating an index variable

    Hi all. I have a panel dataset from Brazilian states with information on the number of radio stations per state (n_radio_stations).

    What I need: n_radio_stations needs to be normalized by the area of the state (area_km2) to give the number of radio stations per square miles. Then this variable needs to be normalized by each state’s population (i_pop_total) to give the number of radio stations per unit of area per population.

    This variable will provide an index of the intensity of the radio infrastructure in each state. I’m confused about how to do this calculation. Can someone help?

    The aforementioned data follows below.

    ibge_uf_code = state’s ID


    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input int(year ibge_uf_code n_radio_stations) long area_km2 double i_pop_total
    1970 11   2  243044   111064
    1970 12   4  152589   215299
    1970 13   9 1558987   955203
    1970 14   1  230104    40885
    1970 15  12 1227530  2166998
    1970 16   4  139068   114230
    1970 17   .  286944   521139
    1970 21  10  324616  2992678
    1970 22   9  250934  1680573
    1970 23  26  146817  4361603
    1970 24  12   53015  1550184
    1970 25  11   56372  2382463
    1970 26  26   98306  5161866
    1970 27   9   27652  1588068
    1970 28   6   21994   900679
    1970 29  34  559921  7493437
    1970 31 121  582586 11485663
    1970 32  11   45597  1599324
    1970 33  34   43305  8994802
    1970 35 262  247320 17770975
    1970 41  98  199060  6929821
    1970 42  62   95495  2901660
    1970 43 123  267527  6664841
    1970 50   .  350548   998160
    1970 51  19  881001   598849
    1970 52  33  355092  2416890
    1970 53  10    5771   537492
    1974 11   3  243044   263048
    1974 12   7  152589   249690
    1974 13  12 1558987  1145333
    1974 14   1  230104    56179
    1974 15  13 1227530  2661598
    1974 16   4  139068   138641
    1974 17   .  286944   608303
    1974 21  10  324616  3394184
    1974 22   9  250934  1864022
    1974 23  24  146817  4732333
    1974 24  12   53015  1689644
    1974 25  11   56372  2537616
    1974 26  29   98306  5554521
    1974 27   9   27652  1746007
    1974 28   7   21994   996559
    1974 29  32  559921  8278219
    1974 31 125  582586 12243440
    1974 32  10   45597  1768930
    1974 33  63   43305  9913534
    1974 35 240  247320 20679415
    1974 41 103  199060  7209832
    1974 42  63   95495  3192313
    1974 43 125  267527  7108444
    1974 50   .  350548  1146804
    1974 51  19  881001   814877
    1974 52  33  355092  2698584
    1974 53  13    5771   793258
    1978 11   6  243044   415033
    1978 12   .  152589   284081
    1978 13  14 1558987  1335463
    1978 14   2  230104    71474
    1978 15  14 1227530  3156198
    1978 16   3  139068   163052
    1978 17   .  286944   695467
    1978 21  11  324616  3795691
    1978 22  10  250934  2047471
    1978 23  31  146817  5103064
    1978 24  13   53015  1829105
    1978 25  15   56372  2692769
    1978 26  30   98306  5947176
    1978 27  11   27652  1903946
    1978 28   8   21994  1092439
    1978 29  40  559921  9063001
    1978 31 134  582586 13001217
    1978 32  12   45597  1938535
    1978 33  72   43305 10832265
    1978 35 281  247320 23587854
    1978 41 137  199060  7489843
    1978 42  77   95495  3482966
    1978 43 149  267527  7552047
    1978 50   .  350548  1295447
    1978 51  30  881001  1030904
    1978 52  39  355092  2980278
    1978 53  10    5771  1049025
    1982 11  10  243044   607692
    1982 12   6  152589   322447
    1982 13  20 1558987  1552840
    1982 14   5  230104   104296
    1982 15  22 1227530  3684691
    1982 16   3  139068   196011
    1982 17   .  286944   771924
    1982 21  16  324616  4166227
    1982 22  15  250934  2219731
    1982 23  49  146817  5484469
    1982 24  15   53015  1992786
    1982 25  21   56372  2848667
    1982 26  41   98306  6322476
    1982 27  10   27742  2079494
    1982 28  10   21994  1204288
    1982 29  52  559951  9894046
    1982 31 155  582586 13809750
    1982 32  18   45597  2128298
    1982 33  88   43305 11567281
    end

  • #2
    Well, the gist of it is
    Code:
    gen index = n_radio_stations/(area_km2*i_pop_total)
    However, this is going to give you very small numbers, on the order of 10-11, because you have, in most instances, just a handful of stations in large, heavily populated areas. A variable like that, if used along with other variables that are more typical numbers, may cause numerical instability in estimation procedures. So I recommend scaling this up, multiplying it by 1012, so that it gives you the number of radio stations per million square kilometers per million people.

    Comment


    • #3
      Sure thing, Clyde. I'll scale this up. Thank you very much.

      Comment

      Working...
      X