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
SEM Builder: Wrong modelHi, I am trying to run a first-order four-factor model in Stata 15 SEM Builder: Array However, the …
create a complex macroDear all, I want to get three models like this: logistic cancer var1 logistic cancer var2 logistic c…
How to conduct multiple impulation when all variables have missing values?Dear all, I am working with my resident survey data (n=8356) including 59 items, most of which are …
Strong Correlation of Variables in Spearmans'rho MatrixHello Just before doing a panel regression, I wanted to look at the correlation matrix for the desc…
The krls command and panel data regressionsHello Forum members, I have come across the krls command for Kernel-Based Regularized Least Squares…
Subscribe to:
Post Comments (Atom)
0 Response to European Health for All database (HFA-DB) PIVOT format
Post a Comment