I am trying to make a new variable that shows if people have a higher value in one variable than another.
For example, ideally I would have
var1 var2 var3
0 0 .
2 0 1
2 2 .
4 17 0
5 1 1
3 5 0
Is there an egen command that allows this?
Thanks!
Tori
Related Posts with Generate var3 for if var1>var2
Means with different base in a loopforeach var in Punjab age_cat Division District2 {
preserve
collapse (count) n_sex_total (mean)sex_t…
Robust Hausman Test for TWFEHello, I am currently writing a thesis on the relationship between public family spending and suicid…
population size on svy: proportion commandHello,
I have surveyed the residents of a city of population 61000 people, obtaining 242 responses. …
Is it possible to specify a different color only for the negative bar?Hello,
I want to change the different colors on the negative bar in my graph.
Code:
input year …
How to use global macros inside conditional statementsHi guys, I'm encountered a syntax problem that should be easy to solve but I still can't nail how to…
Subscribe to:
Post Comments (Atom)
0 Response to Generate var3 for if var1>var2
Post a Comment