I am trying to generate a new variable using the "if" command based on 3 other variables
ex:
gen completetx=1 if (neo==1 & surgery==1 & adjuvant==1)
However, it seems that stata only reads the first 2 conditions, and ignores the third. Am I doing something wrong? Is it possible to have more than 2 conditions with an if command? Thanks!
Related Posts with if command with 3 conditions
page break between two tables generated by -esttab-?Dear all, Is there a way to add a page break between two tables when using -esttab-? I want my code…
List of observations in regressionHello, I am running a regression in STATA (xtgee). xtgee Profit number_employees company_size , li…
Coefficient of the interaction term of AFT modelDear Statalist, I have a question about the explanation of coefficients of interactions terms of the…
How to increase decimal in league table for network meta-analysisThe league table of network meta-analysis shows only two decimal. I try to increase decimal. Try to …
Panel data: Multiple IDs, partly duplicatedI have received panel data that need lots of cleaning. The most substantial challenge is finding a u…
Subscribe to:
Post Comments (Atom)
0 Response to if command with 3 conditions
Post a Comment