Announcement

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

  • Fraction of variance explained by i.individual

    Hello,

    I have a problem with my regression which looks like the following:

    reg dependet_variable i.firm i.time v1 v2 v3

    now I want stata to show me which part of the variance is explained by firm fixed effects i.firm.

    Thank you very much!!!

    Regards.



  • #2
    Code:
    reg dependet_variable i.firm i.time v1 v2 v3
    local full_r2 = e(r2)
    reg dependet_variable i.time v1 v2 v3 if e(sample)
    local reduced_r2 = e(r2)
    display "Fraction of variance attributable to i.firm: =`full_r2'-`reduced_r2'"

    Comment


    • #3
      Thank you so much!!!

      Regards,
      Adrian

      Comment


      • #4
        note that, unless your covariates are orthogonal to each other, some amount of explained variation is shared across variables; that means your question is unclear (to me at least) and that Clyde's answer deals only with the "unique" part - of course, that may be what you want

        Comment

        Working...
        X