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: intcens: how to estimate mean and variance after intcens


From   "PHAM Ngoc Minh" <pham@ri.ncgm.go.jp>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: intcens: how to estimate mean and variance after intcens
Date   Fri, 26 Oct 2012 13:22:05 +0900

Dear Stata users,

I wish to create dummy variables containing missing (.), and thus used
formula COND(IF, THEN, ELSE) but missing (.) no longer existed. An example
as follows:

I need to generate (wcgrp) from waist circumference (wc) as 1, 0 or missing
(.), then typed:

generate wcgrp = cond(wc>90&wc!=.&sex==1|wc>80&wc!=.&sex==2, 1, 0)

but (wcgrp) had only 1 and 0, and missing was regarded as 0. Then, I tried

generate wcgrp = cond(wc>90&wc!=.sex==1|wc>80"wc!=.&sex==2, 1, 0, .), but
nothing changed.

Are my commands correct? Anyone knows the solution, please give your help.

Thank you

Ngoc Minh Pham, Research associate
National Center for Global Health and Medicine, Japan.
pham@ri.ncgm.go.jp




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


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