Announcement

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

  • Compute average annual growth rate in Stata

    Hi all,
    I'm totally new to Stata and this is my first post in this forum :-).
    I have the following problem: I have a Data set in the form of

    Country Year (GDP/capita)( Labor force,total) Gross fixed capital formation, (% of GDP)
    Belgium 2000 37.564,27 4.385.026 0.24
    Belgium 2001 38.554,33 4.412.020 0.25
    Belgium 2002 39.222,34 4.450.010 0.26
    Canada 2000 40.332,43 20.354.250 0.30
    Canada 2001 42.334,44 30.254.230 0.31
    Canada 2002 43.543,32 40.543.210 0.33

    The Data shown above is just an example of my entire Data set which consists of 20 countries for the time period 2002-2012. Now i want to generate a variable that is equal to ln(n+0.05) where n stands for average annual rate of growth of the labor force and the 0.05 is a constant (if it helps the variable is part of the Solow model). So my question is now how could i asses this problem as i spend already several hours searching the internet for it but still could not come up with a working solution. If it helps in the end my regression equation should look like
    ln(GDP/capita)= constant+ln(I/GDP)+ln(n+0.05).

    I would highly appreciate any help to arrive at a possible solution. Thanks in advance

    Best Regards

    Marco Oldenhoff
    Last edited by Marco Oldenhoff; 22 Nov 2016, 10:44.

  • #2
    Wrong way round. Instead of several hours searching the internet, several hours reading an introductory book or the User's Guide would have been more productive.

    See

    Code:
    help generate 
    help regress
    for basic help.

    Comment


    • #3
      Thanks for the advice Nick, i mean i know the basics but assessing this specific problem to generate the ln(n+0.05) still gives me headaches. So i just thought that somebody may can give me some advice. I do not have the intention to save some time here. I'm just desperate and looking for a hint to somehow arrive there.

      Comment


      • #4
        I don't understand all of that, but let that go. What is wrong with

        Code:
        gen whatever = ln(n + 0.5)
        ?

        Why is that not the kind of solution you want?

        (You won't want a miniature lecture, but it's a severe truth that someone else's desperation or urgency or whatever does not make a question more interesting or easier to answer or secure faster help here.)

        Comment


        • #5
          Thanks again Nick for the gen suggestion. But i am just searching for the code needed to create the average annual growth rate. And furthermore when i have the n(growth rate) when i gen ln(n+0.5) does stata atomatically add 0.5 to the value of n ?.

          Comment


          • #6
            Lots of posts here on growth rate.

            You can try out the other question yourself:

            Code:
            . clear
            
            . set obs 1
            number of observations (_N) was 0, now 1
            
            . gen y1 = ln(1 + 0.5)
            
            . gen y2 = ln(1)
            
            . l
            
                 +---------------+
                 |       y1   y2 |
                 |---------------|
              1. | .4054651    0 |
                 +---------------+
            In short, if you tell Stata to add 0.5, it does that. (I may be misunderstanding your difficulty there.)

            Comment


            • #7
              Thanks for the fast response! I know for a professional my questions sound like a joke :D . But for me your comments were very helpful

              Comment


              • #8
                For growth rate, consider some variation on

                Code:
                 
                 bysort country (year): gen growth = (whatever - whatever[_n-1])/(whatever[_n-1] * (year - year[_n-1]))
                with an extra factor of 100 if desired.

                Comment


                • #9
                  Thank you very much Nick that solved my problem !

                  Comment

                  Working...
                  X