Announcement

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

  • #16
    Chen Samulsion I have been redirected to this story previously as well. I might rename the command but let me do a bit more research on this.

    Sonnen Blume this error is very likely caused by the palettes and colrspace packages not being updated. Unfortunately Stata does not allow checking for versions of other packages yet!

    Update these:

    Code:
    ado update palettes
    ado update colrspace
    and see if they work.

    Comment


    • #17
      For alluvial, I will change the underlying code that checks for the number of categories. It might be linked to returned locals not existing in earlier Stata versions but I am checking for this.

      Comment


      • #18
        bimap v1.6 is now out on GitHub: https://github.com/asjadnaqvi/stata-bimap

        Major changes include:
        • Fully scalable color palettes.
        • Customizable bins.
        • Customizable colors.
        • Dynamic scalable legends.
        • Option for proper spacing of bins on legends.
        • Several defaults and checks added.
        • Several quality of life adjustments to make bimap easier to use.
        Twitter thread is here: https://twitter.com/AsjadNaqvi/statu...62037325217792
        More examples on GitHub. Up soon on SSC.
        Click image for larger version

Name:	bimap18.png
Views:	1
Size:	682.6 KB
ID:	1706138

        Last edited by Asjad Naqvi; 18 Mar 2023, 12:16.

        Comment


        • #19
          Two new packages are up:

          17) bumpline: A Stata package for bump line charts

          Click image for larger version

Name:	bumpline-1.png
Views:	1
Size:	543.5 KB
ID:	1709632


          18) bumparea: A Stata package for ribbon plots

          Click image for larger version

Name:	bumparea-1.png
Views:	1
Size:	489.1 KB
ID:	1709633



          + a several packages have been updated in the past months. See GitHub: https://github.com/asjadnaqvi for a comprehensive list.
          Last edited by Asjad Naqvi; 13 Apr 2023, 06:19.

          Comment


          • #20
            testing post bump

            Comment


            • #21
              Originally posted by Asjad Naqvi View Post
              Thanks to Kit Baum, the following updates are now available on SSC:

              spider v1.0
              schemepack v1.4
              streamplot v1.4
              joyplot v1.6
              arcplot v1.1
              bimap v1.5



              Just ssc install <packagename>, replace. See the links for updates.

              As always, a big thanks to the community for helping improve the functionality of dataviz packages in Stata. More coming soon...

              Hi Asjad,

              First of all a big thank you for the amazing packages that you have pushed through for STATA. It has been amazing! Also for your help with Sankey plots earlier. I was wondering if you could help me with your ‘bimap’.

              I want to plot educational/occupational mobility across Indian districts by social groups (1 “OBC” 2 “SC” 3 “ST” 4 “Muslims” 5 “Upper”). My education/occupational variable is continuous variable with values between 0 to 6. I have plotted them using your bimap (see attached) and I would like some help regarding the following –
              1. X cuts for the social groups. I want them to be 1,2,3,4,5 and if possible I want them to show OBC, SC, ST, Mus., Upp.
              2. If possible, I would like to move the legend to some other position than 3 O clock. For India map 5 O clock/7 O Clock works well if I need to combine two maps for example.
              Nick Cox Do you any suggestions as to how one can improve the graph?
              Click image for larger version

