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
Missing values when generating lagged variable in panel dataContext: I'm using Stata 16.1 on Window 10. I have unbalanced panel data with 52 variables and 953 o…
"No Observation" when Trying to run a xtabond commandI am trying to run "xtabond percentageCCIemployment miningandquarryingsic2 manufacturingsic3 electri…
Same id but do not get matched (merge)Dear all, I have a problem that I do not understand why it is occuring. I want to merge two data fil…
Clear Memory ProblemI am working on timeseries data of different states. to check if the prices are stationary for each …
how to simplify the syntax? Code: keep if pvalueInter<.1 & pvalueMed1<.1 & pvalueMed2<.1 & pvalueMed3<.…
Subscribe to:
Post Comments (Atom)
0 Response to If else loop in Stata
Post a Comment