Announcement

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

  • -centile command-

    Dear Stata users,

    I am wondering, is it possible to generate upper and lower 95% CI of variable V1 as new variable using -centile- command. I have tried -statsby- but no results (all values are missing for median, upper and lower variables).

    Codes:
    PHP Code:
    bys IDcentile V1

     statsby median
    =r(c_50upper=r(ub_50lower=r(lb_50), clear byID): centile V1
    Many thanks
    Last edited by Buyadaa Oyunchimeg; 07 Jun 2019, 03:25.

  • #2
    Your returned values are incorrect.

    Code:
    . sysuse auto,clear
    (1978 Automobile Data)
    
    .  statsby median=r(c_1) upper=r(ub_1) lower=r(lb_1), clear by(fore): centile mpg
    (running centile on estimation sample)
    
          command:  centile mpg
           median:  r(c_1)
            upper:  r(ub_1)
            lower:  r(lb_1)
               by:  foreign
    
    Statsby groups
    ----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
    ..
    
    . l
    
         +--------------------------------------+
         |  foreign   median      upper   lower |
         |--------------------------------------|
      1. | Domestic       19   20.60141      18 |
      2. |  Foreign     24.5   26.13934      21 |
         +--------------------------------------+

    Comment


    • #3
      It works! Thank you so much for your help .

      Comment

      Working...
      X