Announcement

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

  • hiding fixed effects in the regression results

    Dear Community,

    I want to hide fixed effects generated by i. in the results table

    I built 3 models:

    model 1:

    Code:
    xtreg y1 x1
    eststo m1
    estadd local fixed "no", replace
    estadd local company "no", replace
    estadd local year "no", replace
    model 2:
    Code:
    xtreg y1 x1 i.year i.company
    eststo m2
    estadd local fixed "no", replace
    estadd local company "yes", replace
    estadd local year "yes", replace
    model 3:
    Code:
    xtreg y1 x1,fe
    eststo m3
    estadd local fixed "yes", replace
    estadd local company "no", replace
    estadd local year "no", replace
    I want to have table with results that doesn't show particular years and companies. I just want to have the information whether I applied fixed effects or not.

    I tried the code:

    Code:
    esttab m1 m2 m3 using results.rtf, ///
    cells(b(star fmt(%9.3f)) se(par))  ///
    indicate (company year) ///
    stats(r2_a N fixed company year, fmt(%9.3f %9.0fc) labels("R-squared" "Observations" "fixed effects" "company fixed effects" "year fixed effects"))   ///
    legend label collabels(none) varlabels(_cons Constant) ///
    note(Standard errors are in parentheses. ) ///
    title({\b Table 1.} {\regresssion results}) replace

    However I got an error message : coeffcient company not found

    If I ommit the code indicate I got the table with results but I see the listed years and companies and it is not what I wanted.
    Last edited by sladmin; 28 Aug 2023, 08:37. Reason: anonymize original poster

  • #2
    Guest,

    is -i.companny- the answer?
    Last edited by sladmin; 28 Aug 2023, 08:37. Reason: anonymize original poster
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Thank you Carlo for your answer. Nope. I had just typo in the example I provided. I cannot share my data since it is sensitive. In my dataset it shows me coeffcient company not found even though I made a regression before using i.company. I don't understand why stata doesn't want to omit the list of companies and list of years in my Word table

      Comment


      • #4
        Guest,

        have you already taken a look at the new -table- suite capabilities that are detailed in Stata 17 .pdf manual?
        Last edited by sladmin; 28 Aug 2023, 08:37. Reason: anonymize original poster
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          I've found user guide for Stata 17. I didn't find the answer there only hint that my solution might be in [TABLES]. I typed: search[TABLES],entry
          However, didn't find my answer.
          I tried a code:
          drop (company year)
          However I saw: coefficient not found
          I tried also:
          droplist(company year)
          but I saw: option not allowed

          Comment


          • #6
            estout is from SSC, as you are asked to explain (FAQ Advice #12). You are mixing up different things, but if you want to use the -indicate- option, you do not need to estadd anything. The year coefficients are named xxxx.year, e.g., 2016.year, so to reference each one of them, you can use the wildcard "*.year".

            Code:
            eststo m1: xtreg y1 x1
            eststo m2: xtreg y1 x1 i.year i.company
            esttab m1 m2, indicate("Firm effects= *.company" "Year effects=*.year" )

            Comment


            • #7
              Thank you! I got the table I wanted

              Comment

              Working...
              X