I would like to transpose the following dataset, in a way that I change the format from long to wide (output with 3 variables: date, SP500_w and VIX_w). I would like to have dates recognized as Stata daily dates.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str8 DATATYPE double(__7_8_2020 __7_1_2020 _6_24_2020 _6_17_2020 _6_10_2020 __6_3_2020 _5_27_2020 _5_20_2020 _5_13_2020) "SP500_w" 6496.14 6383.76 6247.66 6375.54 6529.42 6389.67 6209.38 6075.76 5761.7 "VIX_w" 28.08 28.62 33.84 33.47 27.57 25.66 27.62 27.99 35.28 end
0 Response to Transpose dataset with variable dates
Post a Comment