I have a dataset with variables DAYM1-DAYM31 for counts for each day of the month and DAYW1-DAYW7 for counts for each day of the week. It's easy to put column headers on these, but I would like to put a head _above_ the DAYM1-DAYM31 headers to say 'Day of Month' and above the others to say 'Day of Week' ... in PROC REPORT, how do I put that sort of heading? Do I need to create some sort of dummy variable?
This is a particularly poor arrangement of the data for this purpose. If DAYM1-DAYM31 were not columns in your dataset, but there was a row for each day of the month, then the process is extremely simple. You would use the ACROSS option in the DEFINE statement of PROC REPORT.
define day/across "Day of Month";
Since you don't have this, then try
columns variable1 ("Day of Month" daym1-daym31);
There are many other advantages to not putting actual information (the day of the month) into your variable names.
This is a particularly poor arrangement of the data for this purpose. If DAYM1-DAYM31 were not columns in your dataset, but there was a row for each day of the month, then the process is extremely simple. You would use the ACROSS option in the DEFINE statement of PROC REPORT.
define day/across "Day of Month";
Since you don't have this, then try
columns variable1 ("Day of Month" daym1-daym31);
There are many other advantages to not putting actual information (the day of the month) into your variable names.
Thanks - I found this right after I posted. I must not have been searching using the right terms. In any case, it works!
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.