I have groups of variables contactoutcome_con_<y>_<x> and contactmethod_con_<y>_<x>, where x is a program from 1-8 and where y indexes the contact attempt (goes from 1-30) associated with that program. For example, contactoutcome_con_30_8 is the outcome of the 30th contact attempt made by the 8th program, and contactmethod_con_30_8 is the contact method that was used for that attempt. I need to generate a new variable "contact_success" based on the values of these two variable. For example, contact_success should = 0 if contactoutcome_con_<y>_<x>==9 AND contactmethod_con_<y>_<x>==11. What is the shortcut for doing this for all the 240 matching contactoutcome_con_<y>_<x> and contactmethod_con_<y>_<x> pairs? Thanks in advance!
Related Posts with Shortcut for generating new variables based on many existing
Omitted Variable in Margin Order Probit/LogitDear all, I'm having troubles with a simple ordered probit model. Indeed, I am doing a research to …
spread one number within a groupI have a data set looking like this, when fic is not USA, local_markup is missing value. For the mis…
estimating percentiles of gamma distributionHi, I'm a new stata user and currently I'm trying to fit a gamma distribution to my data and compute…
Add legend using grqregHi, I want to add legend after running grqreg. the codes are . webuse auto, clear . sqreg price wei…
generate variable that can change every yearHi guys, I wanna thank you first, cause I have received so much help here. This is such a great foru…
Subscribe to:
Post Comments (Atom)
0 Response to Shortcut for generating new variables based on many existing
Post a Comment