BookmarkSubscribeRSS Feed
fuhgidabowit
Calcite | Level 5

Hi,


I got following data:

 

Name Amount

1         100

1         200

2         300

2         ...

3         ..

3         ..

3         ..

 

What procedure is best to use to create following report/output:

 

1st Col     2ndCol                                          3rd                                                               4th

Name1     Aggregated Sum of Amount of Name1         Cum. Percentage of Agg.Sum Name1        Counts of Name1

Name2     Aggregated Sum of Amount of Name2         Cum. Percentage of Agg.Sum Name1        Counts of Name1

Name3    Aggregated Sum of Amount of Name3          Cum. Percentage of Agg.Sum Name1        Counts of Name1

...

-------------------------------------------------------------------------------------------------------------------------------------

Total....  Total of Aggregated Sum             100%                                                               Total Counts

 

Number of Missing:

 

 

I tried it with proc report so far, but I did not get the desired results´. I'm using SAS Enterprise Guide, so I'm also open to drag & drop solutions.

 

Thanks,

fuhgid

 

 

2 REPLIES 2
Cynthia_sas
SAS Super FREQ
Without a better understanding of how you plan to calculate the "cum percentage", this is a nearly impossible task.
For example, your name1 has a 2 rows with total amount of 300. So I assume that your column 2 value would be 300 and your column 4 value would be 2. But, how to calculate the cum percentage based on 300 -- what is the denominator to calculate the percentage? The total of all the amount values?

I don't understand what you mean by number of missing? Number of rows with missing names, with missing amounts? Why/how would you have a name without an amount or an amount without a name?

Can you post some data, just a small sample and then show, EXACTLY, what results you expect given your data. Because without any information on how to base "cum percentage", it is impossible to make a constructive suggestion -- there's not enough information.

Cynthia
PaigeMiller
Diamond | Level 26

Pviot Reports on Aggregated Data- Proc report, proc means or proc summary ?

 

Why does it have to be one of these three? Why not one of the above (specifically PROC MEANS or PROC SUMMARY), followed by a DATA step?

--
Paige Miller

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 2 replies
  • 487 views
  • 0 likes
  • 3 in conversation