Date | Crude Oil Production, Norway | Crude Oil Production, World | Global Real Economic Activity Based on Dry Bulk Cargo Bulk Freight Rates |
(Thousand Barrels per Day) | (Thousand Barrels per Day) | (Index deflated with US CPI and Linearly Detrended) | |
1980 January | 531.777 | 62348.011 | 3.49E+01 |
1980 February | 570.418 | 62715.757 | 4.03E+01 |
The date goes up to 2016 December.
Adding New Variables and Transforming them from monthly to quarterly data
The Excel Data Set that I inserted above contain three new variables that I would like to add into my VAR regression on top of what I have in Stata at the moment. However, the data that I just obtained is monthly data but I would like to add them along with my current variables (essentially merging my data) and transforming them into quarterly data by taking the average of the period (eg. average of jan to march).
List of Variables that is already in Stata
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str7 date double exc long rgdp double(unp inf op) "Q1 1980" 4.94676666566667 339021 1.5 7.74278215223094 35.58 "Q2 1980" 4.942499999 324697 1.4 10.2464332036316 35.45 "Q3 1980" 4.84123333233333 315430 2.1 12.291933418694 32.7066666666667 "Q4 1980" 5.026399999 343069 1.6 13.1147540983606 39.09 "Q1 1981" 5.350099999 339189 1.8 14.7381242387332 37.2933333333333 "Q2 1981" 5.68363333233333 331605 2 14 33.54 "Q3 1981" 6.08516666566667 326427 2.4 13.5689851767389 31.7966666666667 "Q4 1981" 5.83913333233333 346128 1.8 12.3745819397994 33.5233333333333 "Q1 1982" 5.95133333233333 339288 2 11.8895966029724 30.6733333333333 "Q2 1982" 6.077099999 330830 2.4 11.0423116615067 32.1066666666667 "Q3 1982" 6.641599999 327615 2.8 10.8433734939759 31.8066666666667 "Q4 1982" 7.146099999 348779 3.2 11.6071428571428 31.59 "Q1 1983" 7.10993333233333 345516 3.6 9.77229601518024 29.16 "Q2 1983" 7.16973333233333 347946 3.7 9.1078066914498 29.48 "Q3 1983" 7.40316666566667 341769 3.8 7.78985507246374 30.2966666666667 "Q4 1983" 7.50263333233333 364775 2.6 7.28888888888891 28.94 "Q1 1984" 7.68896666566667 368229 3.2 6.30942091616251 29.2333333333333 "Q2 1984" 7.74113333266667 360828 3.3 6.47359454855195 29.3133333333333 "Q3 1984" 8.36613333266667 368434 3.6 6.13445378151261 28.1466666666667 "Q4 1984" 8.84959999933333 387247 2.5 5.96520298260146 27.49 "Q1 1985" 9.36676666666667 391743 3 5.69105691056911 27.3666666666667 "Q2 1985" 8.893666666 377860 2.3 5.75999999999999 26.95 "Q3 1985" 8.342333333 385100 3.1 5.77988915281077 27.0933333333333 "Q4 1985" 7.78616666666667 412488 2 5.62939796716187 28.0733333333333 "Q1 1986" 7.3197 401783 2 5.76923076923076 17.16 "Q2 1986" 7.40296666666667 399497 1.9 6.05143721633889 12.4433333333333 "Q3 1986" 7.3868 399205 2.3 8.00898203592812 12.4433333333333 "Q4 1986" 7.4695 430057 1.7 8.80829015544041 14.64 "Q1 1987" 7.03546666666667 412198 2.4 9.96363636363637 17.7066666666667 "Q2 1987" 6.7112 413613 1.8 9.70042796005709 18.39 "Q3 1987" 6.7302 397776 2.2 7.90020790020794 18.94 "Q4 1987" 6.47293333333333 435545 1.9 7.41496598639454 17.7566666666667 "Q1 1988" 6.365 419283 2.5 7.07671957671957 15.7533333333333 "Q2 1988" 6.256 404907 2.9 7.02210663198959 16.09 "Q3 1988" 6.8359 401254 3.4 6.61528580603723 14.0866666666667 "Q4 1988" 6.61103333333333 429452 3.9 6.01646611779607 13.1466666666667 "Q1 1989" 6.72326666666667 408393 4.8 4.69425571340333 17.0233333333333 "Q2 1989" 7.00846666666667 417709 4.76666666666667 4.67800729040098 18.47 "Q3 1989" 7.0385 407719 5.03333333333333 4.51807228915663 17.41 "Q4 1989" 6.84776666666667 438257 4.93333333333333 4.30107526881723 18.72 "Q1 1990" 6.53356666666667 427717 5.66666666666667 4.36578171091446 19.4633333333333 "Q2 1990" 6.4893 416785 5.16666666666667 3.83052814857803 15.82 "Q3 1990" 6.154 412074 5.2 3.80403458213255 25.6566666666667 "Q4 1990" 5.8621 447813 4.83333333333333 4.524627720504 31 "Q1 1991" 5.9725 433742 5.6 3.90050876201245 19.85 "Q2 1991" 6.75420333333333 439794 5.23333333333333 3.80100614868644 18.33 "Q3 1991" 6.81336666666667 427301 5.46666666666667 3.49805663520268 19.4233333333333 "Q4 1991" 6.3917 456129 5.5 2.57534246575342 19.8666666666667 "Q1 1992" 6.35493333333333 457330 6.1 2.33949945593033 17.5066666666667 "Q2 1992" 6.3128 443666 5.96666666666667 2.4232633279483 19.6833333333333 "Q3 1992" 5.79393333333333 447403 6 2.30686695278971 19.9966666666667 "Q4 1992" 6.39633666666667 471367 5.63333333333333 2.24358974358973 18.9566666666667 "Q1 1993" 6.9538 457344 6.26666666666667 2.60499734183944 17.99 "Q2 1993" 6.84676666666667 451547 6.1 2.41850683491062 17.9933333333333 "Q3 1993" 7.25126666666667 458853 6.1 2.14997378080752 16.2 "Q4 1993" 7.32468333333333 503800 5.33333333333333 1.98537095088822 14.9633333333333 "Q1 1994" 7.44243666666667 482274 5.63333333333333 1.2435233160622 13.87 "Q2 1994" 7.20914333333333 486378 5.66666666666667 .975359342915802 16.27 "Q3 1994" 6.84432666666667 474431 5.36666666666667 1.54004106776183 17.05 "Q4 1994" 6.73443 523076 4.96666666666667 1.74180327868853 16.6033333333333 "Q1 1995" 6.52158333333333 508034 5.53333333333333 2.66120777891503 17.2233333333333 "Q2 1995" 6.23681333333333 492214 5.2 2.69445856634468 18.1766666666667 "Q3 1995" 6.30330666666667 505191 4.8 2.3255813953488 16.44 "Q4 1995" 6.27892333333333 542393 4.2 2.16515609264855 16.9766666666667 "Q1 1996" 6.41570333333333 536283 5 .897308075772663 18.3133333333333 "Q2 1996" 6.53549666666667 520406 5 .990099009900991 19.4866666666667 "Q3 1996" 6.41397 536030 4.76666666666667 1.38339920948619 20.63 "Q4 1996" 6.43406333333333 558078 4.23333333333333 1.77427304090683 23.0633333333333 "Q1 1997" 6.62962 548270 4.26666666666667 3.06324110671939 21.0833333333333 "Q2 1997" 7.07691666666667 566972 4.23333333333333 2.69607843137256 18.49 "Q3 1997" 7.46047666666667 552684 3.96666666666667 2.29044834307992 18.6566666666667 "Q4 1997" 7.12659 596533 3.2 2.22760290556901 18.84 "Q1 1998" 7.53980666666667 588947 3.3 2.15723873441995 14.1633333333333 "Q2 1998" 7.51393333333333 573271 3.46666666666667 2.2434367541766 13.28 "Q3 1998" 7.63745333333333 561890 3.1 2.28680323963794 13.0033333333333 "Q4 1998" 7.48919666666667 599781 2.5 2.32117479867363 11.85 "Q1 1999" 7.66309333333333 587707 2.8 2.25246363209761 11.6433333333333 "Q2 1999" 7.7982 574061 2.96666666666667 2.47432306255837 16.03 "Q3 1999" 7.8432 581940 3.2 2.04937121564973 20.4433333333333 "Q4 1999" 7.89219333333333 626967 3.16666666666667 2.68518518518515 23.8066666666667 "Q1 2000" 8.22004333333333 626590 3.4 2.89123451124368 26.6166666666667 "Q2 2000" 8.77797333333333 589911 3.2 2.91571753986331 26.7666666666667 "Q3 2000" 8.95455 594980 3.33333333333333 3.42309447740759 29.8833333333333 "Q4 2000" 9.2548 635181 3.03333333333333 3.11091073038775 29.67 "Q1 2001" 8.88969333333333 631517 3.33333333333333 3.52363960749332 26.07 "Q2 2001" 9.17891333333333 603358 3.36666666666667 3.93979637007527 26.7266666666667 "Q3 2001" 8.99699 609647 3.56666666666667 2.5595763459841 25.2133333333333 "Q4 2001" 8.90102 653161 3.36666666666667 2.0113686051596 19.3133333333333 "Q1 2002" 8.90953333333333 623584 3.73333333333333 1.0340370529944 20.9233333333333 "Q2 2002" 8.18353 636919 3.73333333333333 .468483816013621 25.2033333333333 "Q3 2002" 7.52372 612090 3.66666666666667 1.41996557659209 26.9366666666667 "Q4 2002" 7.318332 661001 3.53333333333333 2.22888984140592 26.7366666666667 "Q1 2003" 7.05690666666667 647009 3.96666666666667 4.60554371002131 31.3366666666667 "Q2 2003" 7.00835333333333 618078 4.33333333333333 2.24671470962272 26.4866666666667 "Q3 2003" 7.33666666666667 624952 4.43333333333333 1.90920661858297 28.3833333333333 "Q4 2003" 6.91894 666858 4.1 1.21593291404613 29.36 "Q1 2004" 6.90666666666667 676751 4.13333333333333 -1.42682429677945 32.13 "Q2 2004" 6.86 650667 4.33333333333333 .829187396351576 35.6266666666667 "Q3 2004" 6.86333333333333 638736 4.5 1.20732722731057 40.5533333333333 "Q4 2004" 6.33333333333333 691973 4.13333333333333 1.24275062137531 42.73 end
Thank you.
0 Response to Uploading new data sets
Post a Comment