I am using macros because I am using a lot of years and different variables. &yr.=year &var.=Program_type. i attached what it produces. I also want another row below it with totals for cohort column and retention rates for entire program should look like this:
proc report data = cretention&yr.&var. split='\'; column Instruction_Method &var.,(count Retention_rate); define Instruction_method / group "Fall Instruction Method" width=8; define &var. / across "&var."; define Count / 'Cohort'; define Retention_rate/ 'Retention Rate'; title "Fall &yr. to Spring Retention Rate by Fall Instruction Method and &var."; run;
Cannot test code with macro variables without knowing what the values of the macro variables are.
The very first example for Proc Report in the online help shows how to add a summary line at the end of a report.
However anything called a "rate" is very likely not going to get a valid summary that way as the default summary is a SUM and Across variables complicate such. Rates typically need a numerator and denominator plus any other formula bits and to do a combined rate have to combine the individual numerators. Typical example: drive 1,000 miles and get a mileage rate of 1mpg, drive 1 mile and get 100mpg (lots of costing downhill perhaps) the average rate is not going to be (1+100)/2=50.5mpg.
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.