BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
GreggB
Pyrite | Level 9

I want to amend my code so that there is a row after each school that sums the N count for grades 6, 7 and 8 and calculates the percent before going to the next school.  Below is a partial output and my code.

 

proc tabulate data=one;

by schlevel;

class efagrade school;

class ela /preloadfmt;

tables school='SCHOOL'*efagrade='GRADE' all='TOTAL', ela='PERFORMANCE LEVEL'*(n*f=6.0 pctn<ela>='PCT'*f=6.0)

all='TOTAL'*(n*f=6.0)/rts=25 misstext='0' printmiss;

format ela scready.;

run;

 

 

PERFORMANCE LEVEL

TOTAL

Does Not Meet

Approaches

Meets

Exceeds

N

PCT

N

PCT

N

PCT

N

PCT

N

SCHOOL

GRADE

55

22

105

42

71

28

22

9

253

School A

06

07

56

22

91

36

65

25

44

17

256

08

56

22

79

31

82

32

41

16

258

School B

06

2

7

16

59

9

33

0

0

27

07

10

23

23

53

9

21

1

2

43

08

8

24

15

44

9

26

2

6

34

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

This should do:

proc tabulate data=one;
   by schlevel;
   class efagrade school;
   class ela /preloadfmt;
   tables school='SCHOOL' *(efagrade='GRADE' all='School Total') all='TOTAL', 
          ela='PERFORMANCE LEVEL'*(n*f=6.0 pctn<ela>='PCT'*f=6.0)
             all='TOTAL'*(n*f=6.0)
          /rts=25 misstext='0' printmiss
   ;
   format ela scready.;
run;

Note that schools with only one grade will basically have a duplicate row for that single grade.

 

View solution in original post

2 REPLIES 2
ballardw
Super User

This should do:

proc tabulate data=one;
   by schlevel;
   class efagrade school;
   class ela /preloadfmt;
   tables school='SCHOOL' *(efagrade='GRADE' all='School Total') all='TOTAL', 
          ela='PERFORMANCE LEVEL'*(n*f=6.0 pctn<ela>='PCT'*f=6.0)
             all='TOTAL'*(n*f=6.0)
          /rts=25 misstext='0' printmiss
   ;
   format ela scready.;
run;

Note that schools with only one grade will basically have a duplicate row for that single grade.

 

GreggB
Pyrite | Level 9

Beautiful.  Thanks!

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 2 replies
  • 7807 views
  • 0 likes
  • 2 in conversation