Announcement

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

  • Stratified regression output using outreg2

    Hi everyone.

    First time Statalist poster here. I'm currently using Stata 18.

    I'm working on my first ever paper and I want to make a table where I present both stratified and not stratified regression results. My outcomes heel pain (hpain) and heel pain intensity (hpain_int) dictates both linear and logistic regression. But I plan to present logistic and linear regression in separate tables. When I was doing the analysis I saw indications of interaction of sex in my data, so I want to present stratified regression results in addition to my un-stratified regression estimates.

    Using outreg2 I got some really nice tables from my ordinary linear regression adjusting for age, sex, physical work (pw), regular excercise(exercise), education (edu) -> model 1: "regress hpain_int age i.sex" and model 2: "regress hpain_int age i.sex i.pw i.exercise i.edu"

    However, I can't seem to find how to get these outputs in to a table whenever I use stratified analysis for example "regress hpain_int age i.exercise i.edu if sex ==0" OR "regress hpain_int age i.exercise i.edu if sex ==1"

    This is the command I used to get the tables: outreg2 using regression_results, noaster sideway stats(coef ci pval) append excel dec(2)

    So the question is, how to move from here to get stratified regression estimates in my table?

    Any advice would be highly appreciated.

    Thanks in advance

    Erlend Holthe


  • #2
    Erlend:
    welcome to this forum.
    What follows is probably off-topic, but why not sticking with
    Code:
    regress hpain_int age i.sex i.pw i.exercise i.edu
    and exploring the difference in coefficients via -test-, -testparm- and -lincom-?
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3
      Thank you for your answer. I'm not sure how to answer your question as I am simply following my supervisors advise, but I will ask at our next meeting. Thank you again.

      But it would still be useful to produce more columns inside the regression output tables produced by outreg2.

      Comment


      • #4
        Originally posted by Erlend Holthe View Post
        Using outreg2 I got some really nice tables from my ordinary linear regression adjusting for age, sex, physical work (pw), regular excercise(exercise), education (edu) -> model 1: "regress hpain_int age i.sex" and model 2: "regress hpain_int age i.sex i.pw i.exercise i.edu"

        However, I can't seem to find how to get these outputs in to a table whenever I use stratified analysis for example "regress hpain_int age i.exercise i.edu if sex ==0" OR "regress hpain_int age i.exercise i.edu if sex ==1"

        This is the command I used to get the tables: outreg2 using regression_results, noaster sideway stats(coef ci pval) append excel dec(2)

        So the question is, how to move from here to get stratified regression estimates in my table?
        outreg2 is from SSC (FAQ Advice #12). You can store each set of estimates first then output as follows:

        Code:
        regress hpain_int age i.exercise i.edu if sex ==0
        estimates store m1
        
        regress hpain_int age i.exercise i.edu if sex ==1
        estimates store m2
        
        outreg2 [m1 m2] using myfile, replace noaster sideway stats(coef ci pval) excel dec(2)
        Code:
        help outreg2
        to see how to label the columns.

        Comment


        • #5
          Thank you Mr. Musau. This was very useful.

          Comment

          Working...
          X