Hi everyone,
I am working in a database where each patient has fifteen procedure variables: proc1 proc2 proc3 ... proc14 proc15
I would like to generate a new variable, "int", if any variable from proc1-proc15 == "intubation".
Is there a more efficient way to achieve this than:
generate int = 0
replace int = 1 if proc1=="intubation"|proc2=="intubation"|proc3=="in tubation"|proc4=="intubation"|proc5=="intubation"| etc etc etc
Thank you in advance!
Related Posts with Querying multiple variables at a time
Problem with estimation of coefficient in panel regressionMy aim is to estimate the association between a country's real per capita growth (realgthpc) and exp…
Redistributing a Group's percentiles in panel dataHi, this is my first post in Statalist and I'm hoping you can help me. I am using a panel data set …
MisstableHello, Looking to do misstable summarize. I have a variable split into cases and controls. Then I h…
Generating mean returns, based on xtile returnsHi comminuty, I seem to have problems with calculating mean returns (ret_sup in my data). My datase…
Geonear producing unstable resultsI'm trying to use geonear to identify the nearest neighbors within a dataset at the household-day le…
Subscribe to:
Post Comments (Atom)
0 Response to Querying multiple variables at a time
Post a Comment