Hello all, I have initially posted this inappropriately, am sorry. I am creating a better representation of the issue so I can get help on this. I have a dataset with category (teachers, students) and a list of forms (form2, event46, case32) which they are expected to fill within 60days after the school resume. Event46 has a group variable (grp=A, B, C). That is someone can be in any of the group. Among the teachers and students, some did not fill the form (0), some filled the form within 30 days (1), and some filled the form within 60 days (2). The 0,1,2 represents the days that the form was filled below: No form filled=0 Form filled within 0-30days=1 Form filled within 31-60days=2 This is what I want Table 1: 1. If a teacher or student only filled form2 within 30days and did not fill event46 or case32 they should be in the form2 only column. Same apply for other forms. If they filled the form after 30 days, they will be in the 31-60 days count by category. 2. If anyone filled more than one(1) forms either within 30 days or within 60 days or both, they should be in the multiple column. Table 2: 3. Finally, I want a total of those who did not fill any form in both category(teacher or student). I have created a sample output and a demo dataset. Thanks so much for your help. data have;
input category $ form2 case32 event46 grp $;
datalines;
Teacher 1 0 0 .
Student 1 0 0 .
Teacher 0 1 0 .
Teacher 1 0 1 A
Teacher 0 0 1 C
Teacher 0 0 1 B
Teacher 1 0 0 .
Student 0 1 1 C
Student 0 0 1 C
Student 0 0 1 C
Student 1 0 0 .
Student 0 1 0 .
Student 0 2 0 .
Teacher 1 1 1 B
Teacher 0 0 2 A
Teacher 0 0 2 B
Teacher 2 0 0 .
Student 0 1 1 C
Teacher 0 0 0 .
Student 0 0 0 .
Student 0 0 1 B
Teacher 0 0 1 B
Teacher 0 2 0 .
Teacher 2 2 0 .
Student 0 1 0 .
Teacher 2 0 1 A
Student 0 0 1 A
Teacher 0 0 0 .
Student 2 0 0 .
Teacher 0 0 2 C
Student 0 0 2 C
Student 0 0 2 B
Student 0 0 2 A
;
run; The expected output should look like this: Form2 only Case32 only Event46 A only Event46 B only Event46 C Only Multiple Total Teacher fill form within 0-30 days Teacher fill form within 31-60 days Student fill form within 0-30days Student fill form within 31-60days Total Total Teacher who did not complete any form within 0-60 days Student who did not complete any form within 0-60 days Total
... View more