My data looks something like this:
What we are seeing is the labels, so column namnes related to women would have a _w as a suffix (Prevalence_w and so forth).
I've been told that this data set needs to be pivoted, with sex as a pivoting variable. Ideally then the output should look something like this:
Men Women
Prevalence Sample size prevalence CI upper CI lower Prevalence_w Sample size_w prevalence_w CI upper_w CI lower_w
Values Values Values Values Values Values Values
I know I could probably use sex as an ACROSS-variable in PROC REPORT, but that would require me to alter the shape of the data. In addition, the data actually "needs" to be in this shape in order to preserve compatibility with previously designed scripts.
So is there some way to manually specify headers and subheaders in PROC REPORT, so that the columns Sample size, prevalence, CI upper limit and CI lower limit is displayed under MEN, while prevalence_w, CI upper limit_w, CI lower_limit w and Sample size_W is displayed under WOMEN?
Use Across. You need to reshape the data, or if you do need to reshape do it in a WORK table just prior to running REPORT.