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
generating series variable with specific conditionhello and good day to all, this is a part of my data : Code: date country wpui_code wpui …
how to drop a bar like this , thanks!How to drop a bar like this ,thanks very much! * Example generated by -dataex-. To install: ssc ins…
Update to -moremata- available from SSCThanks to Kit Baum, an update to the -moremata- package is available from SSC. To install the update…
Update to -robreg- available from SSCThanks to Kit Baum, an update to the -robreg- package is available from SSC. To install the update, …
Dates: conversion and formattingDear Statalists, I am using monthly data that are like "01jan1980" "01feb1980" etc. After the upload…
Subscribe to:
Post Comments (Atom)
0 Response to Querying multiple variables at a time
Post a Comment