Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Question about 'pvar' forecasting and r-squared

    Dear Statalist,

    I am building a panel database (yearly frequency) related to renewable energies production in several countries. This is an example of what it looks like (for the year 2014):

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input str23 country int year double(conven_GWh hydro_GWh wind_GWh solar_GWh PW_GWh)
    "Argentina"               2014    106887.6640625  33135.7    619.5    15.9 141560.46511627905
    "Australia"               2014     210412.296875    18421    10252  4857.5 247419.28999999998
    "Austria"                 2014  15165.2041015625  44836.2   3845.8   785.2       65109.104176
    "Azerbaijan"              2014   23138.900390625   1299.7    112.7     2.9            24727.7
    "Bangladesh"              2014     54634.3984375      993      5.1   212.4              55845
    "Belarus"                 2014             34482      121       11       2              34737
    "Belgium"                 2014     60458.3984375   1461.7     4614  2882.9              72672
    "Brazil"                  2014      158432.21875 373441.9  12210.4    61.3   590542.117779729
    "Bulgaria"                2014    40096.30078125   5162.6   1330.6  1252.5              47485
    "Canada"                  2014      229040.84375 382574.1    22538  2119.8  648631.7508488516
    "Chile"                   2014      43239.828125  23098.7   1442.9   489.7          73598.129
    "China"                   2014           4374041  1060100 158576.5 25514.1  5649583.000000001
    "Czech Republic"          2014      76831.796875   2960.7    476.5  2122.9            86003.4
    "Denmark"                 2014  14200.9306640625     15.1  13076.5   595.5 32181.730555555554
    "Ecuador"                 2014    12353.61328125  11457.9     79.7    16.5    24307.213342674
    "Egypt"                   2014            155474    13352     1332      42             170200
    "Finland"                 2014    41813.69921875    13397   1107.2     7.8              68084
    "France"                  2014       469878.1875    68627    17249  5913.3  561685.4816458916
    "Germany"                 2014      464484.59375  25443.9  57357.1 36056.5  626650.1017700001
    "Greece"                  2014             38297     4607     3689    3792              50474
    "Hungary"                 2014   26251.599609375    301.5    656.5      56              29392
    "India"                   2014       1066293.125 134193.1  33454.9    5076  1252028.109529148
    "Indonesia"               2014     196404.296875    15148      1.2    10.8             228489
    "Iran"                    2014     260319.796875  13865.8      358    18.9 274599.99999999994
    "Ireland"                 2014   19927.904296875    987.7   5140.1     1.1 26318.704845515826
    "Israel"                  2014     60385.6015625     23.1      8.9   774.3              61295
    "Italy"                   2014      159137.09375  60256.3  15178.3 22318.8           279828.5
    "Japan"                   2014        928397.125  87564.1   5190.5   26534  1062728.819620551
    "Kazakhstan"              2014     86288.1015625   8262.8     13.3     1.3            94567.4
    "Lithuania"               2014  2886.89990234375     1087      639      73             4396.9
    "Mexico"                  2014     250422.828125  38892.8   6426.2   220.7  303315.8327426527
    "Netherlands"             2014     91656.6015625    112.2   5797.3   784.8             103365
    "New Zealand"             2014    9142.091796875  24316.5   2214.1      17   43598.6916006103
    "Norway"                  2014 4040.199951171875   136183     2216    10.7             141967
    "Pakistan"                2014     71890.2890625    33201    459.3   241.1  107159.1866828133
    "Peru"                    2014    22656.19921875  22201.3    257.5   199.3            45549.8
    "Philippines"             2014    57451.49609375   9811.7    152.1    16.5          77260.997
    "Poland"                  2014     139216.203125   2733.8   7675.6     6.9             159058
    "Portugal"                2014      21234.828125  16411.9    12111   627.3  52802.12783900001
    "Romania"                 2014     36158.8984375  19279.1   6200.9    1616            63284.7
    "Russian Federation"      2014       884480.1875   175595        5     7.1 1058700.9000000001
    "Slovakia"                2014             21025     4462        6     597              27254
    "South_Africa"            2014            251134   3957.9   1056.9    1189             254663
    "South_Korea"             2014       524609.8125    14464   1169.5  2556.3         540378.799
    "Spain"                   2014      168480.03125    42971    52013   13673  278750.1245269591
    "Sweden"                  2014     67921.8984375  63871.4    11234      47             153662
    "Switzerland"             2014     34204.1953125    39701      101     842  74874.19354838714
    "Taiwan - Chinese Taipei" 2014      251652.46875   7439.1   1500.5   551.7 259975.06199999998
    "Thailand"                2014      151335.28125   6017.8    305.1  1564.3      173764.180391
    "Turkey"                  2014       199725.6875    40253     8520    20.1          251962.78
    "Ukraine"                 2014     172535.703125     9291   1171.5   482.5             182815
    "United_Kingdom"          2014       274303.3125   8775.9  31965.9  4039.8 338174.60774709244
    "United_States"           2014        3803829.75 281527.2 183891.8 24603.1 4363326.4072524905
    "Venezuela"               2014   23995.400390625    86322     88.3     5.3             110411
    end
    I am performing a Panel VAR analysis, because the objective is to forecast each of the variables in columns for the following 5-10 years for each country. For this, I am using the command 'pvar' (any other suggestions?). One of the results looks like the following:

    Code:
    pvar PW_GWh_2 conven_GWh_2 hydro_GWh_2 wind_GWh_2 solar_GWh_2
    
    Panel vector autoregresssion
    
    
    
    GMM Estimation
    
    Final GMM Criterion Q(b) =  1.04e-27
    Initial weight matrix: Identity
    GMM weight matrix:     Robust
                                                       No. of obs      =       542
                                                       No. of panels   =        54
                                                       Ave. no. of T   =    10.037
    
    
    ------------------------------------------------------------------------------
                 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    PW_GWh_2     |
        PW_GWh_2 |
             L1. |    3.06515   4.463189     0.69   0.492    -5.682539    11.81284
                 |
    conven_GWh_2 |
             L1. |  -1.765701   4.411304    -0.40   0.689     -10.4117    6.880296
                 |
     hydro_GWh_2 |
             L1. |  -3.286836   4.943308    -0.66   0.506    -12.97554     6.40187
                 |
      wind_GWh_2 |
             L1. |  -2.813435   5.188359    -0.54   0.588    -12.98243    7.355562
                 |
     solar_GWh_2 |
             L1. |  -.9791303   6.151945    -0.16   0.874    -13.03672    11.07846
    -------------+----------------------------------------------------------------
    conven_GWh_2 |
        PW_GWh_2 |
             L1. |   .3722461    4.69683     0.08   0.937    -8.833371    9.577863
                 |
    conven_GWh_2 |
             L1. |   .8286457   4.565836     0.18   0.856    -8.120228     9.77752
                 |
     hydro_GWh_2 |
             L1. |  -1.302162   5.524593    -0.24   0.814    -12.13017    9.525841
                 |
      wind_GWh_2 |
             L1. |  -1.033817   5.518745    -0.19   0.851    -11.85036    9.782725
                 |
     solar_GWh_2 |
             L1. |   1.667345   6.033538     0.28   0.782    -10.15817    13.49286
    -------------+----------------------------------------------------------------
    hydro_GWh_2  |
        PW_GWh_2 |
             L1. |  -.3210172   1.969008    -0.16   0.870    -4.180202    3.538167
                 |
    conven_GWh_2 |
             L1. |   .3673109   1.949041     0.19   0.851    -3.452739    4.187361
                 |
     hydro_GWh_2 |
             L1. |   1.231796   2.177828     0.57   0.572    -3.036668    5.500261
                 |
      wind_GWh_2 |
             L1. |   .3494463   2.218587     0.16   0.875    -3.998904    4.697796
                 |
     solar_GWh_2 |
             L1. |  -.0423122   2.786329    -0.02   0.988    -5.503416    5.418792
    -------------+----------------------------------------------------------------
    wind_GWh_2   |
        PW_GWh_2 |
             L1. |   2.451475    1.32013     1.86   0.063    -.1359313    5.038881
                 |
    conven_GWh_2 |
             L1. |  -2.394254   1.309703    -1.83   0.068    -4.961224    .1727166
                 |
     hydro_GWh_2 |
             L1. |  -2.689287   1.432047    -1.88   0.060    -5.496047     .117473
                 |
      wind_GWh_2 |
             L1. |   -1.72751   1.494309    -1.16   0.248    -4.656301    1.201281
                 |
     solar_GWh_2 |
             L1. |  -2.940695   1.842666    -1.60   0.111    -6.552255    .6708651
    -------------+----------------------------------------------------------------
    solar_GWh_2  |
        PW_GWh_2 |
             L1. |   -.437096    .254252    -1.72   0.086    -.9354207    .0612287
                 |
    conven_GWh_2 |
             L1. |   .4334507   .2500042     1.73   0.083    -.0565486    .9234499
                 |
     hydro_GWh_2 |
             L1. |   .4638522   .2837395     1.63   0.102    -.0922669    1.019971
                 |
      wind_GWh_2 |
             L1. |   .5768785   .2873042     2.01   0.045     .0137726    1.139984
                 |
     solar_GWh_2 |
             L1. |   1.484157    .337831     4.39   0.000     .8220208    2.146294
    ------------------------------------------------------------------------------
    Instruments : l(1/1).(PW_GWh_2 conven_GWh_2 hydro_GWh_2 wind_GWh_2 solar_GWh_2)
    My questions are the following:

    1.) How do I produce forecasts for the following years of the endogenous variables of the model for each country? (I have seen in the command's help file that it can produce Impulse-Response Functions (IRF) and Forecast Error Variance Decomposition (FEVD), but no simple forecasting).
    2.) Is there any criteria similar to the R-squared of Ordinary Least Squares (OLS) that can give me and idea of "how good is my model" for prediction? As it can be seen, the output of the command doesn't seem to produce anything similar.
    3.) Should I feed the command the endogenous variables in their stationary form, or is it ok if I input the variables in levels? I am given to understand that the command eliminates fixed effects and uses lags of the endogenous variables as instruments, but I am not sure.

    Thanks in advance.

    Best regards,


    Juan Hernandez

  • #2
    hi, is the anyone that can help me with this?

    Comment

    Working...
    X