Announcement

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

  • Draw a graph with four quadrants

    Hi all,
    I have a dataset with two variables: var 1 and var 2. I want to draw a graph with four quadrants. But I have no clue about how to implement this. I also want to label the ID and year for each 'data point' in these four quadrants. Can anyone help with this? Your help is greatly appreciated.
    I put the sample data here.
    Thanks.





    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input byte ID int Year double(var1 var2)
     1 1998  2377.18   .09785330295562744
     2 1998   1374.6    .0676569938659668
     3 1998  4256.01   .15019595623016357
     4 1998  1611.08    .5218113660812378
     5 1998  1262.54    .5156193971633911
     6 1998  3881.73    .2925686836242676
     7 1998  1577.05   .12172138690948486
     8 1998   2774.4    .8344798684120178
     9 1998  3801.09   .22149527072906494
    10 1998  7199.95   .14834284782409668
    11 1998  5052.62    .2657656669616699
    12 1998  2542.96   .12155508995056152
    13 1998  3159.91   .23158621788024902
    14 1998  1719.87    .4700554609298706
    15 1998  7021.35   .14327073097229004
    16 1998  4308.24    .0501326322555542
    17 1998  3114.02   .30460214614868164
    18 1998  3025.53   .07534289360046387
    19 1998  8530.88    .2870568037033081
    20 1998   1911.3                    0
    21 1998   442.13    .4663046598434448
    22 1998  1602.38   .17572557926177979
    23 1998  3474.09   .07208490371704102
    24 1998   858.39    .1928645372390747
    25 1998  1831.33    .3470877408981323
    26 1998     91.5   1.5729480981826782
    27 1998   1458.4    .5126906633377075
    28 1998   887.67   .08463215827941895
    29 1998   220.92   .13911104202270508
    30 1998   245.44   .30848944187164307
    31 1998  1106.95   .05909228324890137
     1 1999  2678.82    .6250052452087402
     2 1999  1500.95    .4026292562484741
     3 1999  4514.19  .010210037231445313
     4 1999   1667.1   .34574735164642334
     5 1999  1379.31   .06082737445831299
     6 1999  4171.69    .1430455446243286
     7 1999  1672.96   .19523406028747559
     8 1999   2866.3    .1690884828567505
     9 1999  4188.73    .3516949415206909
    10 1999  7697.82   .18496501445770264
    11 1999  5443.92   .19118833541870117
    12 1999  2712.34   .08275413513183594
    13 1999  3414.19   .16617918014526367
    14 1999  1853.65   .09702885150909424
    15 1999  7493.84   .13617205619812012
    16 1999  4517.94    .2490847110748291
    17 1999  3229.29    .1789151430130005
    18 1999  3214.54   .34137046337127686
    19 1999  9250.68    .1027991771697998
    20 1999  1971.41                    0
    21 1999   476.67   .21273291110992432
    22 1999   1663.2    .3716928958892822
    23 1999  3649.12   .10588157176971436
    24 1999    937.5    .5334000587463379
    25 1999  1899.82   .28854334354400635
    26 1999   105.98   1.5724766254425049
    27 1999  1592.64   .12260448932647705
    28 1999   956.32    .0100325345993042
    29 1999   239.38   .11700153350830078
    30 1999   264.58 .0028055906295776367
    31 1999  1163.17   .34888291358947754
     1 2000  3161.66   .11005377769470215
     2 2000  1701.88   .13719284534454346
     3 2000  5043.96  .010079741477966309
     4 2000  1845.72   .16006767749786377
     5 2000  1539.12   .01209723949432373
     6 2000  4669.06    .1826169490814209
     7 2000  1951.51   .14134180545806885
     8 2000   3151.4   .33797287940979004
     9 2000  4771.17   .08320772647857666
    10 2000  8553.69    .2008812427520752
    11 2000  6141.03  .012887954711914063
    12 2000  2902.09    .2909109592437744
    13 2000  3764.54   .20332825183868408
    14 2000  2003.07   .19261610507965088
    15 2000  8337.47    .3129082918167114
    16 2000  5052.99   .09491074085235596
    17 2000  3545.39    .1896113157272339
    18 2000  3551.49    .1464470624923706
    19 2000 10741.25                    0
    20 2000  2080.04   .21905720233917236
    21 2000   526.82  .045197486877441406
    22 2000     1791    .0385284423828125
    23 2000   3928.2   .18791067600250244
    24 2000  1029.92   .05734658241271973
    25 2000  2011.19   .29197776317596436
    26 2000    117.8    1.488024115562439
    27 2000     1804    .7009753584861755
    28 2000  1052.88    .0140228271484375
    29 2000   263.68    .2307593822479248
    30 2000   295.02  .036861419677734375
    31 2000  1363.56   .29206526279449463
     1 2001  3707.96                    0
     2 2001  1919.09    .2753676176071167
     3 2001  5516.76   .12923717498779297
     4 2001  2029.53   .11401700973510742
     5 2001  1713.81   .09728395938873291
     6 2001  5033.08   .04714000225067139
     7 2001  2120.35   .26403748989105225
    end




  • #2
    what do you mean by "quadrants" - there are no negative values in your data, so ...

    Comment


    • #3
      Welcome to the Stata Forum / Statalist,

      Thank you for having read the FAQ and used the code delimiters to provide data we can work on.

      Please check whether this is what you need:

      Code:
       scatter var1 var2, by(Year) mlabel(ID)
      Hopefully that helps.
      Best regards,

      Marcos

      Comment


      • #4
        Thank you.

        Comment

        Working...
        X