BookmarkSubscribeRSS Feed
Dale
Pyrite | Level 9

When I request submit PROC FREQ code that requests a three-way table, each formatted level of the first named variable produces a separate two-way table of the last two variables named on the Tables statement.  In order for the output to be useful, the formatted value of the first named variable SHOULD BE printed above each constructed table.  I used to get a line saying "Controlling for ..." to indicate what value(s) of the first named variable produced a specified cross-tabulation.  I no longer get the "Controlling for ..." message.

 

I presume that there is some sort of option or environmental variable that is causing the "Controlling for ..." statement to be suppressed.  Any idea what that option/environmental variable might be?

 

For instance, if I have three variables, A, B, and C with A taking on values 1, 2, and 3, and I submit the code:

 

proc freq data=mydata;

  tables a*b*c;

run;

 

I should get three tables of B*C for each of the three levels of A.  The first table should be preceded by the text "Controlling for A=1", the second preceded by "Controlling for A=2", and similarly for the third table.  I do not get such text now.  How do I restore such text?

1 REPLY 1
ballardw
Super User

Have you are anyone modified the templates use by Proc Freq for tables?

 

Do you have an entry for CROSSTABFREQS in any template path other than in SASHELP.Tmplbase?

In the results window right click on Results and select Templates from the menu. Do you have anything that starts with a name other than SASHELP? If that template repository, likely SASUSER.TMPLAT contains a CROSSTABFREQS that is a likely culprit.

 

Or run this code:

proc template;
   path show;
run;

The default result in the log would look like:

 

1. SASUSER.TEMPLAT(UPDATE)
2. SASHELP.TMPLMST(READ)

If you have another path, especially if it has a lower number than SASHELP.TMPLMST, that may have another CROSSTABFREQS.

 

 

You can set your system to ignore templates not created by SAS by using either

proc template;
   path verify;
run;

Or if you find the modified template ensure that it has this code in the template:

 

      define ControllingFor;                                                  
         dynamic StratNum StrataVariableNames StrataVariableLabels;           
         text "Controlling for" StrataVariableNames / StratNum>0;             
      end;  

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 1 reply
  • 1091 views
  • 0 likes
  • 2 in conversation