Announcement

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

  • outreg sometimes omits variables from output table

    Hi,

    I have an issue where `outreg` sometimes does not include certain variables (e.g., `var1`) in the output table, even though they are present in the regression results. This occurs on my Windows machine but not on my colleague's Mac.

    - The variable `var1` appears in the Stata regression output, but is missing from the outreg-generated file.
    - The same code works as expected on Mac.

    What I have tried:
    - Checked for collinearity or missing data (`var1` is present in regression results).
    - Compared Stata and outreg versions (same on both machines).

    Details:
    - Stata version: Stata 17
    - OS: Windows 10 (colleague: MacOS)
    - outreg version: 4.32

    Is this a known OS issue, or is there something else I should check?

    Thank you!

    Best,
    Jasim

    Regression and outreg code:
    regress outcome_var wageprem wage_x_conv wage_x_new x1 x2
    outreg using "test.doc", replace

    Variable definitions:
    - outcome_var: Dependent variable
    - wageprem: Main predictor
    - group1: Indicator for "converted" group (0/1)
    - group2: Indicator for "new" group (0/1)
    - wage_x_conv: Interaction: wageprem * group1
    - wage_x_new: Interaction: wageprem * group2
    - x1, x2: Additional covariates

    Example minimal dataset:
    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input float(outcome_var wageprem group1 group2 wage_x_conv wage_x_new x1 x2)
     1.825675  .01 1 0 .01    0  2.3773162  -.9160471
     3.127777 1.33 0 1   0 1.33  .37270385   .9241885
     2.549727  .69 1 0 .69    0   .8616723  .13403705
    -.6728769  .16 0 1   0  .16 -1.8365917  1.0237764
     3.550499  .26 1 0 .26    0   1.197492  .20068826
     1.457011  .46 0 1   0  .46   .6218674  -.4237095
    3.6335595  .66 1 0 .66    0   -.591858   .3103299
    -.8686265  .83 0 1   0  .83 -1.2110633 -.51424986
      .417191  .07 1 0 .07    0  -.8665136  -.7490882
    -.3868482  .17 0 1   0  .17     .43038  -1.354164
    end

  • #2
    Note: As you are asked to explain in the Statalist FAQ #12, outreg is a community-contributed command available from the Stata Journal.

    I'm afraid I am on a Mac, so I cannot replicate your problem. One variable (wageprem) is dropped during the regression due to collinearity, but it is still listed in the output with a coefficient of zero and no standard error.

    Could you show us an example of a situation where a variable is missing from the output?

    It might also help to know which version of outreg you are on. You can find this out by typing
    Code:
    which outreg
    at the command line. For instance, mine says
    Code:
    *! version 4.10  30nov2011 by John Luke Gallup ([email protected])
    If you have a previous version, try updating it.

    You might also want to consider alternatives, such as another community-contributed command called outreg2, or the inbuilt command etable. The last was introduced in Stata 17 but after the initial release, so if you don't have it, you may want to update Stata by typing
    Code:
    update all
    Last edited by Hemanshu Kumar; 07 Aug 2025, 01:04.

    Comment


    • #3
      I encountered the same problem as the first poster:

      Windows 10 Pro version 22H2;
      Stata 17.0;
      Outreg version 4.32 18sep2015 by John Luke Gallup ([email protected])

      Comment


      • #4
        I encountered the same problem as the first poster. To be specific, the RHS variables in the regression were wage, wage_old, wage_new. Stata estimated the coefficients but outreg reported that it could not find "_old". I then renamed the variables without the underscore, and ran the regression with RHS variables, wage, wageold, wagenew. Outreg worked fine.

        Windows 10 Pro version 22H2;
        Stata 17.0;
        Outreg version 4.32 18sep2015 by John Luke Gallup ([email protected])

        Comment

        Working...
        X