Name:	mob_geo_dom_edu_g2g3.png
Views:	1
Size:	497.4 KB
ID:	1718816

              The code that I use –

              Code:
                 
                        foreach gen in g1g2 g2g3 {
                           foreach group in edu ocp{
                           bimap  mob_up_`gen'_`group'_cat domgroup  using "${datafolder}/indcoord.dta",   palette(pinkgreen)    ///
                                         note("Upward mobility for `gen'") ///   
                                         cutx(1.01 2.01 3.01 4.01)   ///
                                         texty("`group'. mobility") textx("Social groups") texts(2.5) textlabs(3) values percent  ///
                                         ocolor(black) osize(0.2) ///
                                         polygon(data("indcoord") ocolor(black) osize(0.2))
                                                                    graph save "${graphfolder}/mob_geo_dom_`group'_`gen'.gph", replace
                                                                    graph export "${graphfolder}/mob_geo_dom_`group'_`gen'.png", wid(2500) replace
                           }
              }
              Data below

              Code:
              * Example generated by -dataex-. For more info, type help dataex
              clear
              input int(stateid distid) float(mob_up_g1g2_edu_cat mob_up_g2g3_edu_cat mob_up_g1g2_ocp_cat mob_up_g2g3_ocp_cat) str28 DISTRICT str24 ST_NM str3 censuscode int _ID byte _merge
              1  2 1.1935484 2.0430107  .16666667   .3655914 "Badgam"                    "Jammu & Kashmir"  "2"    32 3
              1  3 1.0377358 1.8867924   .3207547  .18867925 "Leh (ladakh)"              "Jammu & Kashmir"  "3"   339 3
              1  5  .8984375  2.921875      .9375    .328125 "Punch"                     "Jammu & Kashmir"  "5"   451 3
              1 12 2.0289855 2.0144928    .884058   .7681159 "Pulwama"                   "Jammu & Kashmir"  "12"  450 3
              1 13 2.2712767  1.601064  .48404256   .3244681 "Shupiyan"                  "Jammu & Kashmir"  "13"  522 3
              2  1 1.4333333  2.483333        .35   .6166667 "Chamba"                    "Himachal Pradesh" "23"  100 3
              2  2 2.1734104 2.2427745   .2716763  .25433525 "Kangra"                    "Himachal Pradesh" "24"  274 3
              2  4 1.5294118 1.8117647   .2117647   .5058824 "Kullu"                     "Himachal Pradesh" "26"  326 3
              2  5  1.867052 2.3583815   .4624277   .9017341 "Mandi"                     "Himachal Pradesh" "27"  363 3
              2  6  2.719512  2.097561   .5243902   .5365854 "Hamirpur"                  "Himachal Pradesh" "28"  216 3
              2  8  2.010101   2.79798  .17171717   .8585858 "Bilaspur"                  "Himachal Pradesh" "30"   87 3
              2  9     2.625 1.4166666        .25  .08333334 "Solan"                     "Himachal Pradesh" "31"  537 3
              2 10 2.1578948  1.968421  .16842106   .4631579 "Sirmaur"                   "Himachal Pradesh" "32"  530 3
              2 11  1.195652 2.6630435   .3369565   .3043478 "Shimla"                    "Himachal Pradesh" "33"  518 3
              3  1   2.02649 1.8145696   .6556292    .410596 "Gurdaspur"                 "Punjab"           "35"  212 3
              3  2  1.433735  1.626506   .7831326  .28915662 "Kapurthala"                "Punjab"           "36"  282 3
              3  3 1.5408163  1.877551  .29591838  .12244898 "Jalandhar"                 "Punjab"           "37"  243 3
              3  4 2.0595238  1.404762   .8095238   .2857143 "Hoshiarpur"                "Punjab"           "38"  230 3
              3  5 1.8205128  1.974359  .14102565  .14102565 "Shahid Bhagat Singh Nagar" "Punjab"           "39"  512 3
              3  6       1.5         2        .25          0 "Fatehgarh Sahib"           "Punjab"           "40"  183 3
              3  7 2.1333334      1.65   .6083333   .3916667 "Ludhiana"                  "Punjab"           "41"  346 3
              3  8         4        .4          0          0 "Moga"                      "Punjab"           "42"  376 3
              3  9    1.9375 1.8828125      .4375   .2734375 "Firozpur"                  "Punjab"           "43"  186 3
              3 10  2.137931 1.7931035   .8275862  .20689656 "Muktsar"                   "Punjab"           "44"  381 3
              3 11 1.6105263 2.2210526   .5824561  .29473683 "Faridkot"                  "Punjab"           "45"  180 3
              3 16  .9862069  2.696552   .3724138   .1586207 "Tarn Taran"                "Punjab"           "50"  559 3
              3 17 2.4411764  1.235294   .6764706  .05882353 "Rupnagar"                  "Punjab"           "51"  487 3
              4  0   2.71875   1.15625         .5     .09375 ""                          ""                 ""      . 1
              5  5  2.255319  1.574468   .3829787   .3829787 "Dehradun"                  "Uttarakhand"      "60"  140 3
              5  8 2.2307692  2.923077   .3076923   .9230769 "Bageshwar"                 "Uttarakhand"      "63"   34 3
              5  9 1.6744186 2.6976745   .3488372  .39534885 "Almora"                    "Uttarakhand"      "64"   12 3
              5 11 1.6461538  1.876923  .23076923   .4307692 "Nainital"                  "Uttarakhand"      "66"  394 3
              5 12  .7037037         3 .037037037   .3703704 "Udham Singh Nagar"         "Uttarakhand"      "67"  586 3
              5 13 1.2465754 1.5479453   .4246575  .20547946 "Hardwar"                   "Uttarakhand"      "68"  222 3
              6  1 .14814815  1.962963  .22222222 .074074075 "Panchkula"                 "Haryana"          "69"  428 3
              6  2 1.6013986 2.2237763   .6573427   .3216783 "Ambala"                    "Haryana"          "70"   14 3
              6  3  .3888889 1.5555556   .3333333  .05555556 "Yamunanagar"               "Haryana"          "71"  626 3
              6  4 1.6091954  2.666667   .6781609  .22988506 "Kurukshetra"               "Haryana"          "72"  329 3
              6  5         1       2.5        .35         .1 "Kaithal"                   "Haryana"          "73"  268 3
              6  6 1.7560976 2.4390244   .3170732  .29268292 "Karnal"                    "Haryana"          "74"  287 3
              6  8 1.9885057 1.8333334  .22413793  .22988506 "Sonipat"                   "Haryana"          "76"  541 3
              6  9 2.2222223 1.7901235   .3580247  .14814815 "Jind"                      "Haryana"          "77"  627 3
              6 10       .65      2.15       .275        .35 "Fatehabad"                 "Haryana"          "78"  182 3
              6 12 2.0144928  1.826087   .2753623  .28985506 "Hisar"                     "Haryana"          "80"  228 3
              6 13 2.0588236 2.2794118  .19117647  .14705883 "Bhiwani"                   "Haryana"          "81"   77 3
              6 17 1.9896908 1.4020618  .20618556   .3917526 "Rewari"                    "Haryana"          "85"  482 3
              6 18 1.6694915 1.6101695   .3898305   .1440678 "Gurgaon"                   "Haryana"          "86"  213 3
              6 19 1.6022727 2.0113637  .52272725   .4318182 "Mewat"                     "Haryana"          "87"  374 3
              7  1 2.1746032 1.2857143  .50793654  .14285715 "North West"                "NCT of Delhi"     "90"  419 3
              7  2 1.8636364 1.6363636         .5  .13636364 "North"                     "NCT of Delhi"     "91"  412 3
              7  3 2.1176472 2.0588236   .8823529   .4117647 "North East"                "NCT of Delhi"     "92"  416 3
              7  4  2.916667      1.25   .5833333        .25 "East"                      "NCT of Delhi"     "93"  166 3
              7  7      2.25     1.375        .45         .4 "West"                      "NCT of Delhi"     "96"  612 3
              7  8  3.421053 1.4210526   .4210526   .5263158 "South West"                "NCT of Delhi"     "97"  549 3
              7  9 2.3939395 1.6969697   .3030303  .27272728 "South"                     "NCT of Delhi"     "98"  543 3
              7 10  1.880597  1.355224   .4925373    .280597 ""                          ""                 ""      . 1
              7 11       1.7      1.45        .15       .325 ""                          ""                 ""      . 1
              7 12  2.064516 2.1935484  .48387095   .4193548 ""                          ""                 ""      . 1
              8  3  2.387097  .8064516  1.1612903  .22580644 "Bikaner"                   "Rajasthan"        "101"  85 3
              8  4 1.0769231 2.3589745   .0940171   .5555556 "Churu"                     "Rajasthan"        "102" 122 3
              8  5  1.765306  2.469388   .3265306  .19387755 "Jhunjhunun"                "Rajasthan"        "103" 261 3
              8  6 1.7454545 2.2363636         .2   .1909091 "Alwar"                     "Rajasthan"        "104"  13 3
              8  7  2.419643 1.8839285   .3928571   .3392857 "Bharatpur"                 "Rajasthan"        "105"  72 3
              8  8 1.7804878  2.402439   .2195122  .19512194 "Dhaulpur"                  "Rajasthan"        "106" 150 3
              8  9       1.5 2.0833333          1   .3333333 "Karauli"                   "Rajasthan"        "107" 629 3
              8 10 1.7692307  2.923077  .03846154  .23076923 "Sawai Madhopur"            "Rajasthan"        "108" 630 3
              8 11         2  2.142857          0   .2142857 "Dausa"                     "Rajasthan"        "109" 628 3
              8 12 2.0217392 1.2173913   .5869565   .4130435 "Jaipur"                    "Rajasthan"        "110" 240 3
              8 13 1.9694656  2.183206   .6717557  .29007635 "Sikar"                     "Rajasthan"        "111" 526 3
              8 14  1.631579 2.0350878  1.4035088  .57894737 "Nagaur"                    "Rajasthan"        "112" 392 3
              8 15 1.1160221 1.7403315   .3812155   .3038674 "Jodhpur"                   "Rajasthan"        "113" 262 3
              8 18 2.1052632         2   .4210526   .4736842 "Jalor"                     "Rajasthan"        "116" 247 3
              8 20 1.1900827 2.8099174   .3140496    .661157 "Pali"                      "Rajasthan"        "118" 425 3
              8 21 1.7714286       1.6          0  .17142858 "Ajmer"                     "Rajasthan"        "119"   6 3
              8 24 1.4117647  1.764706  .19607843  .27450982 "Bhilwara"                  "Rajasthan"        "122"  75 3
              8 25       1.2 2.9714286   .6857143   .6571429 "Rajsamand"                 "Rajasthan"        "123" 469 3
              8 26 1.2413793 1.8103448   .5862069  .20689656 "Dungarpur"                 "Rajasthan"        "124" 163 3
              8 29 1.8163265 1.5714285   .3877551  .24489796 "Kota"                      "Rajasthan"        "127" 320 3
              8 30 2.0384614 1.4615384         .5         .5 "Baran"                     "Rajasthan"        "128"  54 3
              8 31  1.967742  1.032258  .29032257   .1935484 "Jhalawar"                  "Rajasthan"        "129" 258 3
              8 32 1.2277228 1.6633663   .3069307   .2079208 "Udaipur"                   "Rajasthan"        "130" 583 3
              9  1  1.457143       1.8   .3571429  .27142859 "Saharanpur"                "Uttar Pradesh"    "132" 490 3
              9  2 2.3773584 2.3018868  .20754717   .3018868 "Muzaffarnagar"             "Uttar Pradesh"    "133" 386 3
              9  3         1  2.831579   .5473684  .49473685 "Bijnor"                    "Uttar Pradesh"    "134"  84 3
              9  4 1.2837838 1.8445946  .44594595   .3108108 "Moradabad"                 "Uttar Pradesh"    "135" 379 3
              9  5 1.6428572  2.357143   .3095238   .4285714 "Rampur"                    "Uttar Pradesh"    "136" 474 3
              9  6 1.8333334      1.25  .29166666   .7916667 "Jyotiba Phule Nagar"       "Uttar Pradesh"    "137" 265 3
              9  7 1.8709677  1.483871   .8064516   .6451613 "Meerut"                    "Uttar Pradesh"    "138" 373 3
              9  9 2.1538463  .9230769   .4615385   .4871795 "Ghaziabad"                 "Uttar Pradesh"    "140" 198 3
              9 10  2.452381 .54761904  1.2619047          0 "Gautam Buddha Nagar"       "Uttar Pradesh"    "141" 196 3
              9 13         2       2.2          0         .6 "Mahamaya Nagar"            "Uttar Pradesh"    "144" 224 3
              9 14       1.5 1.5694444   .2638889         .5 "Mathura"                   "Uttar Pradesh"    "145" 369 3
              9 15 1.5555556 1.8055556   .4166667   .2638889 "Agra"                      "Uttar Pradesh"    "146"   2 3
              9 19      1.95       .95        .55        .15 "Bareilly"                  "Uttar Pradesh"    "150"  56 3
              9 20       2.4         1        1.3        .35 "Pilibhit"                  "Uttar Pradesh"    "151" 443 3
              9 23  .9848485  2.060606   .1060606  .24242425 "Sitapur"                   "Uttar Pradesh"    "154" 534 3
              9 24 1.0119047 2.2738094   .0952381  .10714286 "Hardoi"                    "Uttar Pradesh"    "155" 221 3
              9 28 1.9166666      1.25  .30555555  .16666667 "Farrukhabad"               "Uttar Pradesh"    "159" 181 3
              9 29 1.0675676 1.7972972  .08108108  .35135135 "Kannauj"                   "Uttar Pradesh"    "160" 276 3
              9 30 1.5757576         2          0  .27272728 "Etawah"                    "Uttar Pradesh"    "161" 177 3
              end
              label values stateid STATEID
              label def STATEID 1 "Jammu & Kashmir 01", modify
              label def STATEID 2 "Himachal Pradesh 02", modify
              label def STATEID 3 "Punjab 03", modify
              label def STATEID 4 "Chandigarh 04", modify
              label def STATEID 5 "Uttarakhand 05", modify
              label def STATEID 6 "Haryana 06", modify
              label def STATEID 7 "Delhi 07", modify
              label def STATEID 8 "Rajasthan 08", modify
              label def STATEID 9 "Uttar Pradesh 09", modify
              label values _merge _merge
              label def _merge 1 "Master only (1)", modify
              label def _merge 3 "Matched (3)", modify

              Comment


              • #22
                I confess that I don't find these maps easy to interpret. It is unclear which variables are being shown in the one map you show and whether the blank areas are where values are missing or absent or that somehow fits into the scheme. I would usually start here with a scatter plot.

                Comment


                • #23
                  Originally posted by Nick Cox View Post
                  I confess that I don't find these maps easy to interpret. It is unclear which variables are being shown in the one map you show and whether the blank areas are where values are missing or absent or that somehow fits into the scheme. I would usually start here with a scatter plot.
                  Nick, I agree! Bivariate maps are difficult to interpret and might need some iterations and feedback to make it comprehensible. My goal here was to plot

                  1. which areas in India have higher educational mobility
                  2. Which social group do they belong to

                  The white areas are regions for which I do not have data. scatter as in the below?

                  Code:
                  tw scatter mobility domgroup

                  Comment


                  • #24
                    Anustup Kundu v1.8 of bimap (not yet sent to SSC) allows one to declare one or two variables as discrete/categorical. You can install the version from GitHub for now: https://github.com/asjadnaqvi/stata-bimap and check there for documentation as well.
                    Changes in legend position have been requested but I have yet to implement this. In the next version probably.

                    Code:
                    bimap share_hisp discx using county_shp2, palette(yellowblue) values count xdisc
                    generates:

                    bimap23_2.png







                    Comment


                    • #25
                      Originally posted by Asjad Naqvi View Post
                      Anustup Kundu v1.8 of bimap (not yet sent to SSC) allows one to declare one or two variables as discrete/categorical. You can install the version from GitHub for now: https://github.com/asjadnaqvi/stata-bimap and check there for documentation as well.
                      Changes in legend position have been requested but I have yet to implement this. In the next version probably.

                      Code:
                      bimap share_hisp discx using county_shp2, palette(yellowblue) values count xdisc
                      generates:

                      [ATTACH=CONFIG]n1718867[/ATTACH]






                      Thanks Asjad! If one can move the legend to a different location, that would be really helpful! I hope you push that in the next update.
                      Attached Files
                      Last edited by Anustup Kundu; 12 Jul 2023, 12:20.

                      Comment


                      • #26
                        Hi all,

                        Don't post here often but all the package have gone through major updates in the past year. A big thanks to the community for the engagements, suggestions, and feedback.

                        For those that missed this thread:

                        All packages can be installed from GitHub: https://github.com/asjadnaqvi or from SSC (ssc install <package>, replace).
                        Of course changes are first pushed to GitHub and then sent to SSC in a batch.

                        I post regularly about these on X/Twitter: https://twitter.com/AsjadNaqvi
                        And package-related issues are dealt with on GitHub or my dedicated Discord server (currently over 700+ members): https://discord.gg/qpHZtX6Xkk


                        Here is the current list of package updates:


                        #alluvial v1.3:
                        - Rewrite of basic routines to make it much faster.
                        - Many new options added

                        #bimap v1.81:
                        - Major feature enhancements.

                        #bumparea v1.21:
                        - Major bug fixes including better handing of categorical data.

                        #circlebar v1.31:
                        - Complete rewrite of base routines. Switch from Cartesian to Polar coordinates for smoother graphs. The current version of the package is very stable.

                        #circlepack v1.2:
                        - This package was lacking features relative to other hierarchical data packages. It went through major enhancements.

                        #joyplot v1.71:
                        - Several major bug fixes. New features added such as displaying peaks.

                        #marimekko v1.1:
                        - Additional options added to enhance functionality.

                        #sankey v1.71:
                        - One of the most used packages. Fixed errors occuring from certain boundary conditions, zeros, irregular from-to combinations.

                        #spider v1.3:
                        - Complete rewrite of the package
                        - Several options added to enchance functionality.

                        #streamplot v1.61:
                        - Added option to partion the graph in a North-South zone. Several new options added.

                        #sunburst v1.7:
                        - Complete rewrite of the package. Now allows full circles and is much much faster!
                        - Better label orientations.

                        #treemap v1.51:
                        - Several new options added. Fixed bugs related to certain data conditions. Major enhancement to how boxes are displayed.

                        Comment


                        • #27
                          Hi all,

                          Here is the May 2024 updates to packages that are all up on SSC:

                          alluvial v1.3: https://github.com/asjadnaqvi/stata-alluvial
                          arcplot 1.3: https://github.com/asjadnaqvi/stata-arcplot
                          bimap v1.82: https://github.com/asjadnaqvi/stata-bimap
                          bumparea v1.21: https://github.com/asjadnaqvi/stata-bumparea
                          circlebar v1.5: https://github.com/asjadnaqvi/stata-circlebar (now also mirrored as polarbar)
                          clipgeo v2.1: https://github.com/asjadnaqvi/stata-clipgeo
                          polarspike v1.0: https://github.com/asjadnaqvi/stata-polarspike (new package)
                          spider v1.31: https://github.com/asjadnaqvi/stata-spider
                          splinefit v1.1: https://github.com/asjadnaqvi/stata-splinefit (new package)
                          streamplot v1.81: https://github.com/asjadnaqvi/stata-streamplot
                          sunburst v1.7: https://github.com/asjadnaqvi/stata-sunburst
                          treemap v1.54: https://github.com/asjadnaqvi/stata-treemap
                          waffle v1.11: https://github.com/asjadnaqvi/stata-waffle


                          A big thanks to KitBaum for putting these all up! As always, test them out, report bugs, feature requests, etc on GitHub.



                          Comment


                          • #28
                            The following Stata dataviz packages now support label wrapping:

                            - bumparea (v1.31)
                            - bumpline (v1.21)
                            - sankey (v1.74)
                            - streamplot (v1.82)
                            - sunburst (v1.71)
                            - treemap (v1.55)

                            Install from GitHub (see links above). Please test them out before they are sent to SSC!

                            See the sankey example below with label wrapping. The feature will be rolled out across all the packages (where it makes sense). Some have already requested refinements to control for wrapping for different layers (e.g. in treemap). These will be added soon.





                            ODA_flows.png



                            Comment


                            • #29
                              incredible stuff, i will bookmark this for the future! thank you SO much!

                              Comment


                              • #30
                                New package release:

                                ternary: https://github.com/asjadnaqvi/stata-ternary


                                ternary_banner.png


                                Up soon on ssc!

                                Comment

                                Working...
                                X