Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: st: AW: RE: RE: RE: RE: RE: where did my matrix go after calling -diagt-


From   Paul Seed <[email protected]>
To   "[email protected]" <[email protected]>
Subject   RE: st: AW: RE: RE: RE: RE: RE: where did my matrix go after calling -diagt-
Date   Fri, 19 Feb 2010 21:09:32 +0000

As Nick Cox says, I originally wrote -diagt- & -diagti-,
so will shortly post a new version that fixes the matrix problems
that Moleps and Nick found.

For those in a hurry, it seems that the main problem can be
solved by replacing -clear- with two lines :
   drop _all
   label drop all

-preserve- seems to preserve data and labels, if not matrices,
and that's all that -diagti- needs to change.

How many other things it protects from -clear-, I don't know.
(scalar, cluster, eq, constraint, postutil, _return, mata and everything
done by -discard-).  The manual is not wonderful on this.

The relevant section will read (subject to further checking).

*****************
`star' ROC area
   if _N >0 {
       preserve
       drop _all
       label drop _all
   }
*****************

Changing the version of -clear- does not seem to work

*********************
foreach v of numlist 1/10 {
   mat a=(`v',`v')
   mat l a

   preserve
   cap noi vers `v': clear
   restore

   cap noi mat l a
}
*******************
Incidentally, I find -set trace off-
a very useful line at the start of an ado file when debugging.
I can then put -set trace on- just before the suspect section of
code & get rather fewer than 1 million lines of output.

The undocuments option -star- shows how far the program has got before
things go wrong.


Paul Seed

King's College London, Division of Reproduction and Endocrinology
St Thomas' Hospital, Westminster Bridge Road, London SE1 7EH

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index