Hello,
I have a longitudinal dataset (example below) and I would like to keep the variables where individuals answer both to "jbsat" and "abused" in both waves. Can you please help me with the code?
Thank you in advance.
I have a longitudinal dataset (example below) and I would like to keep the variables where individuals answer both to "jbsat" and "abused" in both waves. Can you please help me with the code?
Thank you in advance.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input byte jbsat float abused long pidp int dvage 6 0 272238687 53 . 0 1429166207 65 . 0 410562247 53 7 0 408957451 60 5 1 1021413047 51 5 0 1157811539 23 7 0 1292038767 65 . 0 367828329 37 5 0 410567687 49 6 0 342026415 30 4 1 274411287 37 4 0 136255007 61 . 0 204671847 69 5 1 476031301 24 6 0 884396451 27 . 0 410593527 54 6 0 1156820087 45 6 0 817969971 54 6 1 1564067331 62 . 0 410600331 18 4 0 342305887 55 6 0 476295127 55 6 0 1632140767 55 6 0 700830449 43 1 1 204994171 56 6 0 273015931 41 . 0 1292905767 76 . 0 1156448807 71 7 0 544184971 51 . 0 545266167 71 7 0 680529045 62 . 0 1360684087 61 6 0 136126487 45 5 0 496921565 49 . 0 410860085 75 6 0 410881845 45 . 0 816336611 43 6 0 683200085 70 7 1 273200207 71 . 0 341330767 80 6 0 1429297451 47 7 0 136399855 18 6 0 410953925 52 4 0 204004095 32 7 0 817726527 51 5 0 1020901691 47 . 0 557895821 16 2 0 411071573 59 6 0 411071573 65 5 0 558048133 36 6 0 1428275407 36 5 0 953045847 37 5 0 1225617047 61 6 0 411169485 68 . 0 1292006807 70 . 0 682171935 16 7 0 749207011 48 6 0 477606169 77 2 0 748533131 54 5 0 411286445 51 2 0 1224479407 43 6 1 884665727 52 . 0 205283859 34 6 0 681335533 25 5 0 361357445 42 . 0 1020211487 68 6 0 1157296103 27 6 0 1429068971 58 . 0 817175727 66 6 0 411338125 37 7 0 1088680691 43 5 0 411346973 50 . 0 136133287 71 6 0 409027491 66 . 0 408696339 20 . 0 204038767 72 . 0 411390489 40 7 0 1633184567 65 6 0 231680093 28 5 0 411495205 55 . 0 411558445 70 5 0 749221979 20 6 0 411568649 42 5 0 411568649 49 5 0 411578165 48 . 0 476283571 68 . 0 411578173 18 7 0 477110451 67 6 0 411612845 62 6 0 409332811 72 5 0 1429634047 49 . 0 681193407 66 6 0 1020187691 46 7 0 952630367 48 . 0 411752245 78 6 0 408611335 27 6 0 411808013 41 6 0 750630927 32 . 0 136133287 65 5 0 205904687 56 end label values jbsat e_jbsat label def e_jbsat 1 "completely dissatisfied", modify label def e_jbsat 2 "mostly dissatisfied", modify label def e_jbsat 4 "neither satisfied or dissatisfied", modify label def e_jbsat 5 "somewhat satisfied", modify label def e_jbsat 6 "mostly satisfied", modify label def e_jbsat 7 "completely satisfied", modify label values abused abc label def abc 0 "not abused at work", modify label def abc 1 "abused at work", modify label values dvage e_dvage
Comment