我想把数据从宽数据转为长数据,用reshape语句一直报错是为什么?求各位大佬帮助
variable id does not uniquely identify the observations
Your data are currently wide. You are performing a reshape long. You
specified i(i) and j(year). In the current wide form, variable i 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.
我的reshape语句报错(上)
key variables do not uniquely identify the observations
我的gather同样会有报错(上)
i a1 a2 a3
1 58.3 60.51 62.19
2 45.5 46.57 47.06
3 38.9 39.61 39.72
这是我的数据格式(上)