Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Programming
- /
- SAS Procedures
- /
- Re: Pviot Reports on Aggregated Data- Proc report, proc means or proc ...

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 07-18-2019 09:54 AM
(376 views)

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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

Paige Miller

⏰

Time is running out to save with the early bird rate. Register by Friday, March 1 for just $695 - $100 off the standard rate.

Check out the agenda and get ready for a jam-packed event featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events.** **

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.