Hello,
I want to perform a panel data analysis of environmental degradation and economic growth.
I am trying to transform the PRIMAP-hist database (national emissions time series) from csv (wide format) to Stata (long format).
After import the csv data to Stata in wide format, I tried to reshape it by using the following code but I only got one column for all the observations:
I want to obtain a column for each "entity", but I do not know how to do perform that. I tried to use this code:
And I get this error
How can I obtain a regular panel data with this csv dataset? Sorry if this is a trivial question.
I want to perform a panel data analysis of environmental degradation and economic growth.
I am trying to transform the PRIMAP-hist database (national emissions time series) from csv (wide format) to Stata (long format).
After import the csv data to Stata in wide format, I tried to reshape it by using the following code but I only got one column for all the observations:
Code:
reshape long v, i(category country entity scenario unit) j(year)
I want to obtain a column for each "entity", but I do not know how to do perform that. I tried to use this code:
Code:
reshape long v entity, i(category country scenario unit) j(year)
Code:
variable id does not uniquely identify the observations
Your data are currently wide. You are performing a reshape long. You specified i(category country scenario unit) and j(year). In
the current wide form, variable category country scenario unit should uniquely identify the observations. Remember this picture:
long wide
+---------------+ +------------------+
| i j a b | | i a1 a2 b1 b2 |
|---------------| <--- reshape ---> |------------------|
| 1 1 1 2 | | 1 1 3 2 4 |
| 1 2 3 4 | | 2 5 7 6 8 |
| 2 1 5 6 | +------------------+
| 2 2 7 8 |
+---------------+
Type reshape error for a list of the problem observations.
r(9);
How can I obtain a regular panel data with this csv dataset? Sorry if this is a trivial question.

Comment