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!
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
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.