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
Related Posts with European Health for All database (HFA-DB) PIVOT format
Using hyphens in varlists for duplicatesI'm using Stata 14.2 and was trying to use the duplicates command, when I experienced some strange b…
Exporting Variables to ExcelHi! I have created a few variables that I'd like to export to an excel file. I have variables rf1 th…
Levels of variables "dropped because of estimability" when running a nested regressionWhen I run a nested regression, I'm getting the following notes: note: 1.deprivationquintile dropped…
Duplicating time observations in panel data in stataHello Stata community, I am looking to duplicate the time observations in a panel data 17 times, wh…
Stata doesn't read local macroHi, I am trying to use macros to avoid repeating long lists of variables. The problem is that Stata …
Subscribe to:
Post Comments (Atom)
0 Response to European Health for All database (HFA-DB) PIVOT format
Post a Comment