Statalist The Stata Listserver

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

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

From   "Svend Juul" <SJ@SOCI.AU.DK>
To   <>
Subject   Re: st: check 2 of 3 variables agree a majority decision captured in4th variable
Date   Thu, 5 Oct 2006 11:59:12 +0200

Eamonn O'Brien wrote:

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?

Let the values be 1-5, with 1 meaning normal and 5 severe. Now,
according to your rules:

var1  var2  var3  var4
  3     3     4     3
  2     3     4     4

In the first case, the result is 3 (majority decision). In the second
case, the result is 4 (all three differ; take the worst). This does not
look consistent to me. A simple, but less inconsistent solution is to
take the mean:
  egen v4=rowmean(var1-var3)
  generate var4=round(v4)

You should decide what to do with 2.5; should it be rounded up or down?


Svend Juul
Institut for Folkesundhed, Afdeling for Epidemiologi
(Institute of Public Health, Department of Epidemiology)
Vennelyst Boulevard 6
DK-8000  Aarhus C, Denmark
Phone: +45 8942 6090
Home:  +45 8693 7796

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index