Hello! I downloaded a panel database from the FAO but the thing is that it has all variables on a single column (value) instead of having an individual column for each variable. I need to reorganize it to for my research for the usual things, regressions, descriptive statistics, etc... I really appreciate any advise on how to do this.
Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input long commodity_code str28 commodity_description str30 country_name int market_year byte month int attribute_id str30 attribute_description double value
577400 "Almonds, Shelled Basis" "Afghanistan" 2010 10 20 "Beginning Stocks" 0
577400 "Almonds, Shelled Basis" "Afghanistan" 2010 10 125 "Domestic Consumption" 0
577400 "Almonds, Shelled Basis" "Afghanistan" 2010 10 176 "Ending Stocks" 0
577400 "Almonds, Shelled Basis" "Afghanistan" 2010 10 88 "Exports" 0
577400 "Almonds, Shelled Basis" "Afghanistan" 2010 10 57 "Imports" 0
577400 "Almonds, Shelled Basis" "Afghanistan" 2010 10 28 "Production" 0
577400 "Almonds, Shelled Basis" "Afghanistan" 2010 10 178 "Total Distribution" 0
577400 "Almonds, Shelled Basis" "Afghanistan" 2010 10 86 "Total Supply" 0
577400 "Almonds, Shelled Basis" "Algeria" 2001 10 20 "Beginning Stocks" 0
577400 "Almonds, Shelled Basis" "Algeria" 2001 10 125 "Domestic Consumption" 300
577400 "Almonds, Shelled Basis" "Algeria" 2001 10 176 "Ending Stocks" 0
577400 "Almonds, Shelled Basis" "Algeria" 2001 10 88 "Exports" 0
577400 "Almonds, Shelled Basis" "Algeria" 2001 10 57 "Imports" 300
577400 "Almonds, Shelled Basis" "Algeria" 2001 10 28 "Production" 0
577400 "Almonds, Shelled Basis" "Algeria" 2001 10 178 "Total Distribution" 300
577400 "Almonds, Shelled Basis" "Algeria" 2001 10 86 "Total Supply" 300
577400 "Almonds, Shelled Basis" "Algeria" 2002 10 20 "Beginning Stocks" 0
577400 "Almonds, Shelled Basis" "Algeria" 2002 10 125 "Domestic Consumption" 1200
577400 "Almonds, Shelled Basis" "Algeria" 2002 10 176 "Ending Stocks" 0
577400 "Almonds, Shelled Basis" "Algeria" 2002 10 88 "Exports" 0
577400 "Almonds, Shelled Basis" "Algeria" 2002 10 57 "Imports" 1200
577400 "Almonds, Shelled Basis" "Algeria" 2002 10 28 "Production" 0
577400 "Almonds, Shelled Basis" "Algeria" 2002 10 178 "Total Distribution" 1200
577400 "Almonds, Shelled Basis" "Algeria" 2002 10 86 "Total Supply" 1200
577400 "Almonds, Shelled Basis" "Algeria" 2003 10 20 "Beginning Stocks" 0
577400 "Almonds, Shelled Basis" "Algeria" 2003 10 125 "Domestic Consumption" 1600
577400 "Almonds, Shelled Basis" "Algeria" 2003 10 176 "Ending Stocks" 0
577400 "Almonds, Shelled Basis" "Algeria" 2003 10 88 "Exports" 0
577400 "Almonds, Shelled Basis" "Algeria" 2003 10 57 "Imports" 1600
577400 "Almonds, Shelled Basis" "Algeria" 2003 10 28 "Production" 0
577400 "Almonds, Shelled Basis" "Algeria" 2003 10 178 "Total Distribution" 1600
577400 "Almonds, Shelled Basis" "Algeria" 2003 10 86 "Total Supply" 1600
577400 "Almonds, Shelled Basis" "Algeria" 2004 8 20 "Beginning Stocks" 0
577400 "Almonds, Shelled Basis" "Algeria" 2004 8 125 "Domestic Consumption" 800
577400 "Almonds, Shelled Basis" "Algeria" 2004 8 176 "Ending Stocks" 0
577400 "Almonds, Shelled Basis" "Algeria" 2004 8 88 "Exports" 0
577400 "Almonds, Shelled Basis" "Algeria" 2004 8 57 "Imports" 800
577400 "Almonds, Shelled Basis" "Algeria" 2004 8 28 "Production" 0
577400 "Almonds, Shelled Basis" "Algeria" 2004 8 178 "Total Distribution" 800
577400 "Almonds, Shelled Basis" "Algeria" 2004 8 86 "Total Supply" 800
577400 "Almonds, Shelled Basis" "Algeria" 2005 8 20 "Beginning Stocks" 0
577400 "Almonds, Shelled Basis" "Algeria" 2005 8 125 "Domestic Consumption" 1600
577400 "Almonds, Shelled Basis" "Algeria" 2005 8 176 "Ending Stocks" 0
577400 "Almonds, Shelled Basis" "Algeria" 2005 8 88 "Exports" 0
577400 "Almonds, Shelled Basis" "Algeria" 2005 8 57 "Imports" 1600
577400 "Almonds, Shelled Basis" "Algeria" 2005 8 28 "Production" 0
577400 "Almonds, Shelled Basis" "Algeria" 2005 8 178 "Total Distribution" 1600
577400 "Almonds, Shelled Basis" "Algeria" 2005 8 86 "Total Supply" 1600
577400 "Almonds, Shelled Basis" "Algeria" 2006 10 20 "Beginning Stocks" 0
577400 "Almonds, Shelled Basis" "Algeria" 2006 10 125 "Domestic Consumption" 2200
577400 "Almonds, Shelled Basis" "Algeria" 2006 10 176 "Ending Stocks" 0
577400 "Almonds, Shelled Basis" "Algeria" 2006 10 88 "Exports" 0
577400 "Almonds, Shelled Basis" "Algeria" 2006 10 57 "Imports" 2200
577400 "Almonds, Shelled Basis" "Algeria" 2006 10 28 "Production" 0
577400 "Almonds, Shelled Basis" "Algeria" 2006 10 178 "Total Distribution" 2200
577400 "Almonds, Shelled Basis" "Algeria" 2006 10 86 "Total Supply" 2200
577400 "Almonds, Shelled Basis" "Algeria" 2007 10 20 "Beginning Stocks" 0
577400 "Almonds, Shelled Basis" "Algeria" 2007 10 125 "Domestic Consumption" 2800
577400 "Almonds, Shelled Basis" "Algeria" 2007 10 176 "Ending Stocks" 0
577400 "Almonds, Shelled Basis" "Algeria" 2007 10 88 "Exports" 0
577400 "Almonds, Shelled Basis" "Algeria" 2007 10 57 "Imports" 2800
577400 "Almonds, Shelled Basis" "Algeria" 2007 10 28 "Production" 0
577400 "Almonds, Shelled Basis" "Algeria" 2007 10 178 "Total Distribution" 2800
577400 "Almonds, Shelled Basis" "Algeria" 2007 10 86 "Total Supply" 2800
577400 "Almonds, Shelled Basis" "Algeria" 2008 10 20 "Beginning Stocks" 0
577400 "Almonds, Shelled Basis" "Algeria" 2008 10 125 "Domestic Consumption" 7600
577400 "Almonds, Shelled Basis" "Algeria" 2008 10 176 "Ending Stocks" 0
577400 "Almonds, Shelled Basis" "Algeria" 2008 10 88 "Exports" 0
577400 "Almonds, Shelled Basis" "Algeria" 2008 10 57 "Imports" 7600
577400 "Almonds, Shelled Basis" "Algeria" 2008 10 28 "Production" 0
577400 "Almonds, Shelled Basis" "Algeria" 2008 10 178 "Total Distribution" 7600
577400 "Almonds, Shelled Basis" "Algeria" 2008 10 86 "Total Supply" 7600
577400 "Almonds, Shelled Basis" "Algeria" 2009 10 20 "Beginning Stocks" 0
577400 "Almonds, Shelled Basis" "Algeria" 2009 10 125 "Domestic Consumption" 3800
577400 "Almonds, Shelled Basis" "Algeria" 2009 10 176 "Ending Stocks" 0
577400 "Almonds, Shelled Basis" "Algeria" 2009 10 88 "Exports" 0
577400 "Almonds, Shelled Basis" "Algeria" 2009 10 57 "Imports" 3800
577400 "Almonds, Shelled Basis" "Algeria" 2009 10 28 "Production" 0
577400 "Almonds, Shelled Basis" "Algeria" 2009 10 178 "Total Distribution" 3800
577400 "Almonds, Shelled Basis" "Algeria" 2009 10 86 "Total Supply" 3800
577400 "Almonds, Shelled Basis" "Algeria" 2010 10 20 "Beginning Stocks" 0
577400 "Almonds, Shelled Basis" "Algeria" 2010 10 125 "Domestic Consumption" 6600
577400 "Almonds, Shelled Basis" "Algeria" 2010 10 176 "Ending Stocks" 0
577400 "Almonds, Shelled Basis" "Algeria" 2010 10 88 "Exports" 0
577400 "Almonds, Shelled Basis" "Algeria" 2010 10 57 "Imports" 6600
577400 "Almonds, Shelled Basis" "Algeria" 2010 10 28 "Production" 0
577400 "Almonds, Shelled Basis" "Algeria" 2010 10 178 "Total Distribution" 6600
577400 "Almonds, Shelled Basis" "Algeria" 2010 10 86 "Total Supply" 6600
577400 "Almonds, Shelled Basis" "Algeria" 2011 10 20 "Beginning Stocks" 0
577400 "Almonds, Shelled Basis" "Algeria" 2011 10 125 "Domestic Consumption" 7500
577400 "Almonds, Shelled Basis" "Algeria" 2011 10 176 "Ending Stocks" 0
577400 "Almonds, Shelled Basis" "Algeria" 2011 10 88 "Exports" 0
577400 "Almonds, Shelled Basis" "Algeria" 2011 10 57 "Imports" 7500
577400 "Almonds, Shelled Basis" "Algeria" 2011 10 28 "Production" 0
577400 "Almonds, Shelled Basis" "Algeria" 2011 10 178 "Total Distribution" 7500
577400 "Almonds, Shelled Basis" "Algeria" 2011 10 86 "Total Supply" 7500
577400 "Almonds, Shelled Basis" "Algeria" 2012 10 20 "Beginning Stocks" 0
577400 "Almonds, Shelled Basis" "Algeria" 2012 10 125 "Domestic Consumption" 6700
577400 "Almonds, Shelled Basis" "Algeria" 2012 10 176 "Ending Stocks" 0
577400 "Almonds, Shelled Basis" "Algeria" 2012 10 88 "Exports" 0
end