/* 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.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.