# chisqtestR - Chisquare tests in R illustrate chisquare test...

This preview shows pages 1–2. Sign up to view the full content.

Sheet1 Page 1 # Chisquare tests in R # # illustrate chisquare test of indepencdence and and chisquare goodness of fit test # using the chisq.test function. ######### recall the binge drinking study ############################################# # Ex 3. (Example 8.1) Binge drinking difference between mean and women # A summary of the sample data: # # Group n X # Men 5348 1392 # Women 8471 1748 #----------------------- # Total 13819 3140 ###################################################################################### # the Z^2 test for difference in proportions: n = c(5348, 8471) x = c(1392, 1748) x n prop.test(x,n) # Another way to organize the data is in a two-way table: # # Gender # Frequent binge drinker Men Women | Total # ------------------------------------------------ # Yes 1392 1748 | 3140 # No 3956 6723 | 10679 # ------------------------------------------------ # Total 5348 8471 | 13819 # The X^2 test of independence between Gender and Binge drinking: # create the matrix of data in the table, row by row:

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 09/11/2011 for the course STAT 200 taught by Professor Agniel during the Spring '09 term at University of Illinois at Urbana–Champaign.

### Page1 / 6

chisqtestR - Chisquare tests in R illustrate chisquare test...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online