Dear friends,
I have a wide format of time-series data, and I want to change it to a long format. I tried it by running the "reshape" command. The columns are years, and the values are export values. When I run the code below, I got an error.
My data (shortened):
My code:
reshape long B2000 B2001 B2002 B2003 B2004 B2005 B2006 B2007 B2008 B2009 B2010 B2011 B2012 B2013 B2014 B2015 B2016 B2017 B2018 B2019 , i(partnername) j(year)
Error:
no xij variables found
You typed something like reshape wide a b, i(i) j(j).
What I want to do (shortened):
Afghanistan 2000 Value1
Afghanistan 2001 Value2
Afghanistan 2002 Value3
.
.
.
.
Thank you so much,
I have a wide format of time-series data, and I want to change it to a long format. I tried it by running the "reshape" command. The columns are years, and the values are export values. When I run the code below, I got an error.
My data (shortened):
| partnername | B2000 | B2001 | B2002 | B2003 |
| Afghanistan | 8053.165 | 6982.9 | 20231.7 | 36489 |
| Albania | 61271.75 | 73205 | 78789.3 | 114426 |
| Algeria | 376302.1 | 421964 | 510837 | 573002 |
| American Samoa | 5.213 | 653.5 | ||
| Andorra | 59.443 | 6.783 | 167.42 | |
| Angola | 4808.63 | 8364.3 | 10951.1 | 13890 |
My code:
reshape long B2000 B2001 B2002 B2003 B2004 B2005 B2006 B2007 B2008 B2009 B2010 B2011 B2012 B2013 B2014 B2015 B2016 B2017 B2018 B2019 , i(partnername) j(year)
Error:
no xij variables found
You typed something like reshape wide a b, i(i) j(j).
What I want to do (shortened):
Afghanistan 2000 Value1
Afghanistan 2001 Value2
Afghanistan 2002 Value3
.
.
.
.
Thank you so much,

Comment