Dear all,
I have a dataset below, composed of the region, year, and value. Normally, when I make a connected graph, I have each region's value as an independent column, and the code is like this:
However, in my dataset below, I don't want to copy-paste and create new columns manually, instead, I want to automatically generate a connected graph, based on the data available below. Or is there a handy way of automatically generating new columns based on each region's value for specific years? (without copy-pasting)
Thank you so much,
Best,
------------------ copy up to and including the previous line ------------------
Listed 100 out of 114 observations
Use the count() option to list more
I have a dataset below, composed of the region, year, and value. Normally, when I make a connected graph, I have each region's value as an independent column, and the code is like this:
Code:
twoway (connected asia year)(connected Africa year)(connected europe year)
Thank you so much,
Best,
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str22 regions int year float percent "Africa" 2002 85.17632 "Africa" 2003 79.51936 "Africa" 2004 83.43472 "Africa" 2005 46.13064 "Africa" 2006 44.20268 "Africa" 2007 46.07319 "Africa" 2008 44.70668 "Africa" 2009 43.12626 "Africa" 2010 43.63366 "Africa" 2011 36.20064 "Africa" 2012 41.24461 "Africa" 2013 37.146824 "Africa" 2014 39.44272 "Africa" 2015 36.002865 "Africa" 2016 36.622124 "Africa" 2017 36.33076 "Africa" 2018 37.235317 "Africa" 2019 42.04245 "Africa" 2020 40.90646 "America" 2002 3.500117 "America" 2003 3.934545 "America" 2004 5.955437 "America" 2005 8.889876 "America" 2006 8.688569 "America" 2007 9.34407 "America" 2008 8.561049 "America" 2009 8.548162 "America" 2010 10.196347 "America" 2011 7.605177 "America" 2012 6.895785 "America" 2013 6.745145 "America" 2014 5.685211 "America" 2015 7.563207 "America" 2016 6.287817 "America" 2017 7.283136 "America" 2018 7.202162 "America" 2019 5.270456 "America" 2020 6.00174 "Asia (w/o Middle-East)" 2002 0 "Asia (w/o Middle-East)" 2003 1.4860897 "Asia (w/o Middle-East)" 2004 0 "Asia (w/o Middle-East)" 2005 12.642322 "Asia (w/o Middle-East)" 2006 12.319653 "Asia (w/o Middle-East)" 2007 11.189074 "Asia (w/o Middle-East)" 2008 12.417957 "Asia (w/o Middle-East)" 2009 12.358888 "Asia (w/o Middle-East)" 2010 12.593313 "Asia (w/o Middle-East)" 2011 11.73253 "Asia (w/o Middle-East)" 2012 9.272342 "Asia (w/o Middle-East)" 2013 9.475549 "Asia (w/o Middle-East)" 2014 8.578097 "Asia (w/o Middle-East)" 2015 11.97774 "Asia (w/o Middle-East)" 2016 11.692198 "Asia (w/o Middle-East)" 2017 12.285928 "Asia (w/o Middle-East)" 2018 12.449587 "Asia (w/o Middle-East)" 2019 10.721766 "Asia (w/o Middle-East)" 2020 11.89148 "Europe" 2002 . "Europe" 2003 1.2007693 "Europe" 2004 0 "Europe" 2005 12.30139 "Europe" 2006 13.46489 "Europe" 2007 12.825014 "Europe" 2008 13.91023 "Europe" 2009 17.804235 "Europe" 2010 15.739152 "Europe" 2011 31.67814 "Europe" 2012 30.99681 "Europe" 2013 31.76924 "Europe" 2014 31.45511 "Europe" 2015 28.392185 "Europe" 2016 29.45614 "Europe" 2017 26.051006 "Europe" 2018 22.60656 "Europe" 2019 21.57816 "Europe" 2020 23.611736 "Middle East" 2002 0 "Middle East" 2003 .59221643 "Middle East" 2004 0 "Middle East" 2005 5.858264 "Middle East" 2006 9.175097 "Middle East" 2007 7.451975 "Middle East" 2008 7.945778 "Middle East" 2009 6.374172 "Middle East" 2010 6.231583 "Middle East" 2011 4.4821134 "Middle East" 2012 4.335175 "Middle East" 2013 7.054042 "Middle East" 2014 6.882815 "Middle East" 2015 7.979837 "Middle East" 2016 8.19168 "Middle East" 2017 7.772645 "Middle East" 2018 8.790713 "Middle East" 2019 8.470904 "Middle East" 2020 7.209192 "Ocenia" 2002 0 "Ocenia" 2003 2.0340345 "Ocenia" 2004 2.4081006 "Ocenia" 2005 1.0007294 "Ocenia" 2006 .8274303 end
Listed 100 out of 114 observations
Use the count() option to list more
Comment