6. Hypothesis Testing
Typical Steps
Frequentist:
- State your hypothesis
- Find you test statistic
- P-value =
- Conclusions
significance level, if P-value then reject
Bayesian:
- State Hypothesis
- Find posterior distribution
- Find the posterior probability of
that is - Conclusion if
then we reject (the complement is the pro)
Example Normal
The local consumer watchdog group was concerned about the cost of electricity to residential customers over the summer months. They took a random sample of 25 residential electricity accounts and looked at the total cost of electricity used over the three months of June, July, and August. The costs were:
514 536 345 440 427
443 386 418 364 483
506 385 410 561 275
306 294 402 350 343
480 334 324 414 296
Assume that the amount of electricity used over the three months by a residential account is Normal(μ, σ2), where the known standard deviation σ = 80.
a) Use a Normal(325,
Using the updating rules
b) Find a 95% Bayesian credible interval for μ.
c) Perform a Bayesian test of the hypothesis
Not within the credible interval so no, reject
d) Perform a Bayesian test of the hypothesis
Rejects
Example Poisson
A local enforcement agency claims that the number of times that a patrol car passes through a particular neighbourhood follows a Poisson process with a mean of three times per nightly shift. Suppose that during a randomly selected night shift no patrol cars pass through the neighbourhood. Do you believe the agency’s claim? Perform a Bayesian test of the hypothesis
Use a
compare to earlier example
Difference In Parameters
Example Difference in Proportion
A new study indicates that tai chi, an ancient Chinese practice of exercise and med-
itation, may relieve symptoms of chronic painful fibromyalgia. The study assigned 66
fibromyalgia patients to take either a 12-week tai chi class
tion class
Tai Chi Wellness Education
Show all your work and circle your final answers.
a) Find the posterior distribution of
admit to feeling better after taking the tai chi class. (Use a Beta(1, 1) prior for π1. )
b) Find the posterior distribution of
admit to feeling better after taking the wellness education class. (Use a Beta(1, 1) prior
for
c) Find the approximate posterior distribution of
d) Test
Fail to reject
Example Difference in Means
Industrial wastes and sewage dumped into our rivers and streams absorb oxygen and thereby reduce the amount of dissolved oxygen available for fish and other forms of aquatic life. One provincial agency requires a minimum of 5 parts per million (ppm) of dissolved oxygen in order for the oxygen content to be sufficient to support aquatic life. A pollution control inspector suspected that a river community was releasing amounts of semitreated sewage into a river. To check her theory, she drew five randomly selected specimens of river water at a location above the town, and another five below. The dissolved oxygen readings (in parts per million) are as follows:
(a) We will assume that the observations come from
where
Use independent “flat priors” for
Find the posterior distributions of
Answer:
Flat Prior:
Assumption:
For
For
b)
Mean =
Variace =
c) 95% C.I =
d)
fail to reject