Hi,
I am trying to do a very simple FH test using a very simple 3X3 test using SAS 9.4. When I try a 2X2 table and the chi-square test it works but my 3X3 table just gets populated with ones after running the proc freq and I get wrong answers. Here is my code:
data mydata; input outcome $ msgroup $ count; datalines; inc PT 6 inc FT 11 inc surg 12 dec PT 3 dec FT 4 dec surg 2 unch PT 8 unch FT 2 unch surg 3 ; run; proc freq data=mydata; tables outcome*msgroup / chisq exact; run;
Do you know what is happening here?
Thanks,
It looks like you probably need to add a WEIGHT statement. Otherwise, each observation is assigned a frequency of 1.
Weight count;
It looks like you probably need to add a WEIGHT statement. Otherwise, each observation is assigned a frequency of 1.
Weight count;
Thank you very much. That was exactly what was missing from my proc freq.
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.
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.