B Appendix C: Glossary of Terms

This appendix provides precise definitions of the key statistical computing and inferential concepts covered throughout this book.

Type I Error (Alpha, \(\alpha\))

The probability of rejecting the null hypothesis when it is actually true (a false positive). For example, concluding that a new treatment is effective when in reality it does not differ from the standard treatment. The threshold is typically set at \(0.05\).

Type II Error (Beta, \(\beta\))

The probability of failing to reject the null hypothesis when it is actually false (a false negative). For example, concluding that a new treatment has no effect when it actually does. The probability of avoiding a Type II error (\(1 - \beta\)) is known as the statistical power of a test.

Degrees of Freedom (df)

The number of independent pieces of information that go into estimating a parameter or calculating a test statistic. In categorical tables, it is computed as \((r-1)(c-1)\). In a one-sample \(t\)-test, it is \(n-1\).

Effect Size

A quantitative measure of the magnitude of a statistical phenomenon or relationship, independent of the sample size. Examples include the Phi coefficient (\(\phi\)) and Cramér’s \(V\) for chi-square tests, and the rank-biserial correlation \(r\) for Wilcoxon tests. Unlike p-values, which depend heavily on sample size, effect sizes indicate the practical significance of a result.

Discordant Pairs

In paired categorical data (e.g., analyzed using McNemar’s test), discordant pairs are subjects who changed their status between two measurements (e.g., Yes \(\rightarrow\) No, or No \(\rightarrow\) Yes). In contrast, concordant pairs are those whose status remained unchanged.

Bias-Corrected and Accelerated (BCa) Bootstrap

An advanced resampling method for constructing confidence intervals that adjusts for both bias (asymmetry between the median of the bootstrap estimates and the original sample estimate) and acceleration (skewness in the sampling distribution). It is more computationally intensive than percentile bootstrap intervals but achieves superior coverage accuracy for skewed data.

Lexical Scoping

The static scoping rules in R that determine how R searches for variables. Lexical scoping means that R looks up free variables in the environment where the function was defined, rather than the environment from which the function is called.

Parametric vs. Non-Parametric

  • Parametric tests (like \(t\)-tests and ANOVA) assume that the data follows a specific probability distribution (usually normal) and estimate parameters such as means and variances.
  • Non-parametric tests (like Wilcoxon and Kruskal-Wallis) make no assumptions about the underlying distribution, operating instead on ranks, signs, or medians. They are robust to outliers and skew but generally have lower statistical power when parametric assumptions are met.

Odds Ratio (OR)

A measure of association between an exposure and an outcome. The odds ratio represents the odds that an outcome will occur given a particular exposure, compared to the odds of the outcome occurring in the absence of that exposure. An \(\text{OR} = 1\) indicates no association.

Cohen’s Kappa (\(\kappa\))

A statistic that measures inter-rater agreement for qualitative (categorical) items, correcting for the agreement that would be expected by chance alone. Unweighted kappa treats all disagreements equally, while weighted kappa (linear or quadratic) penalizes disagreements based on their ordinal distance.

Yates’ Continuity Correction

An adjustment made to the chi-square formula in \(2 \times 2\) tables by subtracting \(0.5\) from the absolute difference between observed and expected counts. It prevents overestimating significance (inflating Type I error) in small samples.

Quantile

Points partition the range of a probability distribution into contiguous intervals with equal probabilities. The \(p\)-quantile is the value \(x\) such that the probability of the variable being less than or equal to \(x\) is exactly \(p\) (e.g., the 95th percentile).

Cumulative Probability

The probability that a random variable \(X\) takes a value less than or equal to \(x\), calculated as \(P(X \le x)\). In R, cumulative probabilities are computed using the p...() functions.

Vectorization

A programming paradigm in R where operations are applied to entire vectors or matrices at once rather than looping through individual elements. Vectorized code leverages low-level compiled implementations (C/Fortran) and is significantly faster than standard R loops.