\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{mmmmy} \pdfinfo{ /Title (hypothesis-testing-cheatsheet.pdf) /Creator (Cheatography) /Author (mmmmy) /Subject (Hypothesis testing cheatsheet Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{A3818B} \definecolor{LightBackground}{HTML}{F9F7F7} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{Hypothesis testing cheatsheet Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{mmmmy} via \textcolor{DarkBackground}{\uline{cheatography.com/132869/cs/26952/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}mmmmy \\ \uline{cheatography.com/mmmmy} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Published 10th March, 2021.\\ Updated 10th March, 2021.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{2} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{{\bf{ Introduction }}}} \tn % Row 0 \SetRowColor{LightBackground} Statistical hypothesis & Statistical hypothesis testing \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} a hypothesis that is testable on the basis of observed data modeled as the realized values taken by a collection of random variables & a statistical way of testing the assumption regarding a popular parameter \tn % Row Count 9 (+ 7) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{\{\{link="https://en.wikipedia.org/wiki/Statistical\_hypothesis\_testing"\}\}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{{\bf{steps of formulating a hypothesis}}}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{1. state the two hypothesis: {\bf{Null hypothesis}} and {\bf{Alternative hypothesis }}} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{2. set the {\bf{significance levels}} usually α = 0.05} \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{3. carrying out the hypothesis testing and calculate the test statistics and corresponding {\bf{P-value}}} \tn % Row Count 7 (+ 3) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{4. compare P-value with significance levels and then decide to accept or reject null hypothesis} \tn % Row Count 9 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{1.08 cm} x{2.664 cm} x{1.512 cm} x{1.944 cm} } \SetRowColor{DarkBackground} \mymulticolumn{4}{x{8.4cm}}{\bf\textcolor{white}{Errors in Testing}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{Error Types}} & {\bf{Description}} & {\bf{denotation}} & {\bf{correct inference}} \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} Type I error & {\bf{Reject}} null when null is true & α = P(Type I error) & 1 - α \seqsplit{(significance} level) \tn % Row Count 6 (+ 3) % Row 2 \SetRowColor{LightBackground} Type II error & {\bf{Not}} reject null when null is false & β = P(Type II error) & 1 - β (= power) \tn % Row Count 9 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}----} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{2.96 cm} x{5.04 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Chi-Square Test}} \tn % Row 0 \SetRowColor{LightBackground} Types & Description \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} Test for independence & tests for the independence of two categorical variables \tn % Row Count 4 (+ 3) % Row 2 \SetRowColor{LightBackground} Homogeneity of Variance & test if more than two subgroups of a population share the same multivariate distribution \tn % Row Count 8 (+ 4) % Row 3 \SetRowColor{white} goodness of fit & whether a multinomial model for the population distribution (P1,....Pm) fits our data \tn % Row Count 12 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{Test for independence and homogeneity of variance share the same test statistics and degree of freedoms by different design of experiment \newline \newline {\bf{Assumptions}} \newline 1. one or two categorical variables \newline 2. independent observations \newline 3. outcomes mutually exclusive \newline 4. large n and no more than 20\% of expected counts \textless{} 5} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{2.08 cm} x{5.92 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{F-test}} \tn % Row 0 \SetRowColor{LightBackground} Anova Analysis & comparing the means of two or more continuous populations \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} One-way layout & A test that allows one to make comparisons between the means of two or more groups of data. \tn % Row Count 6 (+ 4) % Row 2 \SetRowColor{LightBackground} two-way layout & A test that allows one to make comparisons between the means of two or more groups of data, where two independent variables are considered. \tn % Row Count 11 (+ 5) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{Assumptions about data: \newline 1. each data y is normally distributed \newline 2. the variance of each treatment group is same \newline 3. all observations are independent} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{2.72 cm} x{5.28 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{{\bf{T-test}}}} \tn % Row 0 \SetRowColor{LightBackground} Types & Hypothesis \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} {\bf{Two Sample T-test}} & If two independent groups have different mean \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} {\bf{Paired T-test}} & if one groups have different means at different times \tn % Row Count 6 (+ 3) % Row 3 \SetRowColor{white} {\bf{One Sample T-test}} & mean of a single group against a known mean \tn % Row Count 8 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{Assumptions about data \newline 1. independent \newline 2. normally distributed \newline 3. have a similar amount of variance within each group being compared} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{{\bf{Test Statistics formula -{}- T-test}}}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{} \tn % Row Count 0 (+ 0) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{One sample T-test}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{p{8.4cm}}{\vspace{1px}\centerline{\includegraphics[width=5.1cm]{/web/www.cheatography.com/public/uploads/mmmmy_1615278339_Screen Shot 2021-03-09 at 4.19.50 PM.png}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{where \newline m = the mean of sample \newline s = standard deviation of sample \newline degree of freedom = n - 1} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Paired T-test statistics}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{p{8.4cm}}{\vspace{1px}\centerline{\includegraphics[width=5.1cm]{/web/www.cheatography.com/public/uploads/mmmmy_1615278125_Screen Shot 2021-03-09 at 4.20.26 PM.png}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{where \newline m = the mean of differences between two paired sets of data \newline n = size of differences \newline s = the standard deviation of differences between two paired sets of data \newline degree of freedom = n - 1} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Independent two-sample T-test statistics}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{p{8.4cm}}{\vspace{1px}\centerline{\includegraphics[width=5.1cm]{/web/www.cheatography.com/public/uploads/mmmmy_1615278253_Screen Shot 2021-03-09 at 4.22.46 PM.png}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{where \newline m = the means of group A and B respectively \newline n = the sizes of group A and B respectively \newline degrees of freedom = nA + nB - 2 (given two samples have the same variance)} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{{\bf{Test statistics -{}-Chi-square test}}}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{} \tn % Row Count 0 (+ 0) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Test of independence and Homogeneity of variance}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{p{8.4cm}}{\vspace{1px}\centerline{\includegraphics[width=5.1cm]{/web/www.cheatography.com/public/uploads/mmmmy_1615283242_Screen Shot 2021-03-09 at 5.41.15 PM.png}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{where \newline Er,c = (Nr {\emph{ Nc)/n \newline df = (r - 1) }} (c - 1) \newline c = column number \newline r = row number} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Goodness of fit test}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{p{8.4cm}}{\vspace{1px}\centerline{\includegraphics[width=5.1cm]{/web/www.cheatography.com/public/uploads/mmmmy_1615280777_Screen Shot 2021-03-09 at 5.04.40 PM.png}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{where: \newline O = observed value of data \newline E = expected value of data \newline k = dimension of parameter \newline df = n -1 - k} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{p{0.76 cm} x{2.432 cm} x{4.408 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{8.4cm}}{\bf\textcolor{white}{Carrying out one-way anova test}} \tn % Row 0 \SetRowColor{LightBackground} SST & total variance & sum(Yij - overall mean of Y)\textasciicircum{}2\textasciicircum{} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} SSW & intra-group variance & sum(mean of each observations across different treatments - mean of each treatment)\textasciicircum{}2\textasciicircum{} \tn % Row Count 6 (+ 4) % Row 2 \SetRowColor{LightBackground} SSB & inter-group variance & sum(mean of each treatments - overall mean of Y)\textasciicircum{}2\textasciicircum{} \tn % Row Count 9 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}---} \SetRowColor{LightBackground} \mymulticolumn{3}{x{8.4cm}}{Null hypothesis: the differentiated effect in each treatment group is 0 \newline Alternative hypothesis: not all differentiated effect is 0 \newline \newline SST = SSW + SSB \newline \newline test statistics: \newline \newline Fi-1,i(j-1) = SSB/(I-1)/SSW/I(J-1) \newline \newline where \newline I = number of different treatments \newline J = number of observations within each treatment} \tn \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}