hi all,

I have troubles to make a stata code on generating a binary groups based on different conditions, here are the categories:

Diastolic function
0 if E/A-ratio was ≤0.8 and E < 50 cm/s were assigned as having grade I
1 if E/A-ratio was ≤0.8 and E > 50 cm/s or E/A-ratio was between 0.8 and 2.0 three parameters had to be evaluated --> i) E/e’-ratio > 14, (ii) TR velocity > 2.8 m/s, and (iii) LAVI > 34 mL/m2
...If two or three of these criteria (i, ii, iii) were negative, patients were assigned as having Grade I
...If two or three of these were positive, patients had Grade II.
....When patients only had two of the above-mentioned parameters (i, ii, iii) available, two negative criteria were categorized as DDF Grade I, two positives as DDF Grade II, and one positive and one negative as indeterminate.

2 if the E/A-ratio was ≥ 2.0 were assigned as having grade III

Please the picture below. Can anyone help to create a code to dividing this in group?

​​​​​​​Thank you



[ATTACH=CONFIG]temp_21254_1612465386758_585[/ATTACH]