Very grateful for any help with this basic question
Historical data used to research the question of whether smoking causes cancer
yields the following table.
Smoking Habit/Cancer Cancer No Cancer Total
None to Slight 56 956 1012
Moderate to Excessive 269 1646 1915
Total 325 2602 2927
Question:
1) calculate the risk of a person who is a moderate
or excessive smoker having cancer?
2) perform a chi - square test on these data using
PROC FREQ and state your conclusions?
MY answer for 2)
data nothing;
input Smoking_Habit_Cancer $ 1-22 Cancer 23-26 No_Cancer 27-31 Total 32-36;
datalines;
None to Slight 56 956 1012
Moderate to Excessive 269 1646 1915
Total 325 2602 2927
;
ods html;
PROC FREQ ORDER=DATA; WEIGHT cancer ;
TABLES smoking_habit_cancer*cancer /chisq ;
RUN;
ods html close;
That looks like homework to me, but I'll tell you its wrong. Take a look at your proc freq output, the table should at least match your input table, if it doesn't you haven't done your chi-square correctly.
See the example in the docs that does pretty much what you're looking for:
Base SAS(R) 9.2 Procedures Guide: Statistical Procedures, Third Edition
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.