Hi.

I am having trouble with following script. It is a real basic function but I don't know why it does not work.
As you can see below, I am trying to seperate normal and hypertensive group. And I just cannot find out
why htn and htn1 has different number of persons in it.

Please share some wisdom for me. BTW htn group presents actual number.
Many Thanks.

gen htn=1 if sys>140 | dia>90
replace htn=0 if missing(htn)

gen htn1=0 if sys<=140 | dia<=90
replace htn1=1 if missing(htn1)

Array