Announcement

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

  • fixed effect - areg versus xtreg

    Hi everyone,

    I've been using the answers given in this forum for a while. Thank you to all the experts who contribute.

    I have a question that I couldn't find an answer to and believe you can help me with:

    I have panel data with the following information about private companies:
    1. Company Name
    2. Year
    3. Quarter
    4. Revenue
    5. Number of Employees
    I want to test the connection between the number of employees and the company's revenue.
    At the same time, for some companies, I have 4 observations each year, and for some, I have only 1, 2, or 3 observations per year.
    My hypothesis is that the year can have an exogenous effect, so I want to control for it; and - most importantly - the companies are from different sectors so I need to FE by the company.

    All in all, I was thinking about two options for my analysis:

    Option 1 - using arge:
    gen companyCluster=companyName+string(year,"%02.0f") //to be able to cluster for multiple observations by some companies in a given year
    areg revenue number_of_employees i.year, absorb(company_name) cluster(companyCluster)

    Option 2 - using xtreg:
    xtset company_name
    xtreg annual_reported_revenue number_of_employees i.year, fe


    Are these options valid? If option 2 is valid, do I need to add clustering?

    Thank you all in advance, Matt










  • #2
    Matt:
    welcome to this forum.
    You should get the same sanple estimates with both codes.
    That said, I would go -xtreg,fe- with clustered standard errors.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Thank you Carlo!

      Comment


      • #4
        if you are uninterested in the i.year coefficients, then you could use reghdfe.

        Comment

        Working...
        X