From: Andrew Lorimer Date: Thu, 29 Aug 2019 12:45:38 +0000 (+1000) Subject: [spec] start hypothesis testing X-Git-Tag: yr12~50 X-Git-Url: https://git.lorimer.id.au/notes.git/diff_plain/d63c834106f09ab25fb0948582acf2031edf4d90?ds=inline [spec] start hypothesis testing --- diff --git a/spec/statistics.pdf b/spec/statistics.pdf index cd372e0..60f093c 100644 Binary files a/spec/statistics.pdf and b/spec/statistics.pdf differ diff --git a/spec/statistics.tex b/spec/statistics.tex index ee414c6..4c89dd5 100644 --- a/spec/statistics.tex +++ b/spec/statistics.tex @@ -103,10 +103,10 @@ Normal distributions must have area (total prob.) of 1 \(\implies \int^\infty_{-\infty} f(x) \> dx = 1\) \pgfmathdeclarefunction{gauss}{2}{% - \pgfmathparse{1/(#2*sqrt(2*pi))*exp(-((x-#1)^2)/(2*#2^2))}% + \pgfmathparse{1/(#2*sqrt(2*pi))*exp(-((x-#1)^2)/(2*#2^2))} } -{\begin{center} \begin{tikzpicture} +\begin{tikzpicture} \pgfplotsset{set layers} \begin{axis}[every axis plot post/.append style={ mark=none,domain=-3:3,samples=50,smooth}, @@ -138,7 +138,7 @@ every axis x label/.style={at={(axis description cs:1,-0.25)},anchor=south west}] \addplot {gauss(0,0.75)}; \end{axis} -\end{tikzpicture}\end{center}} +\end{tikzpicture} \section{Central limit theorem} @@ -151,12 +151,13 @@ \item \textbf{Interval estimate:} confidence interval for population mean \(\mu\) \end{itemize} - \subsection*{95% confidence interval} + \subsection{95\% confidence interval} - \[ \left( \overline{x} \pm 1.96 \dfrac{\sigma}{\sqrt{n}} \] + The 95\% confidence interval for a population mean \(\mu\) is given by + + \[ \overline{x} \pm 1.96 \dfrac{\sigma}{\sqrt{n}} \] where: \\ - \(\mu\) is the population mean (unknown) \\ \(\overline{x}\) is the sample mean \\ \(\sigma\) is the population sd \\ \(n\) is the sample size from which \(\overline{x}\) was calculated @@ -170,11 +171,11 @@ \subsection*{Interpretation of confidence intervals} - 95% confidence interval \(\implies\) 95% of samples will contain population mean \(\mu\). + 95\% confidence interval \(\implies\) 95\% of samples will contain population mean \(\mu\). \subsection*{Margin of error} - For 95% confidence interval for \(\mu\), margin of error \(M\) is: + For 95\% confidence interval for \(\mu\), margin of error \(M\) is: \begin{align*} M &= 1.96 \times \dfrac{\sigma}{\sqrt{n}} \\ @@ -183,12 +184,57 @@ \subsection*{General case} - A confidence interval of \(C\)% is given by + A confidence interval of \(C\)\% for a mean \(\mu\) s given by + + \[ x \in \left( \overline{x} \pm k \dfrac{\sigma}{\sqrt{n}} \right) \quad \text{ where } k \text{ is such that } \Pr(-k < Z < k) = \frac{C}{100} \] + + \subsection*{Confidence interval for multiple trials} + + For a set of \(n\) confidence intervals (samples), there is \(0.95^n\) chance that all \(n\) intervals contain the population mean \(\mu\). + + \section{Hypothesis testing} + + Note hypotheses are always expressed in terms of population parameters + + \subsection*{Null hypothesis \(H_0\)} + + Sample drawn from population has same mean as control population, and any difference can be explained by sample variations. + + \subsection*{Alternative hypothesis \(H_1\)} + + Amount of variation from control is significant, despite standard sample variations. + + \subsection*{\(p\)-value} - A 95% confidence interval for \(\mu\) will have \(M\) when - \[ \overline{x} \pm k \dfrac{\sigma}{\sqrt{n}} \] + Probability of observing a value of the sample statistic as significant as the one observed, assuming null hypothesis is true. - where \(k\) is such that \(\Pr(-k < Z < k) = \frac{C}{100}\) + % table of p-values for strength of evidence + \subsection*{Distribution of sample mean} + + If \(X \sim \operatorname{N}(\mu, \sigma)\), then distribution of sample mean \(\overline{X}\) is also normal with \(\overline{X} \sim \operatorname{N}(\mu, \frac{\sigma}{\sqrt{n}}\). + + \subsection*{Statistical significance} + + Significance level is denoted by \(\alpha\). + + If \(p<\alpha\), null hypothesis is \textbf{rejected} \\ + If \(p>\alpha\), null hypothesis is \textbf{accepted} + + \subsection*{\(z\)-test} + + Hypothesis test for a mean of a sample drawn from a normally distributed population with a known standard deviation. + + \subsubsection*{\colorbox{cas}{\textbf{On CAS:}}} + + Menu \(\rightarrow\) Statistics \(\rightarrow\) Calc \(\rightarrow\) Test. \\ + Select \textit{One-Sample Z-Test} and \textit{Variable}, then input: + \begin{itemize} + \item \(\mu\) condition - same operator as \(H_1\) + \item \(\mu_0\) - expected sample mean (null hypothesis) + \item \(\sigma\) - standard deviation (null hypothesis) + \item \(\overline{x}\) - sample mean + \item \(n\) - sample size + \end{itemize} \end{document}