Today’s Agenda

  • Forming Hypotheses
  • How rare is rare enough

Forming Hypotheses

  • In a confidence interval, we have no real idea of what the sampling distribution looks like (where is centered, how spread out is it)

  • In a hypothesis test, we will want a clear picture of the sampling distribution

  • Goals: Reformulate our methods to account for

    • our prior knowledge
    • deciding how rare is rare enough
    • some variation from our expectation is expected due to randomness but at some point the variation seems unreasonable

Outline of the process of a hypothesis test: + make two hypotheses about what we expect to happen + one is what you expect due to randomness + the other is meant to notice some trend that would not happen randomly. + Then become a skeptic, assume the thing you want to observe is false + then collect data + if it is rare, considering your assumptions, then maybe your assumption is wrong.

Example:

A worker at a company feels that there is gender bias associated to whether someone gets promoted or not. Let \(p\) be the proportion of of people getting promotions that are men:

\(H_0:\) the hypothesis that nothing weird is going on, that everything is just due to randomness is called the null hypothesis

\(H_0: p = 0.5\), half men and half women get promoted

\(H_A:\) the hypothesis that something weird is going, there is bias in promotions, its not just random is called the alternate hypothesis

\(H_A: p > 0.5\) assumes more men are getting promoted

Possible Hypotheses
\(H_0\) \(H_A\)
\(=\) \(\neq\), \(>\), or \(<\)
\(\geq\) \(<\)
\(\leq\) \(>\)
  • when forming hypotheses, the null must ALWAYS have an equal in it
  • the alternate will never have an equals
  • the null should always be what you expect if the variation is due to randomness only
  • often the alternate is the thing you want to show evidence of.

How rare is rare enough?

Example:

Promotion Data

Promoted Not Promoted Total
Male \(21\) \(3\) \(24\)
Female \(14\) \(10\) \(24\)
Total \(35\) \(13\) \(48\)
  1. Assuming the null hypothesis is true, what is the \(z\)-score of the observed data?
se <- sqrt(.5*.5/35)

z <- ((21/35)-0.5)/se

# The z-score is 1.183216
  1. What percentage of data is as rare or more rare than the observed data?
1-pnorm(z)
## [1] 0.1183618
# If we could take a sample of size 35 over and over and it is TRUE that 50% of men get promoted, then we would only see more than 21 men get promoted 11.8% of the time
  • As the experimenter, you need to decide how rare is rare enough. This is called the significance level

  • Often, we use a significance level of \(\alpha = .05\)

  • So, if you observe data that is expected to happen less than \(5 %\) of the time, revise your hypothesis.

  • If this happens we reject the null hypothesis.

  • Otherwise, we fail to reject the null hypothesis.

  1. What conclusion can be made?

Since we observed data expected to happen 11% of the time, and this is bigger than the significance level of 5%, we fail to reject the null hypothesis

The data we collected does not provided statistically significant evidence that the proportion of men getting promotions is greater than 0.5.


  1. Suppose a baker claims that his cookie diameter is more than \(10\) cm, on average. Several of his customers do not believe him. To persuade his customers that he is right, the baker decides to do a hypothesis test. He bakes \(10\) cookies. The mean diameter of the sample is \(12\) cm. The baker knows from baking hundreds of cookies that the standard deviation for the diameter is \(0.5\) cm. and the distribution of diameters is normal. Perform a hypothesis test with a \(5 \%\) significance level.

\(H_0=\)

\(H_A=\)


  1. Some people claim that they can tell the difference between a diet soda and a regular soda in the first sip. A researcher wanting to test this claim randomly sampled \(80\) such people. He then filled \(80\) plain white cups with soda, half diet and half regular through random assignment, and asked each person to take one sip from their cup and identify the soda as diet or regular. \(53\) participants correctly identified the soda. Does this data provide strong evidence that people can tell the difference between regular and diet soda? (when a significance level is not specified use \(\alpha=.05\)).

\(H_0=\)

\(H_A=\)


  1. It is believed that \(40 \%\) of people pass their driving test on the first attempt. Suppose you think the percentage is greater than \(40 \%\). So, you perform a hypothesis test and sample \(100\) people. Of the sampled people, \(47\) reply that they passed on their first attempt. Set up a hypothesis test and make a conclusion with a \(10 \%\) significance level.
# Insert code here

Write your answer here