/* 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.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Ready to level-up your skills? Choose your own adventure.