Test of Independence 2 Notes Spring

# Test of Independence 2 Notes Spring - Tests of independence...

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

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.

Unformatted text preview: Tests of independence and homogeneity 7 of 11 R: blond = c (1 , 2) R: brown = c (1 , 3) R: red = c (2 , 1) R: D = data . frame ( blond , brown , red ) R: D blond brown red 1 1 1 2 2 2 3 1 Contingency tables in R If you have a set of data that you need to make a contingency table from (real problems): Creating a contingency table: D = table(x1, x2) x1, x2 are ordered vectors recording two categorical variables. R Command Example 3 . Given the raw study data: subject 1 2 3 4 5 6 7 8 9 10 hair BRN BRN BLOND BRN RED RED BLOND BRN RED BLOND gender F M M M M F M M F F R: gender = c ( ”F” , ”M” , ”M” , ”M” , ”M” , ”F” , ”M” , + ”M” , ”F” , ”F”) R: hair = c ( ”BRN” , ”BRN” , ”BLOND” , ”BRN” , ”RED” , + ”RED” , ”BLOND” , ”BRN” , ”RED” , ”BLOND”) R: D = table ( gender , hair ) R: D hair gender BLOND BRN RED F 1 1 2 M 2 3 1 1.4 A complete example Back to our original problem Example 4 . A group of 276 healthy men and women were grouped according to their number of relationships. They were then exposed to a virus that caused colds. The data is summarized in the table below. Does the data provide sufficient evidence to indicate that susceptibility to colds is affected by the number of relationships you have? Number of relationships Contracted cold? 3 or less 4-5 6 or more yes 49 43 34 no 31 47 62 Use our seven hypothesis testing steps....
View Full Document

{[ snackBarMessage ]}

### Page1 / 5

Test of Independence 2 Notes Spring - Tests of independence...

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

View Full Document
Ask a homework question - tutors are online