My previous post tells me I clearly did not have an accurate picture of my data. Earlier, I had said I wanted to count the number of ssn in the data. My objective was to determine the number of absences for each teacher. My approach was short-sighted. Consider "Smith." It appears he was absent 4 days but this is not so. Smith works at two different schools (Park and West) so each school reported the absence for Jan 22 and 23. He was only absent 2 days. I need the count of each teacher's ssn BY school.
Obs | school | ssn | last | date |
1819 | Fair Elementary | 1443 | Jones | 12SEP2014 |
---|---|---|---|---|
7587 | Blue Elementary | 7369 | Brown | 25NOV2014 |
8661 | Park Elementary | 0976 | Smith | 22JAN2015 |
8662 | Park Elementary | 0976 | Smith | 23JAN2015 |
8665 | West Elementary | 0976 | Smith | 22JAN2015 |
8666 | West Elementary | 0976 | Smith | 23JAN2015 |
Proc Freq X 2
proc freq data=have noprint;
table ssn*date/out=temp;
ru;
proc freq data=temp noprint;
table ssn/out=want;
run;
This code gave me the total for school = Park but there's nothing for school= West.
proc freq data=have noprint;
table school*ssn/out=want;
ru;
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.