Announcement

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

  • problem of bootstrap command for xtdpdsys but no problem for xtreg

    Hello,Dear expert

    I write commands as follow:


    xtset stock year

    gen y=ln_innovK
    gen x=DifG
    gen w=cgbl


    program abzj,rclass
    tempname a b
    xtdpdsys w x age tq size debt year1-year12 , endogenous(x,lag(0,1)) twostep
    scalar `a'=_b[x]
    xtdpdsys y w x age tq size debt year1-year12, endogenous(x,lag(0,1)) twostep
    scalar `b'=_b[w]
    return scalar ab=`b'*`a'
    end



    set seed 11111
    bootstrap ab=r(ab) ,reps(1000) nodrop :abzj

    ------------------------------------------------------------
    Then I got this error:

    "insufficient observations to compute bootstrap standard errors
    no results will be saved"

    but if I change the "xtdpdsys"to "xtreg" as follows , It will be ok.



    program abzj,rclass
    tempname a b
    xtregw x age tq size debt year1-year12 , fe
    scalar `a'=_b[x]
    xtreg y w x age tq size debt year1-year12, fe
    scalar `b'=_b[w]
    return scalar ab=`b'*`a'
    end


    Then I change the regression command with xtscc ,it will also have the same error.
    my data as follows:

    xtdes

    stock: 4, 16, ..., 603366 n = 1098
    year: 2003, 2004, ..., 2014 T = 12
    Delta(year) = 1 unit
    Span(year) = 12 periods
    (stock*year uniquely identifies each observation)

    Distribution of T_i: min 5% 25% 50% 75% 95% max
    1 1 4 6 11 12 12

    Freq. Percent Cum. | Pattern
    ---------------------------+--------------
    245 22.31 22.31 | 111111111111
    104 9.47 31.79 | .......11111
    96 8.74 40.53 | ........1111
    41 3.73 44.26 | .........111
    34 3.10 47.36 | ......111111
    33 3.01 50.36 | ....11111111
    30 2.73 53.10 | .1..........
    29 2.64 55.74 | ...111111111
    28 2.55 58.29 | .11111111111
    458 41.71 100.00 | (other patterns)
    ---------------------------+--------------
    1098 100.00 | XXXXXXXXXXXX


    I also find the same problem using other panel data.

    So does it mean that command "xtreg“ only can be used in this suitiation?

    I am willing to provide the data through email to you to test.
    My email is [email protected]
    Pleaes contact with me ,if you need the data to test it

    Thank you for your help.


  • #2
    I do not have an answer to your problem with the bootstrap command, but I need to tell you that you did not specify the xtdpdsys command correctly. When using the option endogenous(x), you should in general not specify the variable x in the list of independent variables:
    Code:
    xtdpdsys w age tq size debt year1-year12 , endogenous(x,lag(0,1)) twostep
    xtdpdsys y w age tq size debt year1-year12, endogenous(x,lag(0,1)) twostep
    Stata automatically adds the variable specified in the option to the list of regressors. In your case, xtdpdsys also generates instruments for x that are valid only under exogeneity of x.
    https://www.kripfganz.de/stata/

    Comment


    • #3
      Thank you .It is my mistake .
      I change the commnd as you correct me. But the problem is the same.
      xtdpdsys w age tq size debt year1-year12 , endogenous(x,lag(0,1)) twostep

      Comment

      Working...
      X