Statalist The Stata Listserver


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

st: RE: check 2 of 3 variables agree a majority decision captured in4th variable


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: check 2 of 3 variables agree a majority decision captured in4th variable
Date   Thu, 5 Oct 2006 10:18:05 +0100

This sounds best handled as an initial -generate-
followed by a series of -replace ... if ...-. 

That is not to rule out the usefulness of -assert-. 

Be aware also of -max()- and -cond()-. In the latter 
case there is a leisurely tutorial: 

SJ-5-3  pr0016  . . Depending on conditions: a tutorial on the cond() function
        . . . . . . . . . . . . . . . . . . . . . . . D. Kantor and S. B. Else 
        Q3/05   SJ 5(3):413--420                                 (no commands)
        tutorial on the cond() function

Nick 
n.j.cox@durham.ac.uk 

Eamonn O'Brien
 
> I wonder if someone can get me started on how to approach a problem I
> wish to solve. I have searched the archives and not seen 
> anything that's
> too similar.
> 
> I have variables var1, var2, var3 & var4. Variables var1 var2 & var3
> are three independent results of a screening test. The independent
> result (ordered categorical) is either normal, borderline, 
> mild, mod or
> severe. Variable Var4 is the final result and it is meant to 
> be based on
> the majority decision. So if var1 & var3 are borderline for example,
> var4 should be borderline, regardless of var2. Another 
> example, if var2
> & var3 are severe, var4 should be severe regardless of var1. Where all
> three differ I would like to check that var4 is the worst of 
> var1, var2,
> var3. If I can get started I think I can develop it to check 
> for missing
> values, but I am not sure if I should approach this problem with if
> statements or -assert- or something else?

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