Announcement

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

  • calculating growth variable for unbalanced panel data

    Hey All. I am new to Stata community .Can anyone help me with the command of calculating growth variable for unbalanced panel data.
    my variable of interest is credit growth .Do we need to transform the variable to log before calculating growth rate .
    i am giving sample of data
    c_id bankname year ownership creditgrowth_total
    1 A 2000 Public Sector 4.9e+06
    1 A 2001 Public Sector 2.3e+06
    1 A 2002 Public Sector 2.7e+06
    1 A 2003 Public Sector 6.1e+06
    2 B 2001 Private Sector 111571
    2 B 2002 Private Sector 181807
    when I am calculating with the gen growth=D.creditgrowth _total command ,not getting the results

    any help is highly appreciated
    Last edited by Fadi Ansar; 26 May 2021, 12:45.

  • #2
    Welcome to Statalist.

    A couple of things -

    I’m confused that you want a growth rate, but your variable is creditgrowth_total? From your data excerpt, it appears to be in levels.

    There are two types of growth rates: discretely compounded and continuously compounded (although they’re roughly the same). What you show here

    Code:
    gen growth=D.creditgrowth _total command
    is telling Stata to give you the first difference, not a growth rate.

    Because you’re working with an unbalanced panel, I suggest adding a timevar to your xtset statement and let Stata know you have a yearly frequency. I can’t tell whether or not you have (this is addressed in the FAQ along with guidelines for showing an example dataset using dataex). Here’s an example you can adapt

    Code:
    webuse "nlswork.dta", clear
    xtset idcode year, yearly
     
    gen credit = rnormal(100,10)
    gen gr_credit_discrete  = 100*(credit/l1.credit -1)
    gen gr_credit_continous = 100 *(ln(credit) - ln(l1.credit))
    Hope this helps.

    Comment


    • #3
      Thankyou so much for your response .I want to calculate credit growth rate from total credit data

      Comment


      • #4
        hello again, I have found another command in Statalist to compute growth rate ,ie,
        gen g_credit = D.wage / L.credit
        After using the commands suggested by you and the above one I am getting two different values. Now i am got confused about which one should i really use

        Comment

        Working...
        X