Hi,
I trying to find an association of specific combinations of values in a very large contingency table. I'm using proc freq with the option cellchi2. I don't want to scan the result table with my eyes in order to find all the cells with a relative high cellchi values which also have high frequencies. The out option does not output the cellchi data.
So I thought of creating a program that will submit a seperate proc freq for each value.
I've already created a program (see below) that uses macro for issolating a specific value and consoliate all the other and then conduct a chi-square test for it. The question is how to a create an automatic loop that will do this for a series of values?
%LET celltype = '4';
data cell;
set tinc;
cell_type='Other';
where class=&class and &sc_filter;
if &type=&celltype then cell_type=&celltype;
run;
proc freq data=cell;
table cell_type * site / chisq norow nopercent exact out=freqout;
weight count_number ;
run;
Add this into your PROC FREQ
ods output crosstabfreqs=crosstabfreqs;
By the way, you say you are using CELLCHI2 but your code is not using CELLCHI2.
I didn't share the main proc freq. I shared the code that produces a chi-square test to a specific value. i.e. conducting manually a cell-Chi-square test.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.