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
multiple criteria across several variablesHi there Sorry if this is really basic, but I want to flag every observation where both values 3 an…
Xtlogit vs Logit.Dear respected Members, I’m not professional in Stata. Sorry, Pls could anyone help and offer me an …
Resetting IndexHello, I have a panel dataset containing three vars: nation, year, and a variable called 'event' wh…
Calculating sample size with more parametersHello, I am trying to calculate sample size with the parameters below. I used the code below to cal…
2SLS on Panel DataHi guys! I'm using 2SLS on Panel Data, however when I calculate 2SLS manually, I mean, by doing: F…
Subscribe to:
Post Comments (Atom)
0 Response to Shortcut for generating new variables based on many existing
Post a Comment