Hello.
I'm attempting to create a new variable (metabolic syndrome) based on meeting at least three of five conditions.
gen met=.
. replace met=1 if ((female==1 & waist>35 & waist<.) | (female==0 & waist >40 & waist <.)) ///
> | (a1c>5.7 & a1c<.) | (trigly>=150 & trigly<.) | ((female==1 & hdl<50) ///
> | (female==0 & hdl<40)) | ((sbp>130 & sbp<.) | dbp >85 & dbp<.))
Stata says:
too many ')' or ']'
I suppose I could create variables for each of the conditions and try again. But, the way I've written it would only classify metabolic syndrome if a person met all 5 of the criteria, when they only need to meet at least three.
Anyone have any ideas?
Thanks!
Related Posts with variable with multiple conditions
ivreg2 warning that covariance matrix is not of full rank. But can't figure out whyI am running fixed-effect instrumental variable panel regression. The data is unbalanced panel. The …
replacing all missing ".a" to "."?Dear All, How can I replace all ".a" in the following dataset Code: * Example generated by -dataex…
Interpreting fixed and random effects from a negative binomial mixed modelHi everyone. For a problem I am trying to tackle, I have created a negative binomial mixed model. T…
Recode numeric variables to categoricalHi. I have two numeric variables. I need to build logistic regression, so how to combine those two …
Color SchemeHi I have been using a user written command VennDiagram to draw venn diagram in Stata 15. I wanted …
Subscribe to:
Post Comments (Atom)
0 Response to variable with multiple conditions
Post a Comment