BookmarkSubscribeRSS Feed
dlsfetcu
Calcite | Level 5

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;

1 REPLY 1
Reeza
Super User

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

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1007 views
  • 0 likes
  • 2 in conversation