Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: RE: RE: RE: statalist-digest V4 #2935 - strange world


From   "Austin Nichols" <[email protected]>
To   [email protected]
Subject   Re: st: RE: RE: RE: statalist-digest V4 #2935 - strange world
Date   Tue, 8 Jan 2008 13:03:49 -0500

Nick--
Of course, -generate- and -replace- already produce warning messages
regarding missings, not all of which strike me as perfect, that are
turned off by prefixing by -quietly- in the usual way.  E.g.

. g x=.
(730138 missing values generated)
. g ok=x>0
. replace x=1 in 1/1000
(1000 real changes made)
. replace x=.a in 900/1100
(201 real changes made, 201 to missing)

Note that the last command changes 100 missing values to a different
missing value, but the count of changes to missing includes all obs
replaced.

So the proposal is just to add a warning so it might say instead for
the first two commands:

. g x=.
(730138 missing values generated)
. g ok=x>0
(730138 missing values evaluated)

and I would change the existing behavior for the fourth command to produce:

. replace x=.a in 900/1100
(201 real changes made, 101 from real to missing, 100 from missing to missing)

but this is all a matter of taste really.  No one can stop users from
misusing the language, no matter how many safeguards and warning
messages are put in place.  And I agree I would put 3D graphics higher
on my wishlist, though that is a much taller order.

On Jan 8, 2008 12:27 PM, Nick Cox <[email protected]> wrote:
> Warnings are an interesting idea. In principle, I have
> absolutely no objections to StataCorp providing warnings
> if they can
>
> 1. Provide a way of turning them off too. Large, complex datasets,
> which means most of them, could otherwise be analysed only
> with a permanent cacophonous chorus in the background.
>
> 2. Devise fairly consistent criteria for what kinds of warnings
> are produced.
>
> 3. Be confident that this is more important as an extra feature
> than filling other longstanding gaps in Stata. If Stata 11
> doesn't include 3-D graphics, I will ... [Sorry, have to go now.]
>
> Nick
> [email protected]
>
>
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Austin
> Nichols
> Sent: 08 January 2008 17:15
> To: [email protected]
> Subject: Re: st: RE: RE: RE: statalist-digest V4 #2935 - strange world
>
> Nick--
> As usual, I agree with most of your points, but Allan raises a
> different objection--he does not want Stata to stop treating (.) as
> more than any finite number, or (.a) as more than (.), but only to
> report that it is doing so when a calculation or comparison involves
> missing values.  I think that warning messages are a very good idea,
> while changing Stata's logic is a very bad one.  This behavior of
> missing values seems to confuse enough people to justify a (small) set
> of warnings for these kinds of cases.  The trouble is, the warning
> message would have to trap every -if- qualifier on every command,
> which sounds like it could involve a lot of work.  Maybe just
> -generate- and -replace- would be a good start?  In that case, you
> would also want a warning message for a statement like
> . gen hirep=rep78>3
>
> On Jan 8, 2008 11:39 AM, Nick Cox <[email protected]> wrote:
> > I am with StataCorp on this, not that they need my
> > support.
> <snip>
> > Allan Reese
> > ===========
> >
> > Others have pointed out that "if x>y" in Stata evaluates as True when
> x
> > is missing "."
> >
> > I've raised this before and had to accept as a feature of Stata that
> "."
> > is a big number and "computers do what you tell them, not what you
> > want."  Nevertheless, I remain of the opinion that it is
> > counter-intuitive, logically incorrect, and undoubtedly leads to
> > computer-assisted errors.  Changing the operation of Stata now would
> > inconvenience most current users, but it would not be inconsistent if
> > the kernel were adapted to output a warning after such calculations
> > "Missing values included - check your results".
>
>
> *
> *   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/
>
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index