Announcement

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

  • Wooldridge Textbook Example

    Hi I am trying to replicate one example from Wooldridge. Here is the equation.

    Click image for larger version

Name:	_20220326011813.jpg
Views:	1
Size:	85.1 KB
ID:	1656352


    This is the link for the data, Sorry about that I don't know how to upload the data set.

    http://qcpages.qc.cuny.edu/~rvesseli...ata/JTRAIN.DTA

    I try a couple time, but can not replicate this two outcomes. Really appreciate if anyone can help me solve this two problems and show the command. Thank you!

    Best,

    Jacky

  • #2
    I don't konw which textbook of Jeff Wooldridge that you used, and so I don't know its page and context. I try to replicate the results by using following codes:
    Code:
    by fcode: gen dscrap = scrap - scrap[_n-1]
    by fcode: gen dlscrap = lscrap - lscrap[_n-1]
    reg dscrap grant if year==1988
    reg dlscrap grant if year==1988
    Code:
    . by fcode: gen dscrap = scrap - scrap[_n-1]
    (363 missing values generated)
    
    . by fcode: gen dlscrap = lscrap - lscrap[_n-1]
    (363 missing values generated)
    
    . reg dscrap grant if year==1988
    
          Source |       SS           df       MS      Number of obs   =        54
    -------------+----------------------------------   F(1, 52)        =      1.17
           Model |  6.73345587         1  6.73345587   Prob > F        =    0.2837
        Residual |  298.400031        52  5.73846213   R-squared       =    0.0221
    -------------+----------------------------------   Adj R-squared   =    0.0033
           Total |  305.133487        53   5.7572356   Root MSE        =    2.3955
    
    ------------------------------------------------------------------------------
          dscrap |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
           grant |  -.7394436   .6826276    -1.08   0.284    -2.109236    .6303488
           _cons |  -.5637143   .4049149    -1.39   0.170    -1.376235    .2488069
    ------------------------------------------------------------------------------
    
    . reg dlscrap grant if year==1988
    
          Source |       SS           df       MS      Number of obs   =        54
    -------------+----------------------------------   F(1, 52)        =      3.74
           Model |  1.23795567         1  1.23795567   Prob > F        =    0.0585
        Residual |  17.1971851        52  .330715099   R-squared       =    0.0672
    -------------+----------------------------------   Adj R-squared   =    0.0492
           Total |  18.4351408        53  .347832845   Root MSE        =    .57508
    
    ------------------------------------------------------------------------------
         dlscrap |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
           grant |  -.3170579   .1638751    -1.93   0.058    -.6458974    .0117816
           _cons |  -.0574357    .097206    -0.59   0.557    -.2524938    .1376224
    ------------------------------------------------------------------------------

    Comment


    • #3
      Originally posted by Chen Samulsion View Post
      I don't konw which textbook of Jeff Wooldridge that you used, and so I don't know its page and context. I try to replicate the results by using following codes:
      Code:
      by fcode: gen dscrap = scrap - scrap[_n-1]
      by fcode: gen dlscrap = lscrap - lscrap[_n-1]
      reg dscrap grant if year==1988
      reg dlscrap grant if year==1988
      Code:
      . by fcode: gen dscrap = scrap - scrap[_n-1]
      (363 missing values generated)
      
      . by fcode: gen dlscrap = lscrap - lscrap[_n-1]
      (363 missing values generated)
      
      . reg dscrap grant if year==1988
      
      Source | SS df MS Number of obs = 54
      -------------+---------------------------------- F(1, 52) = 1.17
      Model | 6.73345587 1 6.73345587 Prob > F = 0.2837
      Residual | 298.400031 52 5.73846213 R-squared = 0.0221
      -------------+---------------------------------- Adj R-squared = 0.0033
      Total | 305.133487 53 5.7572356 Root MSE = 2.3955
      
      ------------------------------------------------------------------------------
      dscrap | Coef. Std. Err. t P>|t| [95% Conf. Interval]
      -------------+----------------------------------------------------------------
      grant | -.7394436 .6826276 -1.08 0.284 -2.109236 .6303488
      _cons | -.5637143 .4049149 -1.39 0.170 -1.376235 .2488069
      ------------------------------------------------------------------------------
      
      . reg dlscrap grant if year==1988
      
      Source | SS df MS Number of obs = 54
      -------------+---------------------------------- F(1, 52) = 3.74
      Model | 1.23795567 1 1.23795567 Prob > F = 0.0585
      Residual | 17.1971851 52 .330715099 R-squared = 0.0672
      -------------+---------------------------------- Adj R-squared = 0.0492
      Total | 18.4351408 53 .347832845 Root MSE = .57508
      
      ------------------------------------------------------------------------------
      dlscrap | Coef. Std. Err. t P>|t| [95% Conf. Interval]
      -------------+----------------------------------------------------------------
      grant | -.3170579 .1638751 -1.93 0.058 -.6458974 .0117816
      _cons | -.0574357 .097206 -0.59 0.557 -.2524938 .1376224
      ------------------------------------------------------------------------------
      Hi Samulsion,

      Thank you so much! Sorry I forget given the textbook information. It's Professor Jeff's Introductory Econometrics: A Modern Approach 6th Edition. Chapter 13, page 418. Thank you so much for your command again!

      Best,

      Jacky

      Comment


      • #4
        Hi Lin, thanks for feedback, you can also use time-series operators -- D. here -- to simplify your commands line; and also see help tsvarlist
        Code:
        xtset fcode year
        regress D.scrap grant if year==1988
        regress D.lscrap grant if year==1988

        Comment


        • #5
          Originally posted by Chen Samulsion View Post
          Hi Lin, thanks for feedback, you can also use time-series operators -- D. here -- to simplify your commands line; and also see help tsvarlist
          Code:
          xtset fcode year
          regress D.scrap grant if year==1988
          regress D.lscrap grant if year==1988
          Hi Samulsion, Thank you so much!

          Best,

          Jacky

          Comment

          Working...
          X