Hi,
I have two variables in my data - Date and jet fuel.
I need to extract the quarter and year out of Date variable in order to collapse the data on jetfuel prices.
The date variable is in int format, and "encode" command is not working. Furthermore, when I use the "tostring" command. I see that the Date is labelled. Can anyone tell me what I am missing here, and how to convert the monthly data into quarterly data. Thank you.
I have two variables in my data - Date and jet fuel.
I need to extract the quarter and year out of Date variable in order to collapse the data on jetfuel prices.
The date variable is in int format, and "encode" command is not working. Furthermore, when I use the "tostring" command. I see that the Date is labelled. Can anyone tell me what I am missing here, and how to convert the monthly data into quarterly data. Thank you.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input int Date double USGulfCoastKeroseneTypeJet 11062 .54 11092 .515 11123 .494 11153 .535 11184 .791 11215 1.012 11245 1.196 11276 .971 11306 .803 11337 .741 11368 .637 11396 .558 11427 .552 11457 .569 11488 .547 11518 .586 11549 .623 11580 .635 11610 .671 11641 .645 11671 .522 11702 .509 11733 .543 11762 .514 11793 .543 11823 .579 11854 .615 11884 .611 11915 .59 11946 .623 11976 .621 12007 .561 12037 .544 12068 .534 12099 .553 12127 .558 12158 .551 12188 .553 12219 .526 12249 .494 12280 .501 12311 .535 12341 .568 12372 .533 12402 .446 12433 .528 12464 .501 12492 .451 12523 .469 12553 .472 12584 .493 12614 .509 12645 .498 12676 .49 12706 .509 12737 .513 12767 .487 12798 .472 12829 .467 12857 .449 12888 .5 12918 .511 12949 .478 12979 .467 13010 .496 13041 .513 13071 .502 13102 .524 13132 .553 13163 .55 13194 .557 13223 .586 13254 .617 13284 .557 13315 .516 13345 .556 13376 .615 13407 .682 13437 .703 13468 .696 13498 .693 13529 .68 13560 .619 13588 .557 13619 .541 13649 .549 13680 .523 13710 .536 13741 .559 13772 .541 13802 .571 13833 .549 13863 .496 13894 .476 13925 .449 13953 .413 13984 .426 14014 .416 14045 .389 14075 .386 end format %td Date
Comment