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-2024.png

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.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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