Solutions Homework 9 - Statistical Analysis | STAT 200, Assignments of Statistics

Material Type: Assignment; Class: Statistical Analysis; Subject: Statistics; University: University of Illinois - Urbana-Champaign; Term: Summer 2003;

Typology: Assignments

Pre 2010

Uploaded on 03/11/2009

koofers-user-mzy
koofers-user-mzy 🇺🇸

10 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Stat 200
Homework 9 Solutions
9.1 …Is this a fair die? Answer using a significance test with H
0
: p
i
= 1/6 for each i and
H
A
: p
i
1/6 for at least one i.
Solution
> rolls <- c(13, 17, 9, 17, 18, 26)
> die.prob <- rep((1/6), 6)
> die.prob
[1] 0.1666667 0.1666667 0.1666667 0.1666667 0.1666667 0.1666667
> chisq.test(rolls, p=die.prob)
Chi-squared test for given probabilities
data: rolls
X-squared = 9.68, df = 5, p-value = 0.08483
The p-value of .08483 is not significant. Therefore, we accept the null hypothesis and
that we could not find sufficient evidence for the die being a biased die.
9.5 …Perform a chi-squared goodness-of-fit test to see whether the distibution of vowels
appears to be from English.
Solution
> count <- c(28, 39, 23, 22, 11)
> expected <- c(9, 12, 9, 8, 4)
> prob <- expected/sum(expected)
> chisq.test(count, p=prob)
Chi-squared test for given probabilities
data: count
X-squared = 1.084, df = 4, p-value = 0.8968
The p-value suggests that we do not reject the null hypothesis and that the paragraph
came from the English language.
9.7 The number of murders by day of week in New Jersey during 2003 is shown in Table
9.4. 1. Perform a significance test to test the null hypothesis that a murder is equally
likely to occur on any given day.
2. Perform a significance test of the null hypothesis that murders happen on each
weekday with equal probability; similarly on the weekends, but not necessarily
with the same probability.
For each test, write down explicitly the null and alternative hypotheses.
pf3

Partial preview of the text

Download Solutions Homework 9 - Statistical Analysis | STAT 200 and more Assignments Statistics in PDF only on Docsity!

Stat 200

Homework 9 Solutions

9.1 …Is this a fair die? Answer using a significance test with H 0 : pi = 1/6 for each i and HA: pi ≠ 1/6 for at least one i.

Solution

rolls <- c(13, 17, 9, 17, 18, 26) die.prob <- rep((1/6), 6) die.prob [1] 0.1666667 0.1666667 0.1666667 0.1666667 0.1666667 0. chisq.test(rolls, p=die.prob)

Chi-squared test for given probabilities

data: rolls X-squared = 9.68, df = 5, p-value = 0.

The p -value of .08483 is not significant. Therefore, we accept the null hypothesis and that we could not find sufficient evidence for the die being a biased die.

9.5 …Perform a chi-squared goodness-of-fit test to see whether the distibution of vowels appears to be from English.

Solution

count <- c(28, 39, 23, 22, 11) expected <- c(9, 12, 9, 8, 4) prob <- expected/sum(expected) chisq.test(count, p=prob)

Chi-squared test for given probabilities

data: count X-squared = 1.084, df = 4, p-value = 0.

The p -value suggests that we do not reject the null hypothesis and that the paragraph came from the English language.

9.7 The number of murders by day of week in New Jersey during 2003 is shown in Table 9.4.

  1. Perform a significance test to test the null hypothesis that a murder is equally likely to occur on any given day.
  2. Perform a significance test of the null hypothesis that murders happen on each weekday with equal probability; similarly on the weekends, but not necessarily with the same probability. For each test, write down explicitly the null and alternative hypotheses.

Solution

H 0 : pi = 1/7 for each i vs. HA: pi ≠ 1/7 for at least one i.

murders <- c(53, 42, 51, 45, 36, 37, 65) murder.prob <- rep((1/7), 7) chisq.test(murders, p=murder.prob)

Chi-squared test for given probabilities

data: murders X-squared = 13.3191, df = 6, p-value = 0.

The p -value of 0.03824 is significant. Therefore, we reject the null hypothesis and we are in favor of the alternative and that a murder is not equally likely to occur on any given day.

H 0 : pi = pj for each i and j such that they both come from the same group, i.e., weekday or weekend vs. HA: pipj for at least one i and j such that they both come from the same group.

murders <- c(53, 42, 51, 45, 36, 37, 65) murder.prob2 <- c((murders[1]+murders[7])/(2sum(murders)), rep(sum(murders[2:6])/(5sum(murders)), 5), (murders[1]+murders[7])/(2*sum(murders))) murder.prob [1] 0.1793313 0.1282675 0.1282675 0.1282675 0.1282675 0.1282675 0. sum(murder.prob2) [1] 1 chisq.test(murders, p=murder.prob2)

Chi-squared test for given probabilities

data: murders X-squared = 4.7938, df = 6, p-value = 0.

The p -value is 0.5705, which is not significant. Therefore we accept the null hypothesis and that murders happen on each weekday with equal probability; similarly on the weekends.

9.11 …Do a chi-squared hypothesis test of independence for the two variables.

Solution