Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

This is the course formula sheet, organized by topic in the order the book teaches them. Every symbol is defined the first time it appears, and the notation matches the glossary and the mosaic/BSDA functions you run in the labs. This page is reference-sheet material — the kind your instructor may allow on an exam (see the course randomization & exam policy).


11. Descriptive statistics

For a numerical variable with values x1,x2,,xnx_1, x_2, \dots, x_n (nn = number of observations):

QuantityFormulaSymbols
Sample meanxˉ=1ni=1nxi\displaystyle \bar{x} = \frac{1}{n}\sum_{i=1}^{n} x_ixˉ\bar{x} = sample mean; xix_i = the ii-th value; \sum = “sum over all values”
Sample variances2=1n1i=1n(xixˉ)2\displaystyle s^2 = \frac{1}{n-1}\sum_{i=1}^{n}(x_i - \bar{x})^2s2s^2 = sample variance; n1n-1 = degrees of freedom
Sample standard deviations=s2s = \sqrt{s^2}ss = typical distance of a value from xˉ\bar{x}
Rangemaxmin\text{max} - \text{min}largest minus smallest value
Interquartile rangeIQR=Q3Q1\text{IQR} = Q_3 - Q_1Q1,Q3Q_1, Q_3 = first and third quartiles (25th, 75th percentiles)
Outlier rule (1.5 × IQR)below Q11.5IQRQ_1 - 1.5\,\text{IQR} or above Q3+1.5IQRQ_3 + 1.5\,\text{IQR}flags unusually distant points
z-score (standardized value)z=xxˉs\displaystyle z = \frac{x - \bar{x}}{s}zz = number of SDs xx lies from the mean

Population versions replace xˉ\bar{x} with μ\mu (population mean), ss with σ\sigma (population SD), and divide the variance by NN (population size) instead of n1n-1.


22. Probability

RuleFormulaSymbols
Probability bounds0P(A)10 \le P(A) \le 1P(A)P(A) = probability of event AA
ComplementP(Ac)=1P(A)P(A^c) = 1 - P(A)AcA^c = “AA does not happen”
Addition (general)P(A or B)=P(A)+P(B)P(A and B)P(A \text{ or } B) = P(A) + P(B) - P(A \text{ and } B)subtract the overlap once
Addition (disjoint)P(A or B)=P(A)+P(B)P(A \text{ or } B) = P(A) + P(B)disjoint = cannot both happen
Multiplication (independent)P(A and B)=P(A)P(B)P(A \text{ and } B) = P(A)\,P(B)only when A,BA, B independent
Conditional probabilityP(AB)=P(A and B)P(B)\displaystyle P(A \mid B) = \frac{P(A \text{ and } B)}{P(B)}P(AB)P(A\mid B) = probability of AA given BB occurred
Independence checkA,BA,B independent iff P(AB)=P(A)P(A\mid B) = P(A)

33. Random variables & the Normal model

For a discrete random variable XX taking values xix_i with probabilities P(xi)P(x_i):

QuantityFormulaSymbols
Expected value (mean)μ=E(X)=ixiP(xi)\displaystyle \mu = E(X) = \sum_i x_i\,P(x_i)μ\mu = long-run average of XX
Varianceσ2=i(xiμ)2P(xi)\displaystyle \sigma^2 = \sum_i (x_i - \mu)^2\,P(x_i)σ2\sigma^2 = spread of XX
Standard deviationσ=σ2\sigma = \sqrt{\sigma^2}

Binomial model (count of successes in nn independent trials, each with success probability pp):

P(X=k)=(nk)pk(1p)nk,μ=np,σ=np(1p)P(X = k) = \binom{n}{k}\,p^k (1-p)^{\,n-k}, \qquad \mu = np, \qquad \sigma = \sqrt{np(1-p)}

where kk = number of successes and (nk)=n!k!(nk)!\binom{n}{k} = \dfrac{n!}{k!\,(n-k)!} is the number of ways to choose kk successes.

Normal distribution N(μ,σ)N(\mu, \sigma) — standardize any value to a zz-score:

z=xμσz = \frac{x - \mu}{\sigma}

68–95–99.7 rule: about 68%, 95%, and 99.7% of values fall within 1, 2, and 3 standard deviations of the mean. (Exact areas, computed from the Normal model: 0.6827, 0.9545, 0.9973 — see the distribution tables.)


44. Sampling distributions & the CLT

The sampling distribution of a statistic describes how it varies from sample to sample. Its standard deviation is the standard error (SE).

