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: detecting a complete data set


From   Maarten buis <[email protected]>
To   [email protected]
Subject   Re: st: detecting a complete data set
Date   Tue, 16 Nov 2010 15:01:48 +0000 (GMT)

--- On Tue, 16/11/10, Donald Spady wrote:
> I assume that if complete takes the value 0 that there
> are missing data, and if it takes the value 1 then the
> data are complete.

Yes, I use the convention that 1 equals "true" or "on" 
and 0 equals "false" or "off". So if an observation has
a 1 on the variable complete then it is complete, and 
when it has a 0 than it is not complete. 

> I am unsure about the grammer of "gen byte complete =
> totmis == 0"  Does this mean "generate complete = 1 IF
> totmis == 0"

No, you can read this command as follows:
gen byte complete = ( totmis == 0 )

The logical statement -( totmis == 0 )- returns a 1 if it
is true and a 0 if it is false.

An alternative way of creating this variable would be:
gen byte complete = cond( totmis == 0, 1, 0 )

see -help cond- for this latter solution.

Hope this helps,
Maarten

--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany

http://www.maartenbuis.nl
--------------------------


      

*
*   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