# Re: st: complex generating criteria

 From Svend Juul To Subject Re: st: complex generating criteria Date Thu, 16 Oct 2008 21:48:50 +0200

```sham wrote:

I'm working on a dataset that has recorded the drug
treatment and their response for a number of patients
over one year.

however to assign them one of 3 "improved responses"
there is a standard definition.

That is a improvement of 30% (a percentage increase)
in 3 of any 6 clinical variables and a decrease in no
more than 1. this gives them a  criteria of "acr30".

In addition to this, I also wish to create improvement
of 50% and 70%, and combine them into one categorical variable.
I was wondering what the best way of doing this would be?

=========================================================

In the following example I assume that the response variables
are before1, after1, before2, ... , after6.

// calculate number of increases > 30% (inc30) and decreases
generate inc30=0   // increased more than 30%
generate decr=0    // decreased
forvalues I = 1/6 {
replace inc30=inc30+1 if after`I' > 1.3*before`I' & after`I'<.
replace decr = decr+1 if after`I' < before`I'
}

// Improved according to criteria
generate improved = inc30>2 & inc30<. & decr==0

Hope this helps
Svend

________________________________________________________

Svend Juul
Institut for Folkesundhed, Afdeling for Epidemiologi
(Institute of Public Health, Department of Epidemiology)
Vennelyst Boulevard 6
DK-8000 Aarhus C,  Denmark
Phone, work:   +45 8942 6090
Phone, home:   +45 8693 7796
Fax:           +45 8613 1580
E-mail:        sj@soci.au.dk
_________________________________________________________

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