Announcement

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

  • Showing results only in Quintile 1 and 5 please

    Dear friends,

    I have a question regarding displaying results within the quintile size =1 and quintile size = 5 only.

    I have assigned my continuous variable firm size (lnsize) 5 ranks as below:
    egen quintile_lnsize = xtile(lnsize), by(fyear) nq(5)

    So now in my panel data, i want my results to be restricted under Size Quintile =1, what is the command to be able to do this?

    Something like Tabstat ... in range ( .....)

    Can someone help me pls!!!

    Many thanks,
    Stanny

  • #2
    Not in but if is needed here. Compare the effects of adding these conditions to commands.

    Code:
    if quintile == 1
    if quintile == 5
    if inlist(quintile, 1, 5)
    if quintile == 1 | quintile == 5

    Comment


    • #3
      Looks like that command is in the egenmore package. You need to look up the if/in statements, like list if quintile_lnsize==1. See help if.

      Comment


      • #4
        Nick Cox Hi Nick, thank you for the reply. I have tried adapting your command, but it shows as the following:


        egen quartile_gindex = xtile(gindex), by(fyear) nq(4)
        (142006 missing values generated)
        egen decile_lnsize = xtile(lnsize), by(fyear) nq(10)
        tabstat cash if inrange(fyear,1993,2004) & quartile_gindex == 1 & decile_lnsize == 1, s(median)
        no observations


        My dataset is huge and it is a panel data, and i only want to find out the median cash level for the smallest firm size group at the lowest gindex over the time period 1993-2004.

        Any ideas on this?
        Many thanks!

        Comment


        • #5
          Stata is telling you that no observations are in the years specified AND also in the first quarter (lowest 25%) of one variable AND also in the lowest tenth (lowest 10%) of another variable. If you don't believe that, look at the results of

          Code:
          tab decile_lnsize quartile_gindex if inrange(fyear, 1993, 2004), missing
          Either your data are not as you think or there is some mistake upstream.

          Comment


          • #6
            Nick Cox thank you very much!!

            Comment

            Working...
            X