BookmarkSubscribeRSS Feed
GreggB
Pyrite | Level 9

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.

Obsschoolssnlastdate
1819Fair Elementary1443Jones12SEP2014
7587Blue Elementary7369Brown25NOV2014
8661Park Elementary0976Smith22JAN2015
8662Park Elementary0976Smith23JAN2015
8665West Elementary0976Smith22JAN2015
8666West Elementary0976Smith23JAN2015
3 REPLIES 3
Reeza
Super User

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;

GreggB
Pyrite | Level 9

This code gave me the total for school = Park but there's nothing for school= West.

Reeza
Super User

proc freq data=have noprint;

table school*ssn/out=want;

ru;

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is Bayesian Analysis?

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 680 views
  • 0 likes
  • 2 in conversation