\setcounter{ExampleCounter}{1}
\paragraph{Example from textbook:} Didi and Ali are at a birthday party of a very wealthy friend. They hurry to be first in line to grab a prize from a tall basket that they cannot see inside. There are 200 plastic bubbles in the basket and they have been told that there is only one with a \$100 bill. Didi is the first person to reach into the basket and pull out a bubble. Her bubble contains a \$100 bill.\\
If the claim were true, the probability of this happening would be 1/200 = 0.005, a very unlikely thing. Because a ``rare event'' has occurred, they begin to doubt that the information they were given was true. (In reality, they would weigh this against the probability that the person who told them this was lying, and if they trusted the person, they wouldn't doubt their word, because they'd assume that the probability of that person lying was even lower than 0.005).\\
This is similar to a hypothesis test: we make an \textbf{assumption} (that may or may not be true). Then we take a sample.
\begin{itemize}
\item \text{}
\vspace{0.8in}
\item \text{}
\vspace{0.8in}
\end{itemize}
\subsection{The p Value}
The \marginnote{\includegraphics[width=1.5in]{xkcdNullHypothesis}\\ \hfill xkcd.com}way that we measure an rare event like this is by using a probability called the \textbf{p value}.
\begin{itemize}
\item \text{}
\vspace{0.75in}
\item \text{}
\vspace{0.5in}
\item \text{}
\end{itemize}
\vfill
\pagebreak
\paragraph{What is ``low''?} We consider p to be low if it is below some predetermined \textbf{significance level}, called $\alpha$. This is usually 0.05 or something similarly low.
\begin{itemize}
\item \text{}
\vfill
\end{itemize}
\begin{example}{Years of Education}
A social \marginnote{\includegraphics[width=1.75in]{xkcdPValues}\\ \hfill xkcd.com}scientist suspects that the mean number of years of education for adults in a certain large city is greater than 12 years. She surveys 100 adults and finds that the sample mean number of years is 12.98. Assume that the population standard deviation is 3 years. Test this claim.
\paragraph{Step 1:} State the hypotheses.
\vspace{0.6in}
\paragraph{Step 2:} Calculate the test statistic. This is the z score of our sample, which gives an idea of how unusual our sample is, assuming that the true population mean is 12 or less (our null hypothesis).
\vspace{0.75in}
\begin{center}
\begin{tikzpicture}
\begin{axis}[
no markers, domain=-4:4, samples=100,
axis lines*=none, xlabel=$x$,
hide y axis,
every axis y label/.style={at=(current axis.above origin),anchor=south},
every axis x label/.style={at=(current axis.right of origin),anchor=west},
height=5cm, width=12cm,
xtick={0,2},
ytick=\empty,
xticklabel style={align=right},
xticklabels={$\mu=12$,},
enlargelimits=false, clip=false, %axis on top,
%grid = major
]
\addplot [fill=cyan!40, draw=none, domain=2:4] {gauss(0,1)} \closedcycle;
%\addplot [fill=cyan!40, draw=none, domain=2:3] {gauss(0,1)} \closedcycle;
%\addplot [fill=yellow!20, draw=none, domain=-2:-1] {gauss(0,1)} \closedcycle;
%\addplot [fill=yellow!20, draw=none, domain=1:2] {gauss(0,1)} \closedcycle;
%\addplot [fill=green!20, draw=none, domain=-3:-2] {gauss(0,1)} \closedcycle;
%\addplot [fill=green!20, draw=none, domain=2:3] {gauss(0,1)} \closedcycle;
\addplot [very thick,cyan!40!black] {gauss(0,1)};
%\draw [yshift=-0.75cm, -latex](axis cs:2,0) -- node [fill=white] {$p$} (axis cs:4,0);
\end{axis}
\end{tikzpicture}
\end{center}
Note that we shaded the area to the right of the sample mean, because the claim is that the mean is \textbf{greater}.
\paragraph{Step 3:} Calculate the p value that corresponds to this area. Use the table or calculator.
\vspace{0.2in}
\paragraph{Step 4:} Draw a conclusion.
\vspace*{0.2in}
\end{example}
\pagebreak
\begin{example}{Test Scores}
A pre-test and post-test were given to workshop attendees. The pretest score average was 24, and the researchers want to know whether the post-test score is significantly different from the pre-test score. They sampled 50 tests and found that the sample mean was 24.8. Assume that the population standard deviation is 1.2. Use a significance level of 0.01.
\paragraph{Step 1:} State the hypotheses.
\vspace{0.75in}
\paragraph{Step 2:} Calculate the test statistic.
\vspace{1.25in}
\begin{center}
\begin{tikzpicture}
\begin{axis}[
no markers, domain=-4:4, samples=100,
axis lines*=none, xlabel=$x$,
hide y axis,
every axis y label/.style={at=(current axis.above origin),anchor=south},
every axis x label/.style={at=(current axis.right of origin),anchor=west},
height=5cm, width=12cm,
xtick={-2,0,2},
ytick=\empty,
xticklabel style={align=right},
xticklabels={,$\mu=24$,},
enlargelimits=false, clip=false, %axis on top,
%grid = major
]
\addplot [fill=cyan!40, draw=none, domain=2:4] {gauss(0,1)} \closedcycle;
\addplot [fill=cyan!40, draw=none, domain=-4:-2] {gauss(0,1)} \closedcycle;
%\addplot [fill=yellow!20, draw=none, domain=-2:-1] {gauss(0,1)} \closedcycle;
%\addplot [fill=yellow!20, draw=none, domain=1:2] {gauss(0,1)} \closedcycle;
%\addplot [fill=green!20, draw=none, domain=-3:-2] {gauss(0,1)} \closedcycle;
%\addplot [fill=green!20, draw=none, domain=2:3] {gauss(0,1)} \closedcycle;
\addplot [very thick,cyan!40!black] {gauss(0,1)};
%\draw [yshift=-0.75cm, -latex](axis cs:2,0) -- node [fill=white] {$p/2$} (axis cs:4,0);
%\draw [yshift=-0.75cm, -latex](axis cs:-2,0) -- node [fill=white] {$p/2$} (axis cs:-4,0);
\end{axis}
\end{tikzpicture}
\end{center}
Note that we shaded the area outside the sample mean and on the opposite side, since the claim is that it is different from 24 (greater or smaller). This is called a \textbf{two-tailed test}.
\paragraph{Step 3:} Calculate the p value that corresponds to this area. Use the table or calculator. Remember to multiply by 2.
\vspace{0.75in}
\paragraph{Step 4:} Draw a conclusion.
\vspace*{0.75in}
\end{example}
\vfill
\pagebreak