Hi,
I wrote a code like
if x=="x1"|x=="x2" {
replace z=y
replace a=b
}
However, it did not work. I do not know what is wrong with it. Most of the answer I have found use if in for loop, but it should work alone as well, isn't it?
Can you please help!!
Thank you so much.
(Sorry for the basic stuff)
Related Posts with If else loop in Stata
Converting a Continuous Variable to an Ordinal Variable (For Large Numbers)Hi, I have a continuous variable (median household income) from my census data that I am trying to c…
Rebalance Portfolios based on Annual Carbon Emission and Size TrecilesHi all! I need some help with figuring out how to calculate the portfolio returns. Below you can fi…
running firthlogit or relogit on survey dataHello to all. am hoping someone can help with an issue I am having – all roads have led me to this d…
Merging does not have to be unique, is this possible?Hi, I am working with stata and i have a question so i can continue my thesis. I have got a dataset…
Generate a variable with IF ANDI need to crate a variable with IF AND formula, but I did not find it in Stata. Could you please hel…
Subscribe to:
Post Comments (Atom)
0 Response to If else loop in Stata
Post a Comment