BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
afiqcjohari
Quartz | Level 8

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;

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

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;

View solution in original post

6 REPLIES 6
Rohit12
Obsidian | Level 7

 

 

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;

lakshmi_74
Quartz | Level 8
proc freq data=have;
tables var1/out=var1_data;
tables var1*var2/out=var2_data;
run;
afiqcjohari
Quartz | Level 8
But it seems that the output doesn't include the cumulative frequency and cumulative percent. Is it possible to get these variables as well?
Reeza
Super User

RTM for the options on the TABLES statement that control the output. 

Reeza
Super User

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;

afiqcjohari
Quartz | Level 8
I see, thanks for the explanation Reeza.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 33984 views
  • 1 like
  • 4 in conversation