Announcement

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

  • how to get the residuals for xtpmg command

    Hi, do anyone know how to produce the residual from the xtpmg command? It doesn't support by the predict command, so I'm quite confuss now.
    Here is my command for the xtpmg:
    Code:
    xtpmg d.Stock d.L(1/8).Stock d.L(1/7).IR d.L(1/7).M2 d.L(1/12).CPI, lr(l.Stock l.M2 l.IR l.CPI) ec(ec) replace pmg
    The total unit for my panel data is 4, and T is equal to 180, so the total observation is 720.
    After run the xtpmg, it drops from 720 to 668

  • #2
    Please provide a data sample using the dataex command. Also, as you are asked to specify in the Statalist FAQ, xtpmg is a community-contributed command available from the Stata Journal.

    Comment


    • #3
      Here is the data sample:
      Code:
      * Example generated by -dataex-. For more info, type help dataex
      clear
      input float ym double(CPI M2 IR) byte Stock_name double Stock
      600 217.488   8478 .11 1 1123.5821052631575
      601 217.281 8527.6 .13 1  1089.161052631579
      602 217.353 8523.7 .16 1 1152.0491304347827
      603 217.403 8555.1  .2 1 1197.3171428571427
      604  217.29 8609.3  .2 1           1125.064
      605 217.199 8628.4 .18 1 1083.3613636363639
      606 217.605 8639.8 .18 1  1079.802857142857
      607 217.923 8688.2 .19 1 1087.2827272727272
      608 218.275 8718.9 .19 1 1122.0819047619048
      609 219.035 8768.7 .19 1 1171.5842857142854
      610  219.59 8789.3 .19 1 1198.8890476190475
      611 220.472 8822.9 .18 1 1241.5254545454545
      612 221.187 8845.2 .17 1          1282.6185
      613 221.898   8909 .16 1 1321.1184210526317
      614 223.046   8967 .14 1 1304.4865217391302
      615 224.093 9030.4  .1 1          1331.5055
      616 224.806 9102.7 .09 1 1338.3109523809521
      617 224.806 9176.7 .09 1 1287.2886363636362
      618 225.395 9338.7 .07 1           1325.185
      619 226.106 9525.1  .1 1 1185.3060869565215
      620 226.597 9545.3 .08 1  1173.879047619048
      621  226.75 9578.1 .07 1 1207.2166666666667
      622 227.169 9629.8 .08 1 1226.4152380952382
      623 227.223 9677.4 .07 1 1243.3238095238096
      600 217.488   8478 .11 2 10471.235263157896
      601 217.281 8527.6 .13 2 10214.506315789475
      602 217.353 8523.7 .16 2 10677.518695652176
      603 217.403 8555.1  .2 2 11052.147619047619
      604  217.29 8609.3  .2 2         10500.1915
      605 217.199 8628.4 .18 2 10159.267272727271
      606 217.605 8639.8 .18 2 10222.242380952379
      607 217.923 8688.2 .19 2 10350.396363636364
      608 218.275 8718.9 .19 2 10598.066190476193
      609 219.035 8768.7 .19 2 11044.485238095236
      610  219.59 8789.3 .19 2 11198.312857142855
      611 220.472 8822.9 .18 2 11465.257272727273
      612 221.187 8845.2 .17 2 11802.370499999999
      613 221.898   8909 .16 2 12190.000526315791
      614 223.046   8967 .14 2 12081.476521739129
      615 224.093 9030.4  .1 2         12434.8765
      616 224.806 9102.7 .09 2 12579.992857142855
      617 224.806 9176.7 .09 2 12097.309545454546
      618 225.395 9338.7 .07 2 12512.325499999997
      619 226.106 9525.1  .1 2 11326.617826086956
      620 226.597 9545.3 .08 2 11175.453809523811
      621  226.75 9578.1 .07 2 11515.930952380952
      622 227.169 9629.8 .08 2 11804.332857142857
      623 227.223 9677.4 .07 2 12075.682857142858
      600 217.488   8478 .11 3  1850.219473684211
      601 217.281 8527.6 .13 3 1784.7347368421051
      602 217.353 8523.7 .16 3 1920.6160869565217
      603 217.403 8555.1  .2 3 2010.9599999999998
      604  217.29 8609.3  .2 3 1892.7329999999997
      605 217.199 8628.4 .18 3 1847.1754545454542
      606 217.605 8639.8 .18 3  1827.204761904762
      607 217.923 8688.2 .19 3 1839.0745454545452
      608 218.275 8718.9 .19 3 1939.8833333333334
      609 219.035 8768.7 .19 3  2066.017142857143
      610  219.59 8789.3 .19 3  2148.408095238095
      611 220.472 8822.9 .18 3 2211.4118181818185
      612 221.187 8845.2 .17 3           2291.243
      613 221.898   8909 .16 3  2353.392631578947
      614 223.046   8967 .14 3  2298.651739130434
      615 224.093 9030.4  .1 3           2344.074
      616 224.806 9102.7 .09 3  2364.605714285714
      617 224.806 9176.7 .09 3 2255.0731818181816
      618 225.395 9338.7 .07 3 2379.4484999999995
      619 226.106 9525.1  .1 3  2173.812608695652
      620 226.597 9545.3 .08 3 2224.4728571428577
      621  226.75 9578.1 .07 3  2298.661904761905
      622 227.169 9629.8 .08 3 2291.7804761904763
      623 227.223 9677.4 .07 3   2279.22380952381
      600 217.488   8478 .11 4  631.7558421052631
      601 217.281 8527.6 .13 4  613.8766842105263
      602 217.353 8523.7 .16 4  672.9330869565217
      603 217.403 8555.1  .2 4  715.7482380952382
      604  217.29 8609.3  .2 4          678.47605
      605 217.199 8628.4 .18 4  643.7044090909093
      606 217.605 8639.8 .18 4  629.5373333333333
      607 217.923 8688.2 .19 4  625.1625454545456
      608 218.275 8718.9 .19 4   652.248476190476
      609 219.035 8768.7 .19 4  696.9850952380953
      610  219.59 8789.3 .19 4  723.7533333333332
      611 220.472 8822.9 .18 4  775.0252727272727
      612 221.187 8845.2 .17 4  790.2706999999999
      613 221.898   8909 .16 4  813.9584736842107
      614 223.046   8967 .14 4  812.7353478260869
      615 224.093 9030.4  .1 4            842.423
      616 224.806 9102.7 .09 4   834.200142857143
      617 224.806 9176.7 .09 4  799.1928181818181
      618 225.395 9338.7 .07 4  830.4553999999998
      619 226.106 9525.1  .1 4  703.8763043478262
      620 226.597 9545.3 .08 4  681.5399047619046
      621  226.75 9578.1 .07 4  698.9170952380954
      622 227.169 9629.8 .08 4  721.3584285714285
      623 227.223 9677.4 .07 4  734.5083333333333
      end
      format %tm ym
      label values Stock_name unit_lbl
      label def unit_lbl 1 "SP500", modify
      label def unit_lbl 2 "DowJones", modify
      label def unit_lbl 3 "NASDAQ100", modify
      label def unit_lbl 4 "Russell2000", modify

      Comment


      • #4
        The predict command seems to work fine after xtpmg. It would help for you to show the exact sequence of your commands and their respective outputs.

        Comment

        Working...
        X