Announcement

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

  • portfolios

    Hi.
    I have 100 firm ids, Ratio1, Ratio2 and Returns in columns. I need to calculate average returns of the portfolio of firms- the intersection of 'top 20 ratio1' firms and 'lower quintile of ratio2' firms. help me to initiate the code. Thank you.

  • #2
    Chandana:
    as per FAQ, please do not post the same query for the umpteenth time, as some listers may feel bothered by this and legally decide not to reply to your question anymore.
    That said, if I get well what you asking for:
    to calculate average returns of the portfolio of firms
    Code:
    summarize Returns
    Please be more specific about what you mean with the statement
    the intersection of 'top 20 ratio1' firms and 'lower quintile of ratio2' firms
    . Do you mean the average returns of firms which are are the same time the top 20 performers in Ratio1 variable and belong to the lower quintile of Ratio2 variable?
    Anyway, if my wild guess about your statement is correct, you may want to try:
    Code:
    centile Ratio2 , centile(20)
    return list
    g Indicator=1 if Ratio2<=r(c_1)
    sort Ratio1 
    sum Return if Ratio1!=. & Indicator==1 in 80/100
    Eventually, as command like -summmarize- are among the building-blocks of Stata capabilities, I would urge you to take a tour through Stata commands by yourself, starting out with Stata 13.1 .pdf manual entries.

    Kind regards,
    Carlo
    Last edited by Carlo Lazzaro; 10 Oct 2014, 00:45. Reason: An add-on to my previous reply.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Hi sir, apologies for insufficient information, and beginner level postings.
      Firms need sorting first on Ratio1 and then on Ratio2. Portfolio should consist of firms in both top 20 in Ratio1 and lower quintile in Ratio2. then need average of returns of this set of firms.
      Appreciate your advise greatly.

      Comment


      • #4
        Chandana:
        I am not clear about your need for sorting your dataset
        ... on Ratio2
        [too] if what you are after is
        the intersection of 'top 20 ratio1' firms and 'lower quintile of ratio2' firms
        I would ask you to try:
        Code:
        centile Ratio2 , centile(20) 
        return list
        g Indicatore=1 if Ratio2<=r(c_1)
        sort Ratio1
        sum Return if Ratio1!=. & Ind==1 in 80/100
        and report what happens.

        Kind regards,
        Carlo
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Hi sir:
          it achieves my objective sufficiently, now I can develop it further. Thanks and bless!

          Comment


          • #6
            Chandana:
            thanks a lot for closing this thread.
            Kind regards
            (please, call me) Carlo
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment

            Working...
            X