This should be pretty much straightforward but I can't get it work even after reading through the documentation...
/*save the var1 freq table*/
proc freq data=have order=freq ;
output out=var1_freq;
tables var1/list missing;
run;
/*save the two freq tables*/
proc freq data=have order=freq ;
output out=var1_freq var1var2_freq;
tables var1 var1*var2/list missing;
run;
Read the warnings in your log. Always.
They state that a statistic is required.
OUT on the TABLES statement is used to capture the frequencies.
OUTPUT statement is used to capture test statistics.
ODS OUTPUT is a different way to keep the counts.
See the example below.
Proc freq data=SASHELP.class;
tables sex / out = freqs chisq;
output out= stats chisq;
ODS onewayFreq= frreqs2;
run;
proc freq data=have order=freq ;
tables var1/list missing out=var1_freq;
run;
/*save the two freq tables*/
proc freq data=have order=freq ;
tables var1 var1*var2/list missing out=var2_freq;
run;
RTM for the options on the TABLES statement that control the output.
Read the warnings in your log. Always.
They state that a statistic is required.
OUT on the TABLES statement is used to capture the frequencies.
OUTPUT statement is used to capture test statistics.
ODS OUTPUT is a different way to keep the counts.
See the example below.
Proc freq data=SASHELP.class;
tables sex / out = freqs chisq;
output out= stats chisq;
ODS onewayFreq= frreqs2;
run;
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!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.