Code:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input int price byte foreign float t 4425 0 1 5788 0 2 8814 0 3 4082 0 4 6165 0 5 4647 0 6 13594 0 7 6850 1 1 5397 1 2 3995 1 3 end
Code:
. reshape wide price, i(t) j(foreign)
(note: j = 0 1)
Data long -> wide
-----------------------------------------------------------------------------
Number of obs. 10 -> 7
Number of variables 3 -> 3
j variable (2 values) foreign -> (dropped)
xij variables:
price -> price0 price1
-----------------------------------------------------------------------------
. list, sep(0)
+---------------------+
| t price0 price1 |
|---------------------|
1. | 1 4,425 6,850 |
2. | 2 5,788 5,397 |
3. | 3 8,814 3,995 |
4. | 4 4,082 . |
5. | 5 6,165 . |
6. | 6 4,647 . |
7. | 7 13,594 . |
+---------------------+
0 Response to -reshape- is doing something weird, when I go wide, and then back to long, I do not end up with the same dataset.
Post a Comment