Announcement

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

  • suest after bootstrap

    Hi Statalist,
    Trying to run suest after bootstrap using the code below:

    Code:
    cap program drop Expelast
    program define Expelast, rclass
    args i
    qui areg yvar xvar1 xvar1 xvar2 xvar3 xvar4 if dum==`i', absorb(clust)
    local a0 =_coef[xvar1]
    qui sum yvar if dum==`i'
    local vbar =r(mean)
    return scalar Expel`i' =1-b1+(`a0'/`vbar')
    end
    
    forvalues i=1/3 {
    bootstrap Expel`i'=r(Expel`i'), reps(1000) seed(1): Expelast `i'
    estimates store exp_el`i'
    }
    suest exp_el*
    Here the variable "dum" takes values 1,2, and 3. The code runs just fine. the command <estimates dir> correctly returns all the three stored results.
    However, the last line suest returns the error "exp_el1 was estimated with a nonstandard vce (bootstrap)"
    I would like to be able to test the coefficient Expel1=Expel2=Expel3, etc. after suest. Is there any way to pull it off?
    I tried the code
    Code:
    suest exp_el*, vce (robust)
    but to no avail. But it says "vcetype bootstrap not allowed".

    Thank you in advance for any potential leads.

    Best,
    Rijo.

  • #2
    Bumping it up, just in case.

    Comment


    • #3
      The error message is quite clear about it: You cannot use suest after bootstrap. suest requires score functions (internally generated with the postestimation command predict for each estimation result) in order to compute the variance-covariance matrix for the system of estimates, but those scores are not available after your Expelast program.
      https://www.kripfganz.de/stata/

      Comment


      • #4
        Originally posted by Sebastian Kripfganz View Post
        The error message is quite clear about it: You cannot use suest after bootstrap. suest requires score functions (internally generated with the postestimation command predict for each estimation result) in order to compute the variance-covariance matrix for the system of estimates, but those scores are not available after your Expelast program.
        Thank you. Can I ask what could be the best way to make a comparison of the bootstrapped coefficients across subgroups (variable dum in my program Expelast)?

        Comment


        • #5
          Instead of bootstrapping the coefficients separately, bootstrap some statistic that tests that they are the same.

          Comment


          • #6
            Originally posted by Joro Kolev View Post
            Instead of bootstrapping the coefficients separately, bootstrap some statistic that tests that they are the same.
            Thank you. That was one approach I saw elsewhere. However, in this case, because each statistic is estimated in a forvalues loop, one at a time, I couldn't find a straight forward way to bootstrap something like say, Expel1-Expel2=0 since only one of them would be available to the program at a time given the way the program is currently implemented.

            Comment


            • #7
              Move your loop -forvalues i=1/3 {}- inside the programme you are bootstrapping.

              And then the simplest statistic that you can bootstrap is probably (Expel1-Expel2)^2 + (Expel2-Expel3)^2.

              Comment

              Working...
              X