Dear all,
I am working on a dataset where households own different assets and I want to generate a new dummy variable (adownership) that reflects whether their "ownership score" is adequate or not. For this purpose, I am using 6 other dummy variables (whether they own a radio, a phone...).
For my new dummy to be adequate (that is to say =1), I want at least 4 out of 6 dummy variables to be positive. This can be any combination of the 6 dummy variables (that I called adradio, adphone, adspray, adkra, adsto, adchi). My initial idea was to generate a new variable that would take the value 1 by listing all the possible combinations but I believe this is quite tedious and prone to errors.
Does anyone have a better solution on how to proceed?
Thank you very much in advance!
Related Posts with Creating a new dummy if at least 2/3 of some other dummies are positive
Store entropy balancing results as new variablesI have a dozen variables that have undergone entropy balancing and achieved perfect balance between …
Correlation between variables over time in panel dataHow do I go about displaying the change in correlation between two variables over time? I have a pan…
Creating Bar Graph colors depending on Y-valueHello: I am having trouble creating a bar graph where the color of the bars depend on the y-value th…
First Stage F Statistics ivreg2 Hello I am trying to use the following code to report the first stage results , I am unable to ge…
In Medsem package, what is "delta" column for?In Medsem package, what is "delta" column for? and why is it almost always the same as sobel test? …
Subscribe to:
Post Comments (Atom)
0 Response to Creating a new dummy if at least 2/3 of some other dummies are positive
Post a Comment