# lab7.pdf - Hai Lam Nguyen u2013 V00914037 Lab 7 Problem 1...

• 4

This preview shows page 1 - 4 out of 4 pages.

Hai Lam Nguyen V00914037- Lab 7 Problem 1. 1. > my.matrix = matrix(c(181, 410, 679, 3224), nrow = 2) > colnames(my.matrix) = c("Bleed", "Not bleed") > rownames(my.matrix) = c("Critical", "Not critical") Bleed Not bleed Critical 181 679 Not critical 410 3224 > my.test = chisq.test(my.matrix, correct = F) > my.test Pearson's Chi-squared test data: my.matrix X-squared = 58.05, df = 1, p-value = 2.555e-14 > my.test\$expected Bleed Not bleed Critical 113.0975 746.9025 Not critical 477.9025 3156.0975 > my.test\$residuals Bleed Not bleed Critical 6.384980 -2.484586 Not critical -3.106106 1.208678 2. H0: The proportion of Chinook salmon who got bleeding is independent of hook location. H1: The proportion of Chinook salmon who got bleeding is associated with hook location. 3. We see that we have a test statistic of 58.05 with a corresponding p-value of 2.555e-14, so there is very strong evidence against the null hypothesis that bleeding is independent of hook location.
Problem 2. 1. > my.matrix = matrix(c(11992942, 16039065, 6145392, 8011341, 6121992, 4629987 ), nrow = 2) > colnames(my.matrix) = c("Never", "Formal", "Current")