Announcement

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

  • Excel's XIRR function in Stata

    Hi Forum

    I am attempting to perform financial investment performance analysis.

    For small test sample I used Excel's XIRR function.

    I have done a quick search for a Stata user-written module to do the equivalent of Excel’s XIRR but haven’t found one.

    Has anyone got some suggestions?

    Thanks

    Mark

  • #2
    for those of us who do not have access to Excel, it might help if you told us what the XIRR function is (does)

    Comment


    • #3
      Excel define xirr as the internal rate of return for a schedule of cash flows that is not necessarily periodic.
      See:
      Code:
      net describe finxirr, from(http://www.stata.com/users/kcrow)
      Using the example at: https://support.office.com/en-us/art...B-A303AD9ADC9D

      Code:
      clear
      input float(values date)
      -10000 17532
        2750 17592
        4250 17835
        3250 17943
        2750 17988
      end
      format %td date
      tsset date , daily
      finxirr values

      Comment


      • #4
        Thanks Scott

        The finxirr code worked (reconfirmed by testing against Excel's XIRR function).

        . finxirr amount

        XIRR, Extented internal rate of return = .373

        However, the result is displayed in the Results Window. I would like the result to be included as a new variable.

        I tried the following commands without success:

        . finxirr amount, gen newvar = XIRR
        option gen not allowed
        r(198);

        . finxirr amount, egen newvar = XIRR
        option egen not allowed
        r(198);

        Any suggestions would be greatly appreciated.

        Mark

        Comment


        • #5
          Hi Scott

          I have managed to work it out:

          return list

          scalars:
          r(xirr) = .3733622534072042

          . generate XIRR = `r(xirr)'

          Thanks

          Mark

          Comment

          Working...
          X