Announcement

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

  • Year dummies in first differences?How?

    Dear
    I am new in STATA and I hope I can gain from the experts experience in STATA
    My question is
    I want to run first difference OLS regression for my panel data and I want to include T-1 year dummies ? How to do it as a command ?Any help please?

    Thanks

  • #2
    Code:
    webuse grunfeld, clear
    xtset company year
    xi: regress D.(invest mvalue kstock i.year), nocons robust
    With n>=30 (number of cross-sectional units), cluster your standard errors where the panel identifier defines the clusters (e.g., company in the Grunfeld dataset).

    Res.:

    Code:
    . xi: regress D.(invest mvalue kstock i.year), nocons robust
    i.year            _Iyear_1935-1954    (naturally coded; _Iyear_1935 omitted)
    
    Linear regression                               Number of obs     =        190
                                                    F(21, 169)        =       3.84
                                                    Prob > F          =     0.0000
                                                    R-squared         =     0.5162
                                                    Root MSE          =     41.638
    
    ------------------------------------------------------------------------------
                 |               Robust
        D.invest |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
          mvalue |
             D1. |   .0875444   .0181664     4.82   0.000     .0516821    .1234068
                 |
          kstock |
             D1. |   .3246777   .1548888     2.10   0.038     .0189116    .6304438
                 |
     _Iyear_1936 |
             D1. |  -7.575298   16.32525    -0.46   0.643    -39.80298    24.65238
                 |
     _Iyear_1937 |
             D1. |  -19.88653   21.34314    -0.93   0.353    -62.02002    22.24697
                 |
     _Iyear_1938 |
             D1. |  -32.44977   28.37471    -1.14   0.254     -88.4643    23.56475
                 |
     _Iyear_1939 |
             D1. |  -55.12414    31.4425    -1.75   0.081    -117.1948    6.946523
                 |
     _Iyear_1940 |
             D1. |   -28.1577   35.58739    -0.79   0.430    -98.41077    42.09537
                 |
     _Iyear_1941 |
             D1. |  -3.518392    37.6699    -0.09   0.926    -77.88257    70.84578
                 |
     _Iyear_1942 |
             D1. |  -11.20514   38.97905    -0.29   0.774     -88.1537    65.74342
                 |
     _Iyear_1943 |
             D1. |  -29.26826   41.29455    -0.71   0.479    -110.7878    52.25132
                 |
     _Iyear_1944 |
             D1. |  -28.45966   42.23579    -0.67   0.501    -111.8374    54.91804
                 |
     _Iyear_1945 |
             D1. |   -37.4137    43.9461    -0.85   0.396    -124.1677    49.34032
                 |
     _Iyear_1946 |
             D1. |   -10.4932   50.21616    -0.21   0.835     -109.625    88.63855
                 |
     _Iyear_1947 |
             D1. |  -24.59639   54.72202    -0.45   0.654    -132.6231    83.43037
                 |
     _Iyear_1948 |
             D1. |  -28.46967   59.40701    -0.48   0.632    -145.7451    88.80573
                 |
     _Iyear_1949 |
             D1. |  -56.45249   64.14936    -0.88   0.380    -183.0898    70.18479
                 |
     _Iyear_1950 |
             D1. |  -56.38835   67.02188    -0.84   0.401    -188.6963    75.91957
                 |
     _Iyear_1951 |
             D1. |    -35.268   72.23561    -0.49   0.626    -177.8683    107.3323
                 |
     _Iyear_1952 |
             D1. |  -34.05829   79.41316    -0.43   0.669    -190.8278    122.7113
                 |
     _Iyear_1953 |
             D1. |  -27.77199   79.56885    -0.35   0.728    -184.8489    129.3049
                 |
     _Iyear_1954 |
             D1. |  -52.11735   87.30722    -0.60   0.551    -224.4706    120.2359
    ------------------------------------------------------------------------------
    
    .

    Comment

    Working...
    X