Suppose that you're working for the EPA, who has decided that it is safe to drink as much as 5 picocuries per liter. That is, this value of 5 is the dividing line between what is safe, and what is unsafe. (Aside: isn't it wild that there is a bright-line distinction between "safe" and "unsafe"?)
Would you recommend testing $H_{0}: \mu = 5$ vs. $H_{a}: \mu > 5$; or, $H_{0}: \mu = 5$ vs. $H_{a}: \mu < 5$. Explain your reasoning, weighing the consequences of a false-negative, or a false-positive in either case.
A coin is thrown independently $10$ times to test the hypothesis that the probability of heads is $\frac{1}{2}$ versus the alternative that the probability is not $\frac{1}{2}$ . The test rejects if either $0$ or $ 10$ heads are observed.
(a) What is the significance level of the test?
(b) If, in fact, the probability of heads is $0.1$, what is the power of the test?
Suppose that you have two coins $A$ and $B$ in an urn. Coin $A$ has probability of heads equal to $0.5$, and coin $B$ has probability of heads equal to $0.7$. You pick a coin from the urn blind-folded. You now toss it $10$ times and record the number of heads. To check if coin $A$ was chosen, you want to set up a hypothesis test by rejecting the null if the number of heads exceeds some constant.
(a)What would your rejection criterion be for a $1%$ significance level.
(b) Compute the power of the test.
(You may use a calculator or a Binomial table)
Suppose that you have two coins $A$and $B$ in an urn. Coin $A$ has probability of heads equal to $0.5$, and coin $B$ has probability of heads equal to $0.7$. You pick a coin from the urn blind-folded. You now toss it until a head comes up and record the total number of tosses. You want to set up a hypothesis test to check if coin $A$ was chosen.
(a) What is the significance level of a test that rejects $H_0$ if $X\geq8$?
(b) What is the power of the test.
Let $X_1,X_2,\ldots,X_n$ be a sample from a normal distribution having a variance of $100$. Find the rejection region for a test with the following $\alpha$ for $H_0:\mu=0$ versus $H_A:\mu=1.5$.
(a) $\alpha=0.1$
(b) $\alpha=0.01$
Suppose that a $99%$ confidence interval for the mean $\mu$ of a normal distribution is found to be $(-2.0, 3.0)$. Would a test of $H_0: \mu = -3$ versus $H_A:\mu\neq - 3$ be rejected at the $.01$ significance level?
Suppose that you have a sample of IQ scores from a set of first graders.
iq <- c(107, 113, 108, 127, 146, 103, 108, 118, 111, 119)
The IQ test score has an approximately normal distibution with a standard deviation of 15 for the population of US first-graders. (Set aside, for now, concerns about the absurdity of testing first graders for intelligence and cultural influences on test scores. Testing kids is silly, we just need it for the problem set up.)
Use R to test whether this sample of students differs from the population mean.
Notice that there is not a built-in function to test for a standard normal. So, instead, we can write one quickly. Notice that this is simply a re-write of the formula that we have been provided in the book. It takes in data -- which will be the vector of IQ scores, a null hypothesis, and a population standard deviation. From this, it produces the sample average, then a z-stat.
The only, possible trick in this function is the abs(.)*-1
. Here, we're trying to find the lower critical value, so that no matter if the sample average is greater or smaller than the null, we can compute a p-value in the same way.
z_test <- function(data, null, sd) {
x_bar <- mean(data)
z_stat <- (x_bar - null) / (sd / sqrt(length(data)))
p_val <- pnorm(q = abs(z_stat)*-1, mean = 0, sd=1) * 2
return(p_val)
}