Announcement

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

  • Regression with Weight

    Dear STATA users,

    I am trying to replicate a paper. The authors investigate the relationship between a country-level variable (say X) and a firm-level variable (say Y). The sample contains data on various countries. Each country has around 100 to 5000 firms.
    Because some countries have too many firms whereas others have only 100 to 200 firms. Thus, the results may be biased.

    The authors apply firm fix-effects and "weight observations by the inverse of the number of firms per country and year so that each country has the same weight in our estimations."

    I have searching topic on weight and I can see there are four types of weights: fweights, pweights, aweights, and iweights. From my understanding, none of the above options can do the job.

    Can you please suggest a solution for this case?

    Thank you very much for your support and wishing you all the best of luck.



  • #2
    it appears the first thing you need is the denominator of the weight; you don't supply a data example (using -dataex-; please read the FAQ), but it is probably something like:
    Code:
    bys country year: egen wanted1=count(1)
    then get the inverse:
    Code:
    gen wanted=1/wanted1
    these will not be integers so fweight is out; this is not a survey so pweight is also wrong; in this situation, I believe you probably want aweight (and aweight and iweight are probably the same here anyway)

    Comment


    • #3
      I also think that -aweights- will do what you want here. You can read how they work on this FAQ:

      https://www.stata.com/support/faqs/s...ar-regression/

      Comment

      Working...
      X