Hi!
I had previously asked a question around generating the frequency of a variable on here and was introduced to the 'contract' command which is super useful!
I'm stuck on another issue and was hoping to get some input from people here
I have attached a snippet of my data set below, to be brief; this is a dataset that gives us information on each employee (empcode), belonging to a certain unit and their vaccination status (1 being fully vaccinated) by WEEK. What I want to generate, is the cumulative number of people vaccinated in a unit by week. Is there a way I could generate this variable?
I had previously asked a question around generating the frequency of a variable on here and was introduced to the 'contract' command which is super useful!
I'm stuck on another issue and was hoping to get some input from people here
I have attached a snippet of my data set below, to be brief; this is a dataset that gives us information on each employee (empcode), belonging to a certain unit and their vaccination status (1 being fully vaccinated) by WEEK. What I want to generate, is the cumulative number of people vaccinated in a unit by week. Is there a way I could generate this variable?
Code:
* Example generated by -dataex-. For more info, type help dataex clear input long empcode float week str3 factory float year str12 unit float fullyvaccinated 10000001 20 "F01" 2020 "F01" 1 10000001 31 "F01" 2020 "F01" 1 10000001 48 "F01" 2020 "F01" 1 10000001 6 "F01" 2020 "F01" 1 10000001 35 "F01" 2020 "F01" 1 10000001 35 "F01" 2021 "F01" 1 10000001 29 "F01" 2021 "F01" 1 10000001 52 "F01" 2020 "F01" 1 10000001 16 "F01" 2020 "F01" 1 10000001 39 "F01" 2020 "F01" 1 10000001 12 "F01" 2021 "F01" 1 10000001 13 "F01" 2020 "F01" 1 10000001 28 "F01" 2021 "F01" 1 10000001 18 "F01" 2020 "F01" 1 10000001 5 "F01" 2021 "F01" 1 10000001 19 "F01" 2020 "F01" 1 10000001 47 "F01" 2020 "F01" 1 10000001 43 "F01" 2020 "F01" 1 10000001 33 "F01" 2020 "F01" 1 10000001 40 "F01" 2020 "F01" 1 10000001 15 "F01" 2021 "F01" 1 10000001 29 "F01" 2020 "F01" 1 10000001 27 "F01" 2021 "F01" 1 10000001 24 "F01" 2020 "F01" 1 10000001 8 "F01" 2020 "F01" 1 10000001 5 "F01" 2020 "F01" 1 10000001 10 "F01" 2020 "F01" 1 10000001 11 "F01" 2020 "F01" 1 10000001 12 "F01" 2020 "F01" 1 10000001 14 "F01" 2020 "F01" 1 10000001 7 "F01" 2020 "F01" 1 10000001 15 "F01" 2020 "F01" 1 10000001 1 "F01" 2020 "F01" 1 10000001 41 "F01" 2020 "F01" 1 10000001 36 "F01" 2020 "F01" 1 10000001 51 "F01" 2020 "F01" 1 10000001 32 "F01" 2020 "F01" 1 10000001 38 "F01" 2020 "F01" 1 10000001 25 "F01" 2020 "F01" 1 10000001 42 "F01" 2020 "F01" 1 10000001 8 "F01" 2021 "F01" 1 10000001 24 "F01" 2021 "F01" 1 10000001 23 "F01" 2020 "F01" 1 10000001 26 "F01" 2021 "F01" 1 10000001 1 "F01" 2021 "F01" 1 10000001 6 "F01" 2021 "F01" 1 10000001 46 "F01" 2020 "F01" 1 10000001 10 "F01" 2021 "F01" 1 10000001 34 "F01" 2021 "F01" 1 10000001 18 "F01" 2021 "F01" 1 10000001 27 "F01" 2020 "F01" 1 10000001 9 "F01" 2020 "F01" 1 10000001 22 "F01" 2020 "F01" 1 10000001 14 "F01" 2021 "F01" 1 10000001 17 "F01" 2021 "F01" 1 10000001 20 "F01" 2021 "F01" 1 10000001 33 "F01" 2021 "F01" 1 10000001 44 "F01" 2020 "F01" 1 10000001 13 "F01" 2021 "F01" 1 10000001 26 "F01" 2020 "F01" 1 10000001 16 "F01" 2021 "F01" 1 10000001 30 "F01" 2021 "F01" 1 10000001 23 "F01" 2021 "F01" 1 10000001 21 "F01" 2021 "F01" 1 10000001 34 "F01" 2020 "F01" 1 10000001 19 "F01" 2021 "F01" 1 10000001 32 "F01" 2021 "F01" 1 10000001 30 "F01" 2020 "F01" 1 10000001 3 "F01" 2020 "F01" 1 10000001 4 "F01" 2021 "F01" 1 10000001 28 "F01" 2020 "F01" 1 10000001 31 "F01" 2021 "F01" 1 10000001 21 "F01" 2020 "F01" 1 10000001 45 "F01" 2020 "F01" 1 10000001 4 "F01" 2020 "F01" 1 10000001 25 "F01" 2021 "F01" 1 10000001 17 "F01" 2020 "F01" 1 10000001 22 "F01" 2021 "F01" 1 10000001 9 "F01" 2021 "F01" 1 10000001 11 "F01" 2021 "F01" 1 10000001 37 "F01" 2020 "F01" 1 10000001 49 "F01" 2020 "F01" 1 10000001 7 "F01" 2021 "F01" 1 10000001 50 "F01" 2020 "F01" 1 10000001 2 "F01" 2021 "F01" 1 10000001 3 "F01" 2021 "F01" 1 10000001 2 "F01" 2020 "F01" 1 10000002 10 "F01" 2020 "F01" 1 10000002 41 "F01" 2020 "F01" 1 10000002 36 "F01" 2021 "F01" 1 10000002 17 "F01" 2020 "F01" 1 10000002 20 "F01" 2020 "F01" 1 10000002 23 "F01" 2021 "F01" 1 10000002 3 "F01" 2021 "F01" 1 10000002 34 "F01" 2020 "F01" 1 10000002 36 "F01" 2020 "F01" 1 10000002 28 "F01" 2020 "F01" 1 10000002 28 "F01" 2021 "F01" 1 10000002 6 "F01" 2021 "F01" 1 10000002 5 "F01" 2020 "F01" 1 end
Comment