Announcement

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

  • Average of a variable in a panel data

    Dears,
    I have a panel dataset and I want to create a variables/list which will show the average overtime (e.g. investment) for a given country.

    example...
    I have 70 countries and 15 years in my dataset.

    I want to find the average investment for each country in a year. like sum (investment for 15 years)/15---for every country.

    Any suggestion would be great.

    Thanks

    Arshad

  • #2
    Arshad:
    are you looking for something along the following lines?
    Code:
    . use "http://www.stata-press.com/data/r14/nlswork2.dta", clear
    (National Longitudinal Survey.  Young Women 14-26 years of age in 1968)
    
    . bysort idcode: egen A=mean( ln_wage)
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Carlo, I can't appreciate it enough 👍🏾
      Exactly what i was looking for.
      Thank you very much

      Comment

      Working...
      X