Announcement

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

  • average annual growth rates in panel data

    Dear all,

    I am currently working with a panel dataset, where I have country and year as indicators, and some variables. I would like to compute the average annual growth rate for my variables.

    So, I want to have one value, which is the average of the annual growth rates, for each of the countries. Unfortunately I couldn't yet find a code for this, as I need to tell stata to do *one* average annual growth rates for each country.

    thank you very much in advance,

    Kind regards,
    C


  • #2
    The term "average annual growth rate" may have a standard meaning in your field, but to me it could mean either of two things:

    1. Calculate the annual growth rate each year and then average those.

    2. Calculate a single growth rate for the entire period which, had it applied at all times throughout that period, would have led to the same total growth as was observed.

    Which are you interested in? Or is it something different still?

    Comment


    • #3
      Thank you for your reply.

      I want to obtain option 1. So, the average mean of annual growth rates of a variable x over the full sample period (T) for all countries (N), in the setting of a balanced panel data, with T=165, N=17.


      Of course, your second option would also be interesting, and I wouldn't mind a tip for this as well.

      Comment


      • #4
        Since Clyde didn't follow up, let me try to help you. First, you need to have xtset your data so Stata knows the panels and time. Then,
        g growrate=(x - L.x)/L.x
        bysort country: egen avegrow=mean(growrate)

        If you want to do this for a bunch of variables, put it in a loop:

        foreach var in x1 x2 {
        g growrate`var'=(`var' - L.`var')/L.`var'
        bysort country: egen avegrow`var'=mean(growrate`var')
        }

        Comment

        Working...
        X