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

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 653 views
  • 0 likes
  • 2 in conversation