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

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

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
  • 744 views
  • 0 likes
  • 2 in conversation