Hello everyone,
I have the following data:
clear
input str5 id year str5 varname data
A 1960 GDP 10
A 1990 GDP 20
A 2021 GDP 30
A 1960 Pop 40
A 1990 pop 50
A 2021 pop 60
end
list, sepby(id)
And I wonder how I can make it look like this:
clear
input str5 id year GDP pop
A 1960 10 40
A 1990 20 50
A 2021 30 60
end
I tried several things that however didn't work. Any thoughts?
Many thanks!
I have the following data:
clear
input str5 id year str5 varname data
A 1960 GDP 10
A 1990 GDP 20
A 2021 GDP 30
A 1960 Pop 40
A 1990 pop 50
A 2021 pop 60
end
list, sepby(id)
And I wonder how I can make it look like this:
clear
input str5 id year GDP pop
A 1960 10 40
A 1990 20 50
A 2021 30 60
end
I tried several things that however didn't work. Any thoughts?
Many thanks!

Comment