Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: table copy of output failed


From   sdriver@stata.com (Shannon Driver, StataCorp)
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: table copy of output failed
Date   Fri, 30 Apr 2004 10:50:05 -0500

"Ling, Qiang" <qal3@cdc.gov> wrote:

> I encountered a strange difficulties in table copy of output into excel.
> Table copy of a standard output from a regression model works fine by
> paste into seperate excel cells. But I have a user-defined ado file and
> the output looks like the below, which contains vertical bars. I failed
> to do table copy, I can not paste them into excel in separate cells. 
> 
>      +--------------------------------------------------------+
>      | start    end   subjects   deaths    p_years     d_rate |
>      |--------------------------------------------------------|
>   1. |  0.00   1.00      31615     2184   30173.08   0.072382 |
>   2. |  1.00   2.00      29431      902   27476.75   0.032828 |
>   3. |  2.00   3.00      25547      635   23279.75   0.027277 |
>   4. |  3.00   4.00      21360      449   19077.50   0.023536 |
>   5. |  4.00   5.00      17034      312   14571.08   0.021412 |
>      |--------------------------------------------------------|
>   6. |  5.00   6.00      12426      202    9772.25   0.020671 |
>   7. |  6.00   7.00       7238       77    3844.83   0.020027 |
>      +--------------------------------------------------------+
> 
> The code used for this piece of output I think is 
> 
> * main table display
>     di ""
>     di in gr "Table of crude and relative survival probabilities"
>     di in gr "(expressed as percentages with 95% confidence intervals)"
>     if "`display'"=="l" | "`display'"=="m" | "`display'"==""  {
>         list start end deaths alpha Crude Cr_lo Cr_up RelS Re_lo Re_up
> I, noobs nodisp
>     }
>     if "`display'"=="s" {
>         list start end deaths alpha Crude Cr_lo Cr_up RelS Re_lo Re_up I
> if `key', noobs nodisp
>     }
>     di ""
>     di in gr "Sum of absolute values of 1st derivatives  " in ye `cdl1'
>     di in gr "Root sum of absolute values of 2nd derivatives  " in ye
> `cdl2'
>     di in gr "Number of iterations  " in ye `iter'
>     if `cdl1'>1 {di in re "WARNING: non-convergence in some interval"}
>     restore
>     end

I don't think this portion of code created the output above.  The output
appears to be from the -list- command.  The only two -list- commands in this
code use the "noobs" option, and this output contains the observation numbers.

The behavior you describe is a shortcoming of the "Copy Table" feature in
Stata.  We have fixed the problem, and you can expect to see our fix in the
next executable update.

In the meantime, a quick workaround would be to use the "clean" option with the
-list- command.

     . list, clean

            start    end   subjects   deaths    p_years     d_rate  
       1.    0.00   1.00      31615     2184   30173.08   0.072382  
       2.    1.00   2.00      29431      902   27476.75   0.032828  
       3.    2.00   3.00      25547      635   23279.75   0.027277  
       4.    3.00   4.00      21360      449   19077.50   0.023536  
       5.    4.00   5.00      17034      312   14571.08   0.021412  
       6.    5.00   6.00      12426      202    9772.25   0.020671  
       7.    6.00   7.00       7238       77    3844.83   0.020027  

     . list, clean noobs

         start    end   subjects   deaths    p_years     d_rate  
          0.00   1.00      31615     2184   30173.08   0.072382  
          1.00   2.00      29431      902   27476.75   0.032828  
          2.00   3.00      25547      635   23279.75   0.027277  
          3.00   4.00      21360      449   19077.50   0.023536  
          4.00   5.00      17034      312   14571.08   0.021412  
          5.00   6.00      12426      202    9772.25   0.020671  
          6.00   7.00       7238       77    3844.83   0.020027  

--Shannon Driver
  sdriver@stata.com

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index