StatisticCenterStandard errorSymbols
Sample mean xˉ\bar{x}μ\muSExˉ=σn    sn\displaystyle SE_{\bar{x}} = \frac{\sigma}{\sqrt{n}} \;\approx\; \frac{s}{\sqrt{n}}σ\sigma = pop. SD; ss = sample SD; nn = sample size
Sample proportion p^\hat{p}ppSEp^=p(1p)n\displaystyle SE_{\hat{p}} = \sqrt{\frac{p(1-p)}{n}}pp = pop. proportion; p^\hat{p} = sample proportion

Central Limit Theorem. When observations are independent and nn is large enough, the sampling distribution of xˉ\bar{x} (or p^\hat{p}) is approximately N ⁣(μ, σ/n)N\!\left(\mu,\ \sigma/\sqrt{n}\right) regardless of the population’s shape. The n\sqrt{n} in the denominator is why quadrupling the sample size only halves the standard error.


55. Confidence intervals (general form)

estimate  ±  (critical value)×(standard error)\text{estimate} \;\pm\; (\text{critical value}) \times (\text{standard error})

The critical value comes from the Normal (zz^\star) or tt (tdft^\star_{df}) distribution and matches the confidence level; the second factor is the margin of error, EE.

ParameterIntervalCritical valueConditions
One proportion ppp^±zp^(1p^)n\displaystyle \hat{p} \pm z^\star \sqrt{\frac{\hat{p}(1-\hat{p})}{n}}zz^\starindependence; np^10n\hat{p} \ge 10 and n(1p^)10n(1-\hat{p}) \ge 10
Diff. of proportions p1p2p_1-p_2(p^1p^2)±zp^1(1p^1)n1+p^2(1p^2)n2\displaystyle (\hat{p}_1-\hat{p}_2) \pm z^\star \sqrt{\frac{\hat{p}_1(1-\hat{p}_1)}{n_1} + \frac{\hat{p}_2(1-\hat{p}_2)}{n_2}}zz^\starsuccess–failure 10\ge 10 in both groups
One mean μ\muxˉ±tdfsn\displaystyle \bar{x} \pm t^\star_{df}\,\frac{s}{\sqrt{n}},   df=n1\;df = n-1tdft^\star_{df}independence; roughly Normal or n30n \ge 30
Diff. of means μ1μ2\mu_1-\mu_2(xˉ1xˉ2)±tdfs12n1+s22n2\displaystyle (\bar{x}_1-\bar{x}_2) \pm t^\star_{df}\sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}}tdft^\star_{df}independence; each group Normal or n30n\ge 30
Paired mean μd\mu_dxˉd±tdfsdn\displaystyle \bar{x}_d \pm t^\star_{df}\,\frac{s_d}{\sqrt{n}},   df=n1\;df = n-1tdft^\star_{df}differences independent and roughly Normal

Common zz^\star values (two-sided), computed from the Normal model: z90%=1.645z^\star_{90\%} = 1.645, z95%=1.960z^\star_{95\%} = 1.960, z99%=2.576z^\star_{99\%} = 2.576.


66. Hypothesis tests — the general recipe

Every test follows the same arc. The test statistic measures how far the estimate sits from the null value, in standard-error units:

test statistic=point estimatenull valuestandard error (under H0)\text{test statistic} = \frac{\text{point estimate} - \text{null value}} {\text{standard error (under } H_0)}

A large statistic produces a small p-value = P(result at least this extremeH0 true)P(\text{result at least this extreme} \mid H_0 \text{ true}). Reject H0H_0 when p-value <α< \alpha (the significance level).

6.16.1 Proportions

One proportion (H0:p=p0H_0: p = p_0): the SE uses the null value p0p_0.

z=p^p0p0(1p0)nz = \frac{\hat{p} - p_0}{\sqrt{\dfrac{p_0(1-p_0)}{n}}}

Two proportions (H0:p1=p2H_0: p_1 = p_2): use the pooled proportion p^=x1+x2n1+n2\hat{p} = \dfrac{x_1 + x_2}{n_1 + n_2} (total successes over total sample) for the test SE:

z=p^1p^2p^(1p^)(1n1+1n2)z = \frac{\hat{p}_1 - \hat{p}_2} {\sqrt{\hat{p}(1-\hat{p})\left(\dfrac{1}{n_1} + \dfrac{1}{n_2}\right)}}

where x1,x2x_1, x_2 = successes and n1,n2n_1, n_2 = sample sizes in each group.

6.26.2 Means (t-tests)

One mean (H0:μ=μ0H_0: \mu = \mu_0), df=n1df = n-1:

t=xˉμ0s/nt = \frac{\bar{x} - \mu_0}{s/\sqrt{n}}

