Announcement

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

  • Assistance with changing display output

    Hi Stata community,

    I need assistance with displaying the 95% confidence intervals of a column total. I need these presented as accurately as possible as they represent an amount of money. However, when I use the "Total" command I get the output expressed in exponential notation (e.g., 5.64e+07) and confidence interval in the same way. I have tried to change the variable format from float to long but this hasn't helped. We can use the "webuse total" dataset as an example. Thank you in advance for your assistance.

    Sikhumbuzo
    Click image for larger version

Name:	Total_SM_Webuse.jpg
Views:	1
Size:	31.1 KB
ID:	1718248

  • #2
    Thanks for your reproducible example. Look at the saved results as documented in the help for total

    Code:
    . webuse total, clear
    (Fictional incidence of heart-attack data)
    
    . total swgt
    
    Total estimation                         Number of obs = 4,946
    
    --------------------------------------------------------------
                 |      Total   Std. err.     [95% conf. interval]
    -------------+------------------------------------------------
            swgt |   5.64e+07   505566.5      5.54e+07    5.74e+07
    --------------------------------------------------------------
    
    . help total 
    
    . ereturn list
    
    scalars:
                   e(df_r) =  4945
                 e(N_over) =  1
                      e(N) =  4946
                   e(k_eq) =  1
                   e(rank) =  1
    
    macros:
                e(cmdline) : "total swgt"
                    e(cmd) : "total"
                    e(vce) : "analytic"
                  e(title) : "Total estimation"
              e(estat_cmd) : "estat_vce_only"
                e(varlist) : "swgt"
           e(marginsnotok) : "_ALL"
             e(properties) : "b V"
    
    matrices:
                      e(b) :  1 x 1
                      e(V) :  1 x 1
                     e(_N) :  1 x 1
                  e(error) :  1 x 1
    
    functions:
                 e(sample)   
    
    . mat li e(b)
    
    symmetric e(b)[1,1]
            swgt
    y1  56379012
    
    . scalar wanted = e(b)[1,1]
    
    . di wanted
    56379012

    Comment


    • #3
      Dear Nick,

      Thank you for the prompt response and guidance. My challenge is that the above example still doesn't give me 95% confidence intervals.

      Sikhumbuzo

      Comment


      • #4
        It's the same answer. Reading the help tells you where results are stored. See the lines for ll and ul below.

        r(table) matrix containing the coefficients with their standard errors, test statistics, p-values, and confidence intervals
        Code:
        . mat li r(table)
        
        r(table)[9,1]
                     swgt
             b   56379012
            se  505566.51
             t  111.51651
        pvalue          0
            ll   55387877
            ul   57370147
            df       4945
          crit  1.9604438
         eform          0

        Comment


        • #5
          Thank you Nick,

          I had missed that. Thanks for your guidance.

          Regards,
          Sikhumbuzo

          Comment

          Working...
          X