Announcement

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

  • question about etable?

    Dear all,

    I use etable to output the regression results, but find a bug.

    Code:
    webuse grunfeld,clear
    xtreg invest mv ks i.year,fe r
    etable, keep(mv) export(xxx.tex,replace)
    
    -----------------------------
                           invest
    -----------------------------
    Number of observations    200
    -----------------------------
    I find that if I use the option keep()and use the abbreviation of mvalue. Then the output keeps no variables.

    I hope that we can use the abbreviation of variables in keep option.

    Best,
    Raymond
    Best regards.

    Raymond Zhang
    Stata 17.0,MP

  • #2
    I would raise this with Stata Technical Support, as there is no indication (that I can see) in the documentation that abbreviations should not be used.

    Comment


    • #3
      Dear @Leonardo Guizzetti

      I have another problem about etable. I want to rename the _cons to other name,I try to use collect command to modify _cons to constant.
      It seems that
      etable has no options to modify it.

      Code:
      webuse grunfeld,clear
      qui reg invest mv ks, r
      qui etable
      
      collect label levels colname _cons "constant", modify 
      collect style header colname[_cons], level(label) 
      collect preview
      
      -------------------------------
                              invest 
      -------------------------------
      mvalue                    0.190
                              (0.018)
      constant                -59.429
                             (20.401)
      Number of observations      200
      -------------------------------
      ​​​​​​​











      Best regards.

      Raymond Zhang
      Stata 17.0,MP

      Comment


      • #4
        The output of help etable tells us
        keep(coeflist) specifies the coefficients to be included in the table and the order in which to display them. Names are separated from each other by blanks. The default is to display all coefficients.
        So the arguments to keep() must be a coefficient names as given by
        Code:
        matrix list e(b)
        or by
        Code:
        xtreg, coeflegend
        following xtreg. The coefficient names do not follow the rules for variable lists, are based on the full variable names, not any abbreviations, and perhaps include factor and time series prefixes.

        Perhaps this example will help you accomplish your objective in your actual process. In this case it keeps all the coefficients without needing to type their names in full, and excludes the year coefficients.
        Code:
        . unab coef : mv-ks
        
        . etable, keep(`coef' _cons) export(xxx.tex,replace)
        
        -----------------------------------
                                    invest
        -----------------------------------
        Market value (prior year)     0.118
                                    (0.011)
        Capital stock (prior year)    0.358
                                    (0.048)
        Intercept                   -32.836
                                   (19.783)
        Number of observations          200
        -----------------------------------
        Last edited by William Lisowski; 02 Apr 2022, 20:14.

        Comment


        • #5
          _
          Last edited by William Lisowski; 02 Apr 2022, 20:15. Reason: Removed - unintentional duplicate

          Comment

          Working...
          X