Announcement

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

  • ci2 interferes with esttab

    Hello,

    After hours of troubleshooting code that used to work and stopped doing so, I figured out that the problem was introduced by my new usage of the -ci2- command. After I run the ci2 command the esttab command no longer works. It gives me the error message:
    level() invalid -- invalid number, noninteger value
    r(126);

    Even after I run the commands -clear all- and -eststo clear- this still happens. The only way I have figured to get the problem to go away is to close stata and start a new session.

    So, the question is, is there a more specific clear command to use to resolve this without restarting Stata?

    I also hope this post helps others avoid the same problem.

    Thanks,
    Dan

  • #2
    Your question really isn't clear without more detail, or at a minimum it is too difficult to guess at a good answer from what you have shared. Please help us help you.

    Below I post my guess at what you're doing, using Stata's built-in auto dataset, and I do not experience the problem you describe.

    Try this on your system. If it works, modify it to better match what you're doing, to create a reproducible example that we can run to try to reproduce your problem

    The Statalist FAQ provides advice on effectively posing your questions, posting data, and sharing Stata output. It is particularly helpful to copy commands and output from your Stata Results window and paste them into your Statalist post using code delimiters [CODE] and [/CODE], and to use the dataex command to provide sample data, should you need to do so, as described in section 12 of the FAQ.
    Code:
    . about
    
    Stata/SE 17.0 for Mac (Apple Silicon)
    Revision 23 Aug 2022
    Copyright 1985-2021 StataCorp LLC
    
    Total physical memory: 8.01 GB
    
    Stata license: Single-user  perpetual
    Serial number: ............
      Licensed to: William Lisowski
                   
    
    . which ci2
    /Users/lisowskiw/Library/Application Support/Stata/ado/plus/c/ci2.ado
    *! ci2.ado                      
    *! version 1.01, by PT Seed ([email protected])
    *! Confidence intervals for correlations 
    *! Updated 29 Sept 2001
    *! to work with version 7.0
    
    . which esttab
    /Users/lisowskiw/Library/Application Support/Stata/ado/plus/e/esttab.ado
    *! version 2.1.0  19may2021  Ben Jann
    *! wrapper for estout
    
    . sysuse auto, clear
    (1978 automobile data)
    
    . ci2 price weight, corr
    
    Confidence interval for Pearson's product-moment correlation 
    of price and weight, based on Fisher's transformation.
    Correlation = 0.539 on 74 observations (95% CI: 0.354 to 0.683)
    
    . return list
    
    scalars:
                    r(rho) =  .5386114626004787
                      r(N) =  74
                     r(lb) =  .3536353462007286
                     r(ub) =  .6830463006414125
    
    macros:
                   r(corr) : "Pearson's product-moment"
    
    . ereturn list
    
    . regress price weight length
    
          Source |       SS           df       MS      Number of obs   =        74
    -------------+----------------------------------   F(2, 71)        =     18.91
           Model |   220725280         2   110362640   Prob > F        =    0.0000
        Residual |   414340116        71  5835776.28   R-squared       =    0.3476
    -------------+----------------------------------   Adj R-squared   =    0.3292
           Total |   635065396        73  8699525.97   Root MSE        =    2415.7
    
    ------------------------------------------------------------------------------
           price | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
    -------------+----------------------------------------------------------------
          weight |   4.699065   1.122339     4.19   0.000     2.461184    6.936946
          length |  -97.96031    39.1746    -2.50   0.015    -176.0722   -19.84838
           _cons |   10386.54   4308.159     2.41   0.019     1796.316    18976.76
    ------------------------------------------------------------------------------
    
    . esttab
    
    ----------------------------
                          (1)   
                        price   
    ----------------------------
    weight              4.699***
                       (4.19)   
    
    length             -97.96*  
                      (-2.50)   
    
    _cons             10386.5*  
                       (2.41)   
    ----------------------------
    N                      74   
    ----------------------------
    t statistics in parentheses
    * p<0.05, ** p<0.01, *** p<0.001
    
    .

    Comment

    Working...
    X