Hi!
I want to reshape a dataset to long format, but I am unsure of how to do it. It appears like this when I import it from excel:
I know you do not like screenshots, but there are too many variables to show with dataex. But I want it in the format from another file that I have inserted here. (This is trade data with categories)

This is how I want it to end up looking. But how do I deal with the year variable?
The categories are just translated.
Thank you!
I want to reshape a dataset to long format, but I am unsure of how to do it. It appears like this when I import it from excel:
I know you do not like screenshots, but there are too many variables to show with dataex. But I want it in the format from another file that I have inserted here. (This is trade data with categories)
PHP Code:
[CODE]
* Example generated by -dataex-. To install: ssc install dataex
clear
input str13 A str25 B str6 C str7 D str9 E str7(F G H) str9(I J K L M N O P Q R S T U V)
This is how I want it to end up looking. But how do I deal with the year variable?
The categories are just translated.
PHP Code:
[CODE]
* Example generated by -dataex-. To install: ssc install dataex
clear
input str25(exporter category) int year double(ImportTons sum_total)
"Argentina" "frozen whole" 2008 . 0
"Argentina" "frozen whole" 2001 . 0
"Argentina" "frozen whole" 2009 . 0
"Argentina" "frozen whole" 2016 . 0
"Argentina" "frozen whole" 2017 . 0
"Argentina" "frozen whole" 1999 . 0
"Argentina" "frozen whole" 2005 . 0
"Argentina" "frozen whole" 2006 . 0
Comment