The SAS Output Delivery System and reporting techniques

Calculate Percentiles and Cumulative Sum in SAS?

Reply
Contributor
Posts: 52

Calculate Percentiles and Cumulative Sum in SAS?

Hi All,

Please can you provide generic sas code for following:

1. Computing Percentage and Percentiles for specific variables

2. Compute Total Sum and Cumulative Sum for specific variables

3. Creating Indicator variable for non-missing values.

Thank you!

SAS Super FREQ
Posts: 8,868

Re: Calculate Percentiles and Cumulative Sum in SAS?

Posted in reply to dkanand86

Hi:

  What code or procedures have you tried? What does your data look like? PROC FREQ will calculate percentages, but so will PROC TABULATE and PROC REPORT. You can get PERCENTILES from several procedures. Many people use PROC UNIVARIATE. To create an indicator variable for non-missing values, you most likely will need a DATA step program and/or a user-defined format....it sort of depends on your data and what you want the new variable to be named and the name of the variable you want to test for non-missing values. For computing Total sums, again, PROC PRINT, PROC MEANS, PROC REPORT, PROC TABULATE, PROC SQL will all work. For computing cumulative sums, however, you will need either a DATA step program or PROC REPORT.

cynthia

Ask a Question
Discussion stats
  • 1 reply
  • 612 views
  • 0 likes
  • 2 in conversation