BookmarkSubscribeRSS Feed
olivia123456
Fluorite | Level 6
  • The General Social Survey conducted a poll of 668 adults in which the subjects were asked whether they agree that the government should prohibit smoking in public places. In addition, each was asked how many people lived in his or her household. The results are summarized in the following contingency table.

 

Test the hypothesis of independence. Use the α = 0.01 level of significance. 

  • State the null and alternate hypotheses.
  • Report the test statistic and the p-value

 

Household Size

 

1

2

3

4

5

Agree

73

109

48

37

37

No Opinion

31

52

29

20

18

Disagree

42

71

38

40

23

 

 

I don't know what I did wrong, am I perhaps using the wrong type of test?

1 REPLY 1
olivia123456
Fluorite | Level 6

2.1

Ho: The results are independent

Ha: The results are dependent

 

2.2

data household;

      input familysize agree no_opinion disagree;

cards;

1 73  31 42

2 109 52 71

3 48 29  38

4 37 20  40

5 37 18  23

run;

 

proc print data=household;

run;

 

 

proc freq data=household;

      weight familysize;

      tables agree/chisq;

run;

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

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 967 views
  • 0 likes
  • 1 in conversation