Paired mean — reduce the pairs to differences did_i, then run a one-sample tt on the differences (xˉd\bar{x}_d = mean difference, sds_d = SD of differences, df=n1df = n-1):

t=xˉd0sd/nt = \frac{\bar{x}_d - 0}{s_d/\sqrt{n}}

Two independent means (H0:μ1=μ2H_0: \mu_1 = \mu_2):

t=(xˉ1xˉ2)0s12n1+s22n2t = \frac{(\bar{x}_1 - \bar{x}_2) - 0} {\sqrt{\dfrac{s_1^2}{n_1} + \dfrac{s_2^2}{n_2}}}

with degrees of freedom from software (Welch’s approximation; a conservative hand value is df=min(n11, n21)df = \min(n_1 - 1,\ n_2 - 1)).

6.36.3 Chi-square (χ2\chi^2)

For a table of observed counts OO with expected counts EE computed under the null:

χ2=(OE)2E\chi^2 = \sum \frac{(O - E)^2}{E}
TestExpected count EEDegrees of freedom
Goodness of fit (kk categories)Ei=npiE_i = n\,p_idf=k1df = k - 1
Independence (r×cr \times c table)E=(row total)(column total)grand totalE = \dfrac{(\text{row total})(\text{column total})}{\text{grand total}}df=(r1)(c1)df = (r-1)(c-1)

OO = observed count in a cell; EE = expected count if H0H_0 were true; pip_i = hypothesized proportion for category ii; r,cr, c = numbers of rows and columns. Condition: every expected count E5E \ge 5.

6.46.4 ANOVA (comparing many means)

H0H_0: all group means equal. With kk groups and NN total observations, the FF-statistic is the ratio of between-group to within-group variation:

F=MSGMSE=SSG/(k1)SSE/(Nk)F = \frac{\text{MSG}}{\text{MSE}} = \frac{\text{SSG}/(k-1)}{\text{SSE}/(N-k)}
TermFormulaMeaning
SSG (between)j=1knj(xˉjxˉ)2\displaystyle \sum_{j=1}^{k} n_j (\bar{x}_j - \bar{x})^2how far group means spread from the overall mean
SSE (within)j=1ki(xijxˉj)2\displaystyle \sum_{j=1}^{k}\sum_{i} (x_{ij} - \bar{x}_j)^2leftover variation inside the groups
MSGSSG/(k1)\text{SSG}/(k-1)between-group mean square; df1=k1df_1 = k-1
MSESSE/(Nk)\text{SSE}/(N-k)within-group mean square; df2=Nkdf_2 = N-k

kk = number of groups; NN = total sample size; njn_j = size of group jj; xˉj\bar{x}_j = mean of group jj; xˉ\bar{x} = grand mean; xijx_{ij} = the ii-th value in group jj. A large FF (small p-value) signals that at least one group mean differs.


77. Simple linear regression (SLR)

Model:   y^=b0+b1x  \;\hat{y} = b_0 + b_1 x\; — the least-squares line through points (xi,yi)(x_i, y_i).

QuantityFormulaSymbols
Correlationr=1n1(xixˉsx) ⁣(yiyˉsy)\displaystyle r = \frac{1}{n-1}\sum \left(\frac{x_i - \bar{x}}{s_x}\right)\!\left(\frac{y_i - \bar{y}}{s_y}\right)r[1,1]r \in [-1,1]; sx,sys_x, s_y = SDs of xx and yy
Slopeb1=rsysx\displaystyle b_1 = r\,\frac{s_y}{s_x}change in y^\hat{y} per 1-unit rise in xx
Interceptb0=yˉb1xˉb_0 = \bar{y} - b_1 \bar{x}y^\hat{y} when x=0x = 0
Predicted valuey^i=b0+b1xi\hat{y}_i = b_0 + b_1 x_imodel’s estimate for observation ii
Residualei=yiy^ie_i = y_i - \hat{y}_iobserved minus predicted
R-squaredR2=r2R^2 = r^2fraction of variation in yy explained by xx
Slope testt=b10SEb1\displaystyle t = \frac{b_1 - 0}{SE_{b_1}},   df=n2\;df = n-2tests H0:β1=0H_0: \beta_1 = 0 (no linear relationship)
Slope CIb1±tdfSEb1b_1 \pm t^\star_{df}\,SE_{b_1}β1\beta_1 = true population slope

Here β0,β1\beta_0, \beta_1 are the population intercept and slope; b0,b1b_0, b_1 are their sample estimates; SEb1SE_{b_1} = standard error of the slope (from software). Conditions: linearity, independent residuals, roughly Normal residuals, and constant residual spread (equal variance).