Announcement

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

  • consecutive model numbers in multiple "esttab" outputs

    Dear all,

    I run many regression models that I try to convert to latex tables directly using the esttab function.

    My problem now is that, say, I am running 8 regression models, saving them (in my case, as a tex-file) using the esttab command, and then running another nine models and saving them also using the esttab command. This gives me two tables with results, one with models 1-8, the other with models 1-9. However, I would need the second one to be 9-17.

    I tried experimenting with the options "nonumbers" (to prevent the original model numbers and replace them with labels 1, 2, .... 17), but then I would also need to have a title/label for each model (as it is default, i.e. the dependent variable, ideally), and I do not see the possibility to add a second label. Currently, I would have to refer to my models as "table 6, model 8" and "table 7, model 9", and I do not think that is reasonable (or is it?).

    Originally, I would save the estimates form each regression with estimates store, then type esttab * and use estimates clear before and after. But even storing all the estimates simultaneously as est1, ...est 8, est9, ...est17 and then calling them using esttab est1 ... est8 and esttab est9 .... est17 does not work, as model numbers are always reset.

    I would appreciate any help.

  • #2
    Welcome to the forum.
    You will increase the chance of a good reply if you'll read the FAQ and show us exactly your code.
    As for your question, you can use est store and est title to refer to different models. esttab *, mtitle

    Comment


    • #3
      Thank you. This is my code:
      Code:
      quietly: xi: reg ROA  logta colla big small   i.daxid i.Year,
      estimates store estroa3
      quietly: xi: reg ROA    logta   area apl apl2  i.daxid i.Year,
      estimates store estroa4
      
      esttab estroa3 estroa4 ///
       using regcompare1.tex,  ///
       p r2 not scalars(df_m) obslast nogaps replace ///
       indicate("year effects = _IYear_*" "dax group = _Idaxid_*") noconstant
      
      quietly: xi: reg debt           logta        area apl apl2     i.daxid i.Year,
      estimates store estdebt3
      quietly: xi: reg debt           logta colla big small togeth sep  i.daxid i.Year,
      estimates store estdebt4
      esttab  estdebt3 estdebt4 ///
      using regcompare2.tex, ///
      p r2 not scalars(df_m) obslast nogaps replace ///
      indicate("year effects = _IYear_*" "dax group = _Idaxid_*") noconstant
      If I use
      Code:
      estimates title: model1
      as an additional option for each model; or, alternatively,
      Code:
      mtitles(model1 model2)
      as option for esttab, I am not able to get both the title and a new model number (which I would also have to define manually, if no other option persists; in that case, I need to define two titles) in place.
      Last edited by Max Piper; 12 Dec 2015, 10:20.

      Comment


      • #4
        I hope the following code will answer to your request. It shrink your code substantially and I think will help you to present your results efficiently.

        Code:
        local model_1 "colla big small"
        local model_2 "area apl apl2"
        
        foreach dependent of var ROA debt {
            local a=1
            foreach i in "`model_1'" "`model_2'" {
            reg `dependent' `i' logta i.daxid i.Year
            eststo `dependent'_`a'
            est title: Model `a'
            local `++a'
            }    
        }
        Now you can present the results by the sequence of the dependent variable

        Code:
        esttab ROA_* debt_* , ///
        p r2 not scalars(df_m) obslast nogaps indicate("year effects =*.Year" "dax group =*.daxid") noconstant replace
        Or by sequence of the models for each dependent
        Code:
        esttab *1 *2 , ///
        p r2 not scalars(df_m) obslast nogaps indicate("year effects =*.Year" "dax group =*.daxid") noconstant replace

        Comment

        Working...
        X