Statalist


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

Re: st: Check that recode work


From   Maarten buis <[email protected]>
To   [email protected]
Subject   Re: st: Check that recode work
Date   Tue, 10 Mar 2009 13:21:46 +0000 (GMT)

--- On Tue, 10/3/09, Tomas Lind wrote:
> I would like to see the value of Z for combinations of A
> and B  (or for combinations of A, B and C). Missing should be 
> regarded as a category.

You can use -tab- with the -bys- prefix and the -missing- 
option, like in the example below. I also find it useful 
in this kind of datapreparation tasks to include several 
-assert- statements. Those -assert- have saved me a 
couple of times. For more, see: 
Gould, William (2003) "Stata tip 3: How to be assertive", 
The Stata Journal, 3(4): 448. 
http://www.stata-journal.com/article.html?article=dm0003

*--------------- begin example ---------------------
sysuse auto, clear
sum price , meanonly
gen expensive = price > r(mean) if price < .
bys expensive: tab rep78 foreign, missing
assert foreign == 0 if expensive == 0 & rep78 == 1
*----------------- end example ---------------------
(For more on how to use examples I sent to the Statalist, see
http://home.fsw.vu.nl/m.buis/stata/exampleFAQ.html )

Hope this helps,
Maarten

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

http://home.fsw.vu.nl/m.buis/
-----------------------------------------


      

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index