/* FOLLOWING ARE MY CODES */
title "Base salary discrepancy within ranks";
title2 "By Gender";
PROC MEANS DATA=MD_Data mean;
VAR 'Base Salary'n;
CLASS 'Department Name'n Grade Gender;
output out = PayGap;
RUN;
The new dataset 'PayGap' looks different from the PROC MEANS table I generated. Why and how to fix it?
Thank you!
Because it does 🙂
(Different output options can generate differently styled output).
Use the STACKODS option and ODS OUTPUT statement to get a table that looks like the output though.
https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/p17h6q7ygvkl1sn13qzf947dundi.htm
@wwwckk wrote:
/* FOLLOWING ARE MY CODES */
title "Base salary discrepancy within ranks";
title2 "By Gender";
PROC MEANS DATA=MD_Data mean;
VAR 'Base Salary'n;
CLASS 'Department Name'n Grade Gender;
output out = PayGap;
RUN;
The new dataset 'PayGap' looks different from the PROC MEANS table I generated.
Thank you!
Because you asked for the DEFAULT output dataset instead of telling the OUTPUT statement what you actually wanted.
This should generate a dataset that is much closer.
output out = PayGap mean=;
Read the documentation on what the OUTPUT statement can do.
If you are really desperate you could try using ODS OUTPUT statement to snag a copy of the data that the proc used to generate the printed report. But since that was structure designed to be PRINTED and not ANALYZED it will usually require a fair amount of work to make it useful.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Ready to level-up your skills? Choose your own adventure.