STA258 Lecture 14
-
Hypothesis Testing based on t distrubtion, one sample, etc.
-
Review
- If we have a normal distribution:
- If we have a non-normal distribution:
where is the sample standard deviation. This follows a t distribution with degrees of freedom.
- If we have a normal distribution:
-
Example:
- Heart rate BPM:
- Restoring heart rate is
BPM - Is there evidence that true mean heart rate exceeds
BPM? - Independent random samples.
- Heart rate has Normal Distribution.
- In
R:qt(0.95, 24)
- In
value: - In
R:pt(2.08333333333333, 24, lower.tail=FALSE)
- Since
value is less than , we reject the null hypothesis. There is evidence that the true mean heart rate exceeds BPM. - #tk flashcards on when to reject or accept certain hypotheses based on
value and .
- #tk flashcards on when to reject or accept certain hypotheses based on
- Saying that laughter is the best medicine due to increased heart rate doesn't necessarily make sense, but it is a fun example. We would need to do more research to see if there is a causal relationship between laughter and heart rate.
- Otherwise, we could say that working out increases heart rate and also is the best medicine.
test has a normality assumption
-
Example:
- Average price of a
start motel room have decreased. - Last year it was normally distributed with
- If the dist of room prices are normal,
. What conclusion should we make? - In
R:qt(0.95, 11)
- In
- p-value:
- In
R:pt(1.66944437166086, 11, lower.tail=FALSE)
- Since
value is greater than , we fail to reject the null hypothesis. There is not enough evidence to conclude that the average price of a star motel room has decreased.
- Average price of a
-
Proportions
- These are the conditions for CLT to kick in.
- #tk flashcards of this.
-
Example:
- Tim Hortons roll up the rim.
- 100 empty cups
winning cups - Is there enough evidence to suggest that the probability of winning is less than
? value: - In
R:pnorm(-1.25219806739988, lower.tail=TRUE)
- Since
value is greater than , we fail to reject the null hypothesis. There is not enough evidence to suggest that the probability of winning is less than . - Since sample was
, it's a strong result.
-
Example:
- Congenital abnormality occurs in
- We have a study that
have abnormality - Is there evidence that the true proportion of congenital abnormality is greater than
? value: - In
R:pnorm(6.27512493759735, lower.tail=FALSE) - Very small. This is a very strong result.
- Since
value is less than , we reject the null hypothesis. There is evidence that the true proportion of congenital abnormality is greater than . - If we assume
for medical study - We still have a very small
value, so we would still reject the null hypothesis. There is still evidence that the true proportion of congenital abnormality is greater than .
- Congenital abnormality occurs in
-
Example:
of us workers were unionized in 2005. - Suppose we have a sample of
in - Have union efforts increased membership?
- In 2006
were unionized, so . - In
R:pnorm(0.302371578407382, lower.tail=FALSE) - With
so we fail to reject the null hypothesis. There is not enough evidence to suggest that union efforts have increased membership. - By visual inspection, we can see that
-
Example:
of supermarket shoppers, believe no-name have the same quality as name brand. and believe that no-name have the same quality as name brand, so . - In
R:pnorm(2.5, lower.tail=FALSE)*2
- In
- With
so we reject the null hypothesis. There is evidence to suggest that the proportion of supermarket shoppers who believe no-name have the same quality as name brand is different from .
-
Variance
- Suppose we want to test on variance
- We know
- Reject
if or
- We know
- Reject if
or is too small
- Reject if
- Reject if
or is too small
- Reject if
-
example:
- A compnay produces standard metal pipes with length
- A client took
- Does this undermine the comany's claim?
- Length is normally distributed
- p-value
- In
R:pchisq(37.5, 24, lower.tail=FALSE)
- Since
value is less than , we reject the null hypothesis. There is evidence to suggest that the variance of the length of the pipes is greater than .
- A compnay produces standard metal pipes with length
-
Example:
- Car batteries life normally distributed with
- Is
- p-value
- In
R:pchisq(16, 9, lower.tail=FALSE)
- Since
value is greater than , we fail to reject the null hypothesis. There is not enough evidence to suggest that the variance of the life of the car batteries is greater than .
- Car batteries life normally distributed with
-
Example:
-
Example:
- Suppose we wish to test
- when
- What's the smallest sample size that will achieve that objective?
- Var measured is normally distributed with
is when is true - Here
- Critical value to achieve
is - #tk why do we do this, instead of
- #tk why do we do this, instead of
-
example:
- Vending machine
of coffee - If true mean is
, what is the power of your test at - How many coffee cups should you sample if you want to raise the power to
- In
R:qnorm(0.05, lower.tail=TRUE)
- In
R:qnorm(0.8, lower.tail=TRUE)