Announcement

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

  • ivreg2- is there a results matrix?

    Hi all,

    Long-time viewer, first-time questioner! I'm using ivreg2 for estimating the TOT results of an experiment, to which I then want to apply the BKY FDR multiple hypothesis testing correction to the p-values. Doing this automatically with a normal command works easily, as the p-values are stored in r(table). However, I can't for the life of me find where ivreg2 stores regression results, if anywhere. The only matrix available in ereturn list seems to be e(first), which is only the first stage results.

    The code I use for accessing the stored p-value for areg is below- is it possible to adapt this for ivreg2, or will I need to use the original ivreg?

    qui areg `var' treatment $control1, absorb(pair_number) vce(cluster id)
    local r2: display %4.3f `e(r2)'
    mat P =r(table)
    scalar p`w1'=P[4,1]
    mat drop P


    Thank you!

    -Forest

  • #2
    Welcome to Statalist.

    First, I would do
    Code:
    return list
    to see if anything like r(table) is created by ivreg2. Your ereturn list only shows results stored as estimates in e(), and not results stored as returned values in r(), like r(table).

    Second, I note in the output of help ivreg2 in the "Remarks and saved results" section among the descriptions of the saved results
    Code:
       e(firsteqs)   Names of stored first-stage equations
       e(rfeq)       Name of stored reduced form equation
       e(sfirsteq)   Name of stored system of first-stage and reduced form equations
    which suggests that ivreg2 saves various sets of estimation results using the estimates store command, and you can restore these to being the "active estimates" with the estimates restore command. (If you are unfamiliar with these commands, do spend the time to read help estimates and help estimates store.)

    Down in the "Examples" section we see
    Code:
            . ivreg2 lwage exper expersq (educ=age kidslt6 kidsge6), robust ffirst saverf
    
            . di e(arf)
    
            . di e(archi2)
    
            . di e(sstat)
    
    (Obtaining the Anderson-Rubin Wald F statistic from the reduced-form estimation)
    
            . estimates restore _ivreg2_lwage
    where the authors likely used
    Code:
    display "`e(rfeq)'"
    to learn the name under which the results for the reduced form equation were stored.

    Comment


    • #3
      This answer might be a few years late, but if anyone has the same problem, you can access `r(table)' by simply using:
      Code:
      ereturn display
      This is the command you use to generate a regression table after you posted coefficients and the variance-covariance matrix, and it will just repeat your table and store the r(table) matrix you need for your application.

      Comment

      Working...
      X