Announcement

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

  • Drawing a map with the Population size variable

    Hello Stata users;

    I hope I could get some help with this.

    I do have this data at hand:
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input int ID float(x_centroid y_centroid) str21 alt_name_f str4 ref_tn_cod byte code_gouve str6 Nom_gouver float Population
     79 636384.9   4065126 "SOLIMAN"     ""      . ""        880
     80 650102.3   4074666 ""            ""      . ""          .
     81 684200.4   4088900 ""            ""      . ""          .
     82 680216.3   4082860 "KELIBIA"     ""      . ""       2000
     83 665135.9   4065032 ""            ""      . ""          .
     84 670452.8   4074543 "M. TEMIME"   ""      . ""       2000
     85 661669.3   4053786 "KORBA"       ""      . ""       2000
     86 658415.8   4043640 "B. KHIAR"    ""      . ""        925
     87 652314.5   4042953 "D. CHAABANE" ""      . ""       1250
     88 650455.3   4037900 "NABEUL"      ""      . ""       4000
     89 670731.5   4091291 ""            ""      . ""          .
    100 633880.6   4032543 "HAMMAMET"    ""      . ""       1030
    101 641337.9 4043444.5 ""            ""      . ""          .
    102 629273.3 4049610.5 "GROMBALIA"   ""      . ""         50
    103 645740.1   4054447 "B. KHALLED"  ""      . ""        532
    104 649132.5   4062233 "M. BOUZELFA" ""      . ""       2000
      1        .         . "SOLIMAN"     "1561" 15 "NABEUL"  880
      2        .         . ""            "1560" 15 "NABEUL"    .
      3        .         . ""            "1558" 15 "NABEUL"    .
      4        .         . "KELIBIA"     "1557" 15 "NABEUL" 2000
      5        .         . ""            "1556" 15 "NABEUL"    .
      6        .         . "M. TEMIME"   "1555" 15 "NABEUL" 2000
      7        .         . "KORBA"       "1554" 15 "NABEUL" 2000
      8        .         . "B. KHIAR"    "1553" 15 "NABEUL"  925
      9        .         . "D. CHAABANE" "1552" 15 "NABEUL" 1250
     10        .         . "NABEUL"      "1551" 15 "NABEUL" 4000
     11        .         . ""            "1559" 15 "NABEUL"    .
     12        .         . "HAMMAMET"    "1566" 15 "NABEUL" 1030
     13        .         . ""            "1565" 15 "NABEUL"    .
     14        .         . "GROMBALIA"   "1564" 15 "NABEUL"   50
     15        .         . "B. KHALLED"  "1563" 15 "NABEUL"  532
     16        .         . "M. BOUZELFA" "1562" 15 "NABEUL" 2000
    end
    As you can see, it is some mapping data for the Tunisian region of Nabeul. Not all districts' names are available, but, I only need those who are available for the study. I also have got the Population variable of those districts.

    I have also worked with this code before: spmap using nabcoord, id(ID) name(del_label2) label(x(x_centroid) y(y_centroid) l(alt_name_f))

    What I want to do know is draw the map of the region using spmap command, and the geographic variable of "Population", yet, I don't want to have the population size numbers on each centroid of district, more like, I have those represented by different circles sizes (like, 3 size categories for instance: from 0 to 2000 is a small size, from 2000 to 3999 is a medium size, and from 4000 is a big circle size).

    Any help please? I will be so greatful!

    I also put the nabcoord database here:
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input int _ID double(_X _Y)
    79                 .                  .
    79 643719.0097809344  4065397.985888253
    79   643507.66303756 4065479.6965779252
    79 643397.2683620898  4065549.166603131
    79 643266.8591972173 4065584.4226689884
    79  643165.910818537   4065571.13517296
    79 643090.8402049756 4065509.2653827732
    79 642994.7163943785 4065475.5641029812
    79  642902.356209338  4065537.318639985
    79 642792.2743505294  4065642.445729448
    79 642733.2080151092 4065640.5717118313
    79 642697.6157792456 4065627.4932455546
    79 642513.9500107938 4065581.6390932705
    79 642356.3488795573 4065583.4747648626
    79 642203.9075387175  4065597.872390695
    79 642152.7585418638  4065550.668900691
    79 642116.5492822969  4065467.159920128
    79 642058.6811337558  4065393.101186407
    79 641983.1368363592 4065359.7534369547
    79 641846.2879572674  4065297.757283308
    79 641783.6910777026 4065238.7697745776
    79 641711.4665546016  4065112.762865629
    79 641639.2190863058 4065096.4183209613
    79 641522.6767078146 4065105.1864829166
    79 641375.0216262788 4065154.4457128276
    79  641225.788193282 4065191.2081782166
    79  641140.414119743 4065210.2950268663
    79 641009.2500110933 4065237.5495898477
    79 640869.4723356834 4065135.4051512284
    79 640722.1991403885 4064998.3615325205
    79 640553.8461946638  4064945.667142505
    79 640399.4857267806  4064967.212233017
    79 640314.0485590802 4065045.1429494657
    79 640205.1240076906 4065244.8347275727
    79 640098.7059775137 4065400.8796562636
    79 639961.8989065951 4065499.3672041246
    79 639866.9853498009  4065554.875122868
    79 639808.8645415527 4065550.3513178253
    79 639743.2038170223 4065404.8721126434
    79 639631.6954327582 4065435.1430877554
    79 639542.6073341086  4065517.482412778
    79 639534.3109666264 4065586.8810175126
    79 639466.7889781356 4065659.2971726586
    79 639382.7777996637  4065585.508018123
    79 639490.6182495717 4065345.1406541853
    79  639313.811502373 4065226.3721011505
    79 639398.6227576805  4064995.981986067
    79  639532.059394414 4064842.9440929363
    79 639285.1383262319 4064689.9085228345
    79 639475.4246700619 4064492.2646432575
    79 639116.6214017167 4064188.3895169212
    79 638670.5399816964 4063816.8778492603
    79 638525.0971793868 4063684.1214421345
    79 638555.1356971075 4063626.6596420542
    79 638498.3415347021 4063282.1457331865
    79 638310.3537047509 4063208.7283352786
    79 638616.2357488623  4062677.552016537
    79 638942.8422944704 4062152.9027213585
    79 639323.1482910842 4061397.2342247176
    79 639030.9571147526 4061208.2200857336
    79  639127.528732935 4061023.4490795964
    79 639197.7740214833  4061051.511842774
    79 639273.5257636117 4060868.4679110716
    79  639318.057300887 4060815.3610519613
    79 639427.9401059857  4060835.781178719
    79  639452.119115724 4060755.4335411047
    79 639675.8574041356 4060297.3468453865
    79 639471.7131217169  4060190.485759427
    79  639584.909624557 4060008.0428940905
    79 639470.3972356005 4059888.1395932743
    79  639494.284565394  4059826.407951081
    79 639458.8826065317 4059701.5903800656
    79 639314.6527826259 4059618.4803051096
    79 639348.8225127276  4059563.129788127
    79 639200.5011220593 4059475.8161111237
    79 639096.8025178383  4059585.955295161
    79  638947.740557435 4059544.1867899965
    79 638822.2988268137 4059648.8053390314
    79 637673.1076439266  4058816.409009769
    79 638867.7499494086  4057998.982130794
    79 638894.4202016338  4057925.509187509
    79  638816.603183345  4057886.896589909
    79 638829.9321830035 4057836.1779053733
    79 638760.1239295822  4057794.299951742
    79 638707.8635510412 4057722.1347256396
    79 638617.1543645716  4057636.908502004
    79 638490.4113847228  4057530.716261295
    79 638390.1691878084 4057472.5036725663
    79 638319.9724771144 4057454.3926617373
    79 638197.3261911657  4057375.436147187
    79 638036.4915782078 4057267.5697261677
    79 638049.8166482439 4057216.8499825466
    79  638065.047853515  4057188.798414817
    79 638037.4881221701  4057135.145527478
    79 637985.8337142171 4057094.6985125006
    79 637960.2066267283  4057062.582594302
    79 637867.0305631284  4056988.644061727
    79 637975.3345233861 4056899.8142211125
    79 638078.5072649226 4056847.1451462125
    79 638303.2948341626 4056726.2395595964
    end

  • #2
    Any help please?

    Comment

    Working...
    X