Hi there,
I was I am quite novice in sas programming. I would really appreciate if someone can help me in solving my data analysis. I am doing a retrospective cohort study and trying to compare if operations done during the afterhours have more complications than daytime. I am doing a chisq test. I imported my data correctly in sas. As i can see that sas can read my data. However, when i am running chi sq test , it put in 1 in reach of the cells of the contingency table.
Please see my data steps below and the screenshot of the sas error result My data
Sas error resultand my dataset attached.
filename refile '/home/u62871531/Audit.xlsx';
proc import datafile=refile
DBMS=XLSX
out=audit
replace;
run;
proc freq data=audit order=freq;
tables Group*Complications/chisq norow nopercent measures expected;
run;
You'll want to add a WEIGHT statement in your call to PROC FREQ:
proc freq data=audit order=freq;
tables Group*Complications/chisq norow nopercent measures expected;
weight count;
run;
A weight statement will provide the counts required to perform a Chi-square test.
You'll want to add a WEIGHT statement in your call to PROC FREQ:
proc freq data=audit order=freq;
tables Group*Complications/chisq norow nopercent measures expected;
weight count;
run;
A weight statement will provide the counts required to perform a Chi-square test.
If you are a novice at SAS, why would you assert that SAS, written by professional statisticians, is producing incorrect results? Where did you input your COUNT variable into the analysis? You did not. Look at the documentation and figure out how you add that variable. SAS is producing correct results. This is a user error.
Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.
Explore Now →SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.