0

I need to use this data in Stata, but I don't know how to format it into the right shape. It doesn't matter if I do it in Excel beforehand or after I transfer it to Stata.

My data is like

Country 2001 2002 2003
AFG     35    40   28
AGO     30    28   26

How do I change it to be

Country  Year  Press Freedom
AFG      2001    35
AFG      2002    40
AFG      2003    28
AGO      2001    30
AGO      2002    28
AGO      2003    26

Thanks

user8000
  • 5
  • 2
  • Use Power Query in Excel and unpivot... easy. Demonstrated [here](https://stackoverflow.com/a/27671495/9245853). – BigBen Feb 25 '22 at 20:38
  • 1
    In Stata this would be `reshape long`. The syntax would depend on the variable names for each year, as variable names can't start with numbers. – Nick Cox Feb 26 '22 at 13:04

0 Answers0