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!
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.
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.