Hi Statalist,
I am trying to create a new variable (choice) which notes whether a graduate attended (collatt) one of their first or second choice universities (dummies of which being collprf1 and collprf2).
I have generated a new variable: gen 'choice'=0
following this I need to use: replace choice =1 if collatt==collprf1 OR collatt==collprf2
however I am unsure how to incorporate this either/or dimension in to the command.
any help would be greatly appreciated.
Oliver
Related Posts with How do I incorporate 'or' in to a stata command for generating a new variable
Difficulty aggregating variables to the unit of analysis without losing or altering dataHello, I'm a first year grad student that is fairly new to Stata. I'm working on a project in which…
How to convert weekly stock prices into monthlyDear all, I am currently writing my thesis about PE-backed IPOs and therefore am calculating the BHA…
create a new var extracting part of string with varying lengthHi, How can I create a new var(var2) extracting part of string from var1 with varying length? The s…
create a new var extracting part of string with different lengthHi, How can I create a new var(var2) extracting part of string from var1 with different length? The…
bysort gen n = _n with if condition 1/2/3/4 is trueHello everybody, I have a hospital list (ik) doing several surgeries (haupt_op). Now I want create a…
Subscribe to:
Post Comments (Atom)
0 Response to How do I incorporate 'or' in to a stata command for generating a new variable
Post a Comment