Announcement

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

  • Exporting results to table

    Hi,
    I have a panel data of 147 countries from 1960 to 2010. I ran the following to export the results of my regression to a table:

    qui xtreg lnGDPper high_frac_dem low_frac_dem lag1_lnGDPper lag2_lnGDPper lag3_lnGDPper lag4_lnGDPper i.year, fe vce(cluster country)
    ttest low_frac_dem == high_frac_dem
    return list
    estadd scalar pval = r(p)
    estadd local TwowayFixedEffects "Yes"
    est sto tab3a_col1
    esttab tab3a_col1 using Table_3a.rtf, replace label b(8) se(8) stats(pval N r2 TwowayFixedEffects, fmt(4 0 4 0) labels("p-value, H0:βL=βH" "Observations" "R2" "Two-way fixed effects")) keep (_cons low_frac_dem high_frac_dem lag1_lnGDPper lag2_lnGDPper lag3_lnGDPper lag4_lnGDPper) nomtitle onecell

    1. Please tell me where to add 'r' in qui xtreg command line to get the adjusted R^2 value, so that I can report them in the table
    2. I also want to include the number of countries included in the regression as a separate row
    3. When I try copying the table in .rtf format to a word document, I'm getting formatting issues where the table on word looks like the following:

    Click image for larger version

Name:	Screenshot 2023-08-27 at 12.59.49 AM.png
Views:	1
Size:	451.4 KB
ID:	1725156


    Could you please tell me if there is a way to directly export these regression results to word without the above issues or manual editing is the only way? I replaced .rtf in the above command with .docx, but a prompt says that word has identified unreadable format, making me unable to open it.

    Thank you so much for your time!

  • #2
    Try the nested regression table of asdoc or outreg2, if these too have the same problem, it might be a Unicode issue? By the way, which version of Stata are you using?
    Last edited by Attaullah Shah; 27 Aug 2023, 09:06.
    Regards
    --------------------------------------------------
    Attaullah Shah, PhD.
    Professor of Finance, Institute of Management Sciences Peshawar, Pakistan
    FinTechProfessor.com
    https://asdocx.com
    Check out my asdoc program, which sends outputs to MS Word.
    For more flexibility, consider using asdocx which can send Stata outputs to MS Word, Excel, LaTeX, or HTML.

    Comment


    • #3
      Attaullah Shah Thank you for your reply! I'm using version 17.0
      Help command is unable to recognise both asdoc and outreg2. Are there any software packages to download?

      Thank you!

      Comment


      • #4
        Hi, I installed asdoc package and tried the following:

        asdoc sum Normallegal_infra Normallegal_order Normalmarketref Normalhrv_index if low_frac_dem == 1, replace label
        asdoc sum Normallegal_infra Normallegal_order Normalmarketref Normalhrv_index if high_frac_dem == 1, append label
        asdoc sum Normallegal_infra Normallegal_order Normalmarketref Normalhrv_index if low_frac_dem == 0 & high_frac_dem == 0, append label

        I'm getting 3 separate tables, but I want them as a single table with 3 columns each denoting each if condition. Also, the final table output has been hyperlinked. When I click on them, the page I'm taken to says address invalid. Could you please help? Thank you!

        Comment


        • #5
          If you want a single table for all three regressions, then you should use the option nest. In my earlier post, I shared a link for the nested table of regression for asdoc.
          Regards
          --------------------------------------------------
          Attaullah Shah, PhD.
          Professor of Finance, Institute of Management Sciences Peshawar, Pakistan
          FinTechProfessor.com
          https://asdocx.com
          Check out my asdoc program, which sends outputs to MS Word.
          For more flexibility, consider using asdocx which can send Stata outputs to MS Word, Excel, LaTeX, or HTML.

          Comment


          • #6
            Thank you! I tried including nest at the end of each of the above commands, but I'm getting the following error:

            last estimation results not found, nothing to store
            r(301);

            Could you please help? Thank you

            Comment


            • #7
              Obviously you have chosen to ignore my previous messages. I referred you twice to the nested regression table of asdoc, but you are still using the sum sub-command. For the regressions, the sub-command should be reg. Try this:
              Code:
              asdoc reg Normallegal_infra Normallegal_order Normalmarketref Normalhrv_index if low_frac_dem == 1, replace label nest tzok
              asdoc reg Normallegal_infra Normallegal_order Normalmarketref Normalhrv_index if high_frac_dem == 1, label nest tzok
              asdoc reg Normallegal_infra Normallegal_order Normalmarketref Normalhrv_index if low_frac_dem == 0 & high_frac_dem == 0, label nest tzok
              For an enhanced version of asdoc, visit asdocx that exports to Word, Excel, HTML, or LaTeX.
              Regards
              --------------------------------------------------
              Attaullah Shah, PhD.
              Professor of Finance, Institute of Management Sciences Peshawar, Pakistan
              FinTechProfessor.com
              https://asdocx.com
              Check out my asdoc program, which sends outputs to MS Word.
              For more flexibility, consider using asdocx which can send Stata outputs to MS Word, Excel, LaTeX, or HTML.

              Comment


              • #8
                Thank you! Sincere apologies, I wasn't clear on my previous post. I ran:

                asdoc xtreg lnGDPper high_frac_dem low_frac_dem lag1_lnGDPper lag2_lnGDPper lag3_lnGDPper lag4_lnGDPper i.year, fe vce(cluster country), replace label nest tzok

                But I want to suppress the output of the year fixed effects on my table. Also, I want to add the following as part of my table:

                ttest low_frac_dem == high_frac_dem
                return list
                estadd scalar pval = r(p)
                estadd local TwowayFixedEffects "Yes"

                How do I do both the above? Also, how can I use asdoc command to create summary statistics table using 3 different if conditions that form each column in my table? I'd like to have only N, mean and standard deviation. I referred to the websites you shared earlier, but felt it didn't answer this particular question. Could you please clarify? Thank you for your time!

                Comment

                Working...
                X