Fellow Stata users!
I want to explore and analyse the WHO- European Health for All database (HFA-DB) Available: https://gateway.euro.who.int/en/datasets/
However, the dataset is only dowloadable in pivot table format and I have never worked with pivot table format in Stata. Hence, I am at the moment a bit confused how to approach this. I would like to transform the whole dataset into wide (or long) format, two formats I am very familiar with.
But for some, perhaps trivial, issues I am right now not able to wrap my head around these.
I have loaded the csv. file into Stata, with first row as variable names, comma as separator, etc. Still it looks very wrong!
So far i executed the commands:
drop if COUNTRY_REGION==""
contract SEX Measurecode COUNTRY_REGION v*, freq(sum_)
reshape wide sum_, i(Measurecode) j(COUNTRY_REGION) string
But, I always get the error code: "values of variable COUNTRY_REGION not unique within Measurecode"!
The dataset looks like below with v4 going on until v152 (however some v* have no observations) and Measurecode going on til HFA_193. Sex exists as ALL, MALE and FEMALE.
Measurecode SEX COUNTRY_REGION v4....
HFA_1 ALL ALB
HFA_1 ALL AND
HFA_1 ALL ARM
.
.
.
As far as I understand HFA_* are the respective WHO-indicators/measures (variables). v1 til v74 are the values for the "years", with v74 being labeled "2020".
I would appreciate any working solution!
If you need more information, please do not hesitate to just ask in a comment.
Best,
Tom
0 Response to European Health for All database (HFA-DB) PIVOT format
Post a Comment