\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{Dylan (dylablo)} \pdfinfo{ /Title (foundation-of-statistics-with-michael-cronin-ch-1.pdf) /Creator (Cheatography) /Author (Dylan (dylablo)) /Subject (Foundation of Statistics with Michael Cronin Ch 1 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}{A69ED9} \definecolor{LightBackground}{HTML}{F3F2FA} \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{Foundation of Statistics with Michael Cronin Ch 1 Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{Dylan (dylablo)} via \textcolor{DarkBackground}{\uline{cheatography.com/68322/cs/17324/}}} \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}Dylan (dylablo) \\ \uline{cheatography.com/dylablo} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Not Yet Published.\\ Updated 4th October, 2018.\\ 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{3.76 cm} x{4.24 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Simple Linear Regression}} \tn % Row 0 \SetRowColor{LightBackground} Regression & Studies the relationship between quantitative variables. \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} Simple Linear Regression & Only considers 2 variables \tn % Row Count 5 (+ 2) % Row 2 \SetRowColor{LightBackground} Response Variable & Usually denoted Y. We attempt to predict this. \tn % Row Count 8 (+ 3) % Row 3 \SetRowColor{white} Predictor Variable & Usually denoted X. We use this to predict Y. \tn % Row Count 11 (+ 3) % Row 4 \SetRowColor{LightBackground} (x`i`,y`i`) & The values for X and Y at case i. We usually denote n to be the number of cases. \tn % Row Count 15 (+ 4) % Row 5 \SetRowColor{white} \mymulticolumn{2}{x{8.4cm}}{} \tn % Row Count 15 (+ 0) % Row 6 \SetRowColor{LightBackground} Outline of Simple Linear Regression & Assume a linear relationship between X and Y: Y = β`0`+β`1` \tn % Row Count 18 (+ 3) % Row 7 \SetRowColor{white} β`0` & The intercept ie. the value of Y when X=0, ie where the line crosses the Y axis. \tn % Row Count 22 (+ 4) % Row 8 \SetRowColor{LightBackground} β`1` & The slope. The change in Y for a single unit change in X. \tn % Row Count 25 (+ 3) % Row 9 \SetRowColor{white} & We estimate β`0`and β`1`from the data and use the model to predict Y for any given X. \tn % Row Count 30 (+ 5) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{3.76 cm} x{4.24 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Simple Linear Regression (cont)}} \tn % Row 10 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{} \tn % Row Count 0 (+ 0) % Row 11 \SetRowColor{white} \mymulticolumn{2}{x{8.4cm}}{Methods of Linear Regression} \tn % Row Count 1 (+ 1) % Row 12 \SetRowColor{LightBackground} Scatter Plot & Put all points on a scatter plot and gauge visually whether or not the relationship looks linear. \tn % Row Count 6 (+ 5) % Row 13 \SetRowColor{white} Line of Closest Fit & If the relationship looks linear then we find the line fo closest fit and use it to estimate β`0` and β`1` \tn % Row Count 12 (+ 6) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{3.76 cm} x{4.24 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Co-Variance and Independent Variables}} \tn % Row 0 \SetRowColor{LightBackground} Independent Events & P(A|B)=P(A) \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} Independent Discrete Variables & P(X = x and Y=y) = P(X=x)P(Y=y) \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} Independent Continuous Variables & The joint pdf of X and Y = h(x,y) = fx(x)gy(y) - the product of individual pdfs. \tn % Row Count 7 (+ 4) % Row 3 \SetRowColor{white} Covariance & "the mean value of the product of the deviations of two variates from their respective means"\{\{nl\}\}Covariance of X and Y = cov(X,Y) = E(X - μ`1`)(Y - μ`2`) where μ`1`=E(X) and μ`2`=E(Y) \tn % Row Count 16 (+ 9) % Row 4 \SetRowColor{LightBackground} Covariance of independent variables & cov(X,Y)=0 \tn % Row Count 18 (+ 2) % Row 5 \SetRowColor{white} Covariance as defined by the book & Measures the association between X and Y, the extent to which they vary together.\{\{nl\}\}If large X occurs with large Y and small x with small y, there is a positive association ie. cov(X,Y) \textgreater{} 0.\{\{nl\}\}If large X occurs with small y and Large Y occurs with small x, there is a negative associationie. cov(X,Y) \textless{} 0. \tn % Row Count 33 (+ 15) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{3.76 cm} x{4.24 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Co-Variance and Independent Variables (cont)}} \tn % Row 6 \SetRowColor{LightBackground} Direction of association & + indicates postive direction, - indicates negative direction. \tn % Row Count 3 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{3.36 cm} x{4.64 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Least Squares Criterion}} \tn % Row 0 \SetRowColor{LightBackground} Intro & In a scatter plot there could be many potential lines that could fit the data. We use the Least SquaresCriterion to select the best line. \tn % Row Count 6 (+ 6) % Row 1 \SetRowColor{white} e`i`(error) & THe difference between what the line says the value should be and what it actually is. \tn % Row Count 10 (+ 4) % Row 2 \SetRowColor{LightBackground} e`i`(residual) & Difference between the fitted line and actual reality \tn % Row Count 13 (+ 3) % Row 3 \SetRowColor{white} Residual Sum of Squares (RSS) & We chose β`0` and β`1` so as to minimize RSS. \tn % Row Count 16 (+ 3) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{\textasciicircum{} above a letter indicates we are using an estimator} \tn % Row Count 18 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Least Sum of Squares Important Formula}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{p{8.4cm}}{\vspace{1px}\centerline{\includegraphics[width=5.1cm]{/web/www.cheatography.com/public/uploads/dylablo_1538659112_leastsquares.PNG}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{RSS=min(\textbackslash{}sum\_\{i=1\}\textasciicircum{}n\textbackslash{}hat\{e\}\_i\textasciicircum{}2)\textbackslash{}\textbackslash{}Through\textbackslash{} Partial\textbackslash{} differentiation\textbackslash{} we\textbackslash{} derive\textbackslash{} the\textbackslash{} estimators...\textbackslash{}\textbackslash{}\textbackslash{}hat\{β\}\_\{1\}=\textbackslash{}frac\{SXY\}\{SXX\}\textbackslash{}\textbackslash{}\textbackslash{}hat\{β\}\_\{0\}=\textbackslash{}bar\{y\}-\textbackslash{}hat\{β\}\_\{1\}\textbackslash{}bar\{x\}} \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}{Errors}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{Real data almost never falls in a perfectly straight line. ie. Real data rarely has a perfectly linear relationship. As such real data has errors which could be... \newline % Row Count 4 (+ 4) - Measurement Errors: Continuous Variables cannot be measured with 100\% accuracy. \newline % Row Count 6 (+ 2) - An effect of variables not included in the model \newline % Row Count 8 (+ 2) - Natural variability. \newline % Row Count 9 (+ 1) We should incorporate them into our simple linear regression models. eg. \newline % Row Count 11 (+ 2) y`i` = β`0` + β`1`x`i` + e`i` where e`i` is the error on the ith case \newline % Row Count 13 (+ 2) and \newline % Row Count 14 (+ 1) y`i` = β`0` + β`1`x`i` is the true regression line \newline % Row Count 16 (+ 2) {\emph{*}} \newline % Row Count 17 (+ 1) Assumptions about errors: \newline % Row Count 18 (+ 1) We make these assumptions as we need them to... \newline % Row Count 19 (+ 1) - prove the optimaity ofthe estimates for β`0` and β`1` \newline % Row Count 21 (+ 2) - prove the confidence intervals for β`0` and β`1` \newline % Row Count 23 (+ 2) e`i` \textasciitilde{} NID(0,σ\textasciicircum{}2\textasciicircum{}) \newline % Row Count 24 (+ 1) - N: Normally distributed with mean 0 \newline % Row Count 25 (+ 1) - I: Independent variables \newline % Row Count 26 (+ 1) - D: Distributed. \newline % Row Count 27 (+ 1) - σ\textasciicircum{}2\textasciicircum{}: Common Variance. \newline % Row Count 28 (+ 1) - "e`i` is normally distributed with mean 0 and common variance of σ\textasciicircum{}2\textasciicircum{}" \newline % Row Count 30 (+ 2) } \tn \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Errors (cont)}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{These assumption can also be expressed in terms of "Co-Variance" \newline % Row Count 2 (+ 2) E(e`i`) = 0, var(e`i`) = σ\textasciicircum{}2\textasciicircum{}, cov(e`i`,e`j`) = 0, for i ≠ j \newline % Row Count 4 (+ 2) - "Expected value e`i` is 0, variance is σ\textasciicircum{}2\textasciicircum{}, covariance of e`i` and e`j` is 0 where i is not j" \newline % Row Count 6 (+ 2) Combined with the normality assumptions, this implies e`i`s are independent. \newline % Row Count 8 (+ 2) Assumptions must be verified when applying to a regression model.% Row Count 10 (+ 2) } \tn \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}{Sample Correlation Coefficient r`xy`}} \tn % Row 0 \SetRowColor{LightBackground} r`xy` = & SXY/sqrt((SXX)(SYY)) = {[}SXY/(n-1{]}/{[}sqrt((SXX/n-1)(SYY/n-1)){]} \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} Correlation Coefficient & r`xy` is the sample covariance scaled to lie in{[}-1,1{]}. ie. -1\textless{}=r`xy`\textless{}=1 \tn % Row Count 6 (+ 3) % Row 2 \SetRowColor{LightBackground} r`xy`\textgreater{}0 & Positive association \tn % Row Count 7 (+ 1) % Row 3 \SetRowColor{white} r`xy`\textless{}0 & Negative association \tn % Row Count 8 (+ 1) % Row 4 \SetRowColor{LightBackground} r`xy`=1 & All points lie on positive slope. The closer r`xy` is to 1, the closer all points are to lying on the positive line. \tn % Row Count 13 (+ 5) % Row 5 \SetRowColor{white} r`xy`=-1 & All points lie on negative slope. The closer r`xy` is to -1, the closer all points are to lying on the negative line. \tn % Row Count 18 (+ 5) % Row 6 \SetRowColor{LightBackground} Bivariate Regression & rr and/or its square r\textasciicircum{}2\textasciicircum{} is used to measure howwell the linear model fits the data. \tn % Row Count 22 (+ 4) % Row 7 \SetRowColor{white} Multiple Regression & The multiple correlation coefficient (R\textasciicircum{}2\textasciicircum{}) is used to measure how well the linear model fits the data. \tn % Row Count 27 (+ 5) % Row 8 \SetRowColor{LightBackground} x-bar/x̅ & Indicates the sample mean of x \tn % Row Count 29 (+ 2) % Row 9 \SetRowColor{white} SXY & The standard deviation of X on Y \tn % Row Count 31 (+ 2) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{2.96 cm} x{5.04 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Sample Correlation Coefficient r`xy` (cont)}} \tn % Row 10 \SetRowColor{LightBackground} Linearity & Linearity cannot be deduuced from correlation coefficient. It should be paired with the scatter plot and never be considered in isolation. \tn % Row Count 6 (+ 6) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{3.12 cm} x{4.88 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{The X\textasciicircum{}2\textasciicircum{} Distribution (Chi-Squared)}} \tn % Row 0 \SetRowColor{LightBackground} Degrees of Freedom (df) & The number of different values/quantities which a distribution can be assigned. \tn % Row Count 4 (+ 4) % Row 1 \SetRowColor{white} X\textasciicircum{}2\textasciicircum{}(v) & A chi-squared distribution with v df. \tn % Row Count 6 (+ 2) % Row 2 \SetRowColor{LightBackground} E(X\textasciicircum{}2\textasciicircum{}(v)) = v & ie. The expeced value of a X\textasciicircum{}2\textasciicircum{} distribution with v df, is v. \tn % Row Count 9 (+ 3) % Row 3 \SetRowColor{white} RSS/σ\textasciicircum{}2\textasciicircum{} \textasciitilde{} X\textasciicircum{}2\textasciicircum{}(n-2) & So...\{\{nl\}\}E(RSS/σ\textasciicircum{}2\textasciicircum{}) =\textgreater{} E(X\textasciicircum{}2\textasciicircum{}(n-2)) = n-2 and so E(RSS/n-2)=σ\textasciicircum{}2\textasciicircum{} \tn % Row Count 12 (+ 3) % Row 4 \SetRowColor{LightBackground} RSS/n-2 & An unbiased estimate of σ\textasciicircum{}2\textasciicircum{}. \tn % Row Count 14 (+ 2) % Row 5 \SetRowColor{white} sqrt(σ\textasciicircum{}2\textasciicircum{}) = σ & Estimate of Standard Error of Regression/Residual Standard Error(in R) \tn % Row Count 17 (+ 3) % Row 6 \SetRowColor{LightBackground} sqrt(estimated variance) = & standard error \tn % Row Count 19 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}