Announcement

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

  • Command for calculating mean incorporating three variables (ESG, year, industry)

    Dear all,

    I am trying to calculate the average ESG score for a specific industry for a given year using Stata. However, I am struggling to find the correct command.
    By using:

    Code:
     bysort Year: egen MeanIndustryEsg = mean(ESG_score)
    I get the mean ESG score for a given year. How do I incorporate the industry variable though (I want the average for a specific industry and not over all industries)?

    Any help is appreciated!
    Thanks a lot!

  • #2
    Code:
    bysort Year industry: egen MeanIndustryEsg = mean(ESG_score)
    Best wishes

    Stata 18.0 MP | ORCID | Google Scholar

    Comment

    Working...
    X