Announcement

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

  • calculating IRR (Internal Rate of Return)

    hi,

    my data looks as folow:
    id year flow
    1 2008 -100,000
    1 2010 30,000
    1 2012 40,000
    1 2013 35,000
    I want to generate (maybe egen) a new var which will include the IRR of each project (id). I have two main problems:

    1. As you can see there is no observations for some of the years (its fine because the flow in these years was zero) but it is problematic for the irr calculation. How could I add observation for the missing years and zero for the flow?
    id year flow
    1 2009 0
    1 2011 0

    2. What is the best way to calculate the IRR?

    Thank you,
    Guy.

  • #2
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input byte id int year long flow
    1 2008 -100000
    1 2010   30000
    1 2012   40000
    1 2013   35000
    end
    
    gen new=0
    xtset id year
    tsfill
    replace flow=0 if new
    drop new
    Res.:

    Code:
    . l, sepby(id)
    
         +---------------------+
         | id   year      flow |
         |---------------------|
      1. |  1   2008   -100000 |
      2. |  1   2009         0 |
      3. |  1   2010     30000 |
      4. |  1   2011         0 |
      5. |  1   2012     40000 |
      6. |  1   2013     35000 |
         +---------------------+
    2. What is the best way to calculate the IRR?
    On calculating IRR, the following community contributed command may help, but I have never used it.

    https://ideas.repec.org/c/boc/bocode/s457597.html
    Last edited by Andrew Musau; 10 Feb 2021, 16:27.

    Comment


    • #3
      Hi,
      I have a similar issue except that :

      1) I have more than one negative flow in my cash flow chronology
      2) Some investment are net losers, so the net current value is negative.

      In that case, IRR by Maximo Sangiacomo does not work.

      Any idea ? I could use the Solver on Excel, but I hope there is a better way to do it !
      Thanks,
      Guillaume

      Comment

      Working...
      X