CumulativeStudyGuide

Cumulative Study Guide: Business Statistics with R

A comprehensive, cumulative study guide and computational reference for applied business statistics. This repository combines textbook theory, mathematical formulas, and practical R implementations.

Disclaimer: These study materials were compiled by Gemini, with editing by me (@telpirion).


Overview

This repository provides reproducible study materials designed to reinforce core statistical foundations and their application in R. Each module includes:


Repository Structure

CumulativeStudyGuide/
β”œβ”€β”€ _quarto.yml               # Quarto configuration (routes preview/render output to guides/)
β”œβ”€β”€ AGENTS.md                 # Repository coding and notebook instructions
β”œβ”€β”€ CumulativeStudyGuide.code-workspace
β”œβ”€β”€ data/                     # Datasets for exercises and practical demonstrations
β”‚   β”œβ”€β”€ geyser.csv            # Old Faithful Geyser eruption intervals (WEEK1 & WEEK2)
β”‚   β”œβ”€β”€ home_prices.csv       # Home attributes and selling prices
β”‚   β”œβ”€β”€ hot_dogs.csv          # Hot dog types, calories, and sodium content (ANOVA & Week 6)
β”‚   β”œβ”€β”€ mileage.csv           # 1991 US EPA passenger car mileage, HP, and weight classes
β”‚   β”œβ”€β”€ newspapers.csv        # 1994 Gale Directory daily and Sunday newspaper circulations
β”‚   β”œβ”€β”€ nsalary.csv           # New Mexico social services salary data (rural vs. non-rural)
β”‚   β”œβ”€β”€ pontus.csv            # US Presidential inauguration ages and candidate heights
β”‚   β”œβ”€β”€ salaries.csv          # Forbes CEO age and salary data for 60 small business firms
β”‚   β”œβ”€β”€ shoppers.csv          # Store customer dollar spending amounts
β”‚   β”œβ”€β”€ tableware.csv         # Tableware types, polishing times, prices, and rates (ANOVA)
β”‚   └── tires.csv             # Tire treadwear data (weight loss vs. groove wear)
β”œβ”€β”€ guides/                   # Rendered HTML study guides and supporting web assets
β”‚   β”œβ”€β”€ Week1.html            # Rendered HTML study guide for Week 1
β”‚   β”œβ”€β”€ Week1_files/          # Supporting assets and plots for Week 1 HTML
β”‚   β”œβ”€β”€ Week2.html            # Rendered HTML study guide for Week 2
β”‚   β”œβ”€β”€ Week2_files/          # Supporting assets and plots for Week 2 HTML
β”‚   β”œβ”€β”€ Week3.html            # Rendered HTML study guide for Week 3
β”‚   β”œβ”€β”€ Week3_files/          # Supporting assets and plots for Week 3 HTML
β”‚   β”œβ”€β”€ Week4.html            # Rendered HTML study guide for Week 4 (self-contained)
β”‚   β”œβ”€β”€ Week5.html            # Rendered HTML study guide for Week 5 (self-contained)
β”‚   β”œβ”€β”€ Week6.html            # Rendered HTML study guide for Week 6 (self-contained)
β”‚   β”œβ”€β”€ Week7.html            # Rendered HTML study guide for Week 7
β”‚   β”œβ”€β”€ Week7_files/          # Supporting assets and dependencies for Week 7 HTML
β”‚   β”œβ”€β”€ Week8.html            # Rendered HTML study guide for Week 8
β”‚   β”œβ”€β”€ Week8_files/          # Supporting assets and plots for Week 8 HTML
β”‚   └── Week9.html            # Rendered HTML study guide for Week 9
β”œβ”€β”€ LICENSE                   # Repository license (MIT)
β”œβ”€β”€ README.md                 # Curriculum overview and repository documentation
β”œβ”€β”€ sources/                  # Curriculum slide decks, solution guides, and reference literature
β”‚   β”œβ”€β”€ Chapter12PracticeProblems.pdf
β”‚   β”œβ”€β”€ Chapter13PracticeProblems.pdf
β”‚   β”œβ”€β”€ Exercises.txt
β”‚   β”œβ”€β”€ Lesson_12_Simple_Regression_Analysis_and_Correlation_Solutions.pdf
β”‚   β”œβ”€β”€ R supplement to Business Statistics, Ch 12.R
β”‚   └── R supplement to Business Statistics, Ch 13.R
β”œβ”€β”€ Week1.Rmd                 # Source R Markdown document for Week 1 (Chapters 1 & 2)
β”œβ”€β”€ Week2.ipynb               # Jupyter Notebook with 41 study questions & 6 applied exercises
β”œβ”€β”€ Week2.Rmd                 # Source R Markdown document for Week 2 (Chapter 3)
β”œβ”€β”€ Week3.ipynb               # R Jupyter Notebook with 71 study questions & 3 applied exercises
β”œβ”€β”€ Week3.Rmd                 # Source R Markdown document for Week 3 (Chapters 4 & 5)
β”œβ”€β”€ Week4.ipynb               # R Jupyter Notebook with 72 study questions & 6 applied exercises
β”œβ”€β”€ Week4.Rmd                 # Source R Markdown document for Week 4 (Chapters 6 & 7, Wilcox 4.7)
β”œβ”€β”€ Week5.ipynb               # R Jupyter Notebook with 34 study questions & 6 applied exercises
β”œβ”€β”€ Week5.Rmd                 # Source R Markdown document for Week 5 (Chapter 8, Wilcox 6.5)
β”œβ”€β”€ Week6.ipynb               # R Jupyter Notebook with 69 study questions & 12 applied exercises
β”œβ”€β”€ Week6.Rmd                 # Source R Markdown document for Week 6 (Chapters 9 & 16)
β”œβ”€β”€ Week7.ipynb               # Jupyter Notebook with 44 study questions & applied exercises
β”œβ”€β”€ Week7.Rmd                 # Source R Markdown document for Week 7 (Chapter 10)
β”œβ”€β”€ Week8.ipynb               # Jupyter Notebook with ANOVA/Regression exercises
β”œβ”€β”€ Week8.Rmd                 # Source R Markdown document for Week 8 (Chapters 11 & 12)
β”œβ”€β”€ Week9.ipynb               # R Jupyter Notebook with 43 study questions & 9 applied exercises
└── Week9.Rmd                 # Source R Markdown document for Week 9 (Ch. 12.4–12.9, Wilcox 8.3 & Ch. 13)

Course & Topic Outline

Module Textbook Chapters Key Topics Study Materials R Implementations
Week 1 Ch. 1: Intro to Statistics
Ch. 2: Charts & Graphs
β€’ Populations vs. Samples
β€’ Levels of Measurement (Nominal, Ordinal, Interval, Ratio)
β€’ Frequency distributions, class marks, relative & cumulative frequency
β€’ Graphical displays & Pareto analysis
β€’ Ethical data presentation
β€’ Source (Week1.Rmd)
β€’ Rendered Guide (guides/Week1.html)
β€’ factor() / ordered factors
β€’ Frequency tables (cut(), table())
β€’ hist(), frequency polygon, ogive
β€’ stripchart() dot plots & stem()
β€’ barplot(), pie(), & Pareto charts
β€’ Two-variable plot() with lm() regression line
Week 2 Ch. 3: Descriptive Statistics β€’ Central Tendency (Mean, Median, Mode, Trimmed Mean)
β€’ Dispersion (Range, $IQR$, MAD, Variance, Standard Deviation, $CV$)
β€’ Grouped Data Central Tendency & Variance
β€’ Chebyshev’s Theorem vs. The Empirical Rule
β€’ Shape (Skewness, Kurtosis) & Tukey Outlier Fences
β€’ Wilcox Masking & Winsorized Variance
β€’ Pearson’s Correlation ($r$)
β€’ Source (Week2.Rmd)
β€’ Rendered Guide (guides/Week2.html)
β€’ Practice Notebook (Week2.ipynb)
β€’ mean(..., trim = 0.2), median(), table()
β€’ quantile(..., type = 6), IQR(), diff(range())
β€’ var(), sd(), custom calc_winsorized_var()
β€’ Grouped $\bar{x}$ & $s^2$ calculations
β€’ boxplot(..., horizontal = TRUE)
β€’ cor(), cor.test(), plot() with lm()
β€’ Applied analyses (mileage, shoppers, pontus, geyser)
Week 3 Ch. 4: Probability
Ch. 5: Discrete Distributions
Think Bayes Ch. 1–2
β€’ Classical, Relative Frequency & Subjective Probability
β€’ Counting Rules ($mn$ rule, Combinations)
β€’ Set Operations, Addition, Multiplication & Conditional Rules
β€’ Independence & Mutually Exclusive Events
β€’ Bayes’ Theorem (Diachronic & Table Method)
β€’ Discrete Expected Value & Variance
β€’ Binomial, Poisson & Hypergeometric Distributions
β€’ Source (Week3.Rmd)
β€’ Rendered Guide (guides/Week3.html)
β€’ Practice Notebook (Week3.ipynb)
β€’ sample(), expand.grid(), choose(), combn()
β€’ union(), intersect(), replicate()
β€’ Custom bayes_table() & discrete_summary()
β€’ dbinom(), pbinom(), dpois(), ppois()
β€’ dhyper(), phyper()
β€’ Monte Carlo simulations & ggplot2 PMF charts
Week 4 Ch. 6: Continuous Distributions
Ch. 7: Sampling & Sampling Distributions
Wilcox Ch. 4.7
β€’ Continuous Uniform, Normal ($z$) & Exponential Distributions
β€’ Normal Approximation to the Binomial ($\pm 0.5$ continuity correction)
β€’ Normality Diagnostics (Histograms, Density, Q-Q Plots)
β€’ Probability vs. Non-Probability Sampling & Error Types
β€’ Central Limit Theorem ($\bar{x}$ & $\hat{p}$) & FPC Factor
β€’ Wilcox Contaminated Normal & Log Back-Transformation
β€’ Source (Week4.Rmd)
β€’ Rendered Guide (guides/Week4.html)
β€’ Practice Notebook (Week4.ipynb)
β€’ dunif(), punif(), runif()
β€’ dnorm(), pnorm(), qnorm(), rnorm()
β€’ qqnorm(), qqline(), dexp(), pexp()
β€’ sample(), sample.int(), set.seed(), stratified sampling
β€’ CLT simulations & ggplot2 distribution curves
Week 5 Ch. 8: Estimation for Single Populations
Wilcox Ch. 6.5
β€’ Point vs. Interval Estimates & Probability Coverage ($1 - \alpha$)
β€’ Mean CIs ($\sigma$ known $z$-interval, FPC, & $\sigma$ unknown $t$-interval)
β€’ One-Sided Confidence Intervals
β€’ Proportion CIs (Wald, Agresti-Coull, Wilson Score, Blyth)
β€’ Variance ($\sigma^2$) & Standard Deviation ($\sigma$) $\chi^2$ CIs
β€’ Minimum Sample Size ($n$) for $\mu$ and $p$
β€’ Wilcox 20% Trimmed Mean (Winsorized SE), Bootstrap-$t$ & Percentile Bootstrap
β€’ Source (Week5.Rmd)
β€’ Rendered Guide (guides/Week5.html)
β€’ Practice Notebook (Week5.ipynb)
β€’ qnorm(), qt(), qchisq(), ceiling()
β€’ t.test() (two-sided & one-sided)
β€’ prop.test() & Agresti-Coull comparison
β€’ Custom var_conf_int_summary(), trim_ci(), boot_t_ci()
β€’ replicate(), sample(..., replace = TRUE), quantile()
β€’ Horizontal boxplot() & hot_dogs.csv analysis
Week 6 Ch. 9: Hypothesis Testing for Single Populations
Ch. 16: Analysis of Categorical Data
β€’ Eight-step hypothesis testing process & $p$-value method
β€’ Type I ($\alpha$), Type II ($\beta$), Power ($1 - \beta$), OC & Power curves
β€’ One-sample $z$-test & $t$-test for $\mu$
β€’ One-sample proportion $z$-test & variance $\chi^2$-test
β€’ Parametric vs. nonparametric methods
β€’ $\chi^2$ Goodness-of-Fit & Test of Independence
β€’ Source (Week6.Rmd)
β€’ Rendered Guide (guides/Week6.html)
β€’ Practice Notebook (Week6.ipynb)
β€’ Custom one_sample_z_test() & one_sample_var_test()
β€’ t.test(), prop.test(), pt(), pnorm()
β€’ qchisq(), pchisq(), chisq.test()
β€’ ggplot2 Power/OC curves & horizontal boxplots
β€’ Applied analyses (hot_dogs, salaries)
Week 7 Ch. 10: Inferences About Two Populations β€’ Test selection framework
β€’ Difference in two means ($\sigma$ known vs. unknown)
β€’ Pooled vs. Welch’s unequal-variance $t$-tests
β€’ Matched-pairs / related populations
β€’ Two-proportion $z$-tests & pooling
β€’ Two-variance $F$-tests
β€’ Ethical comparative analysis
β€’ Source (Week7.Rmd)
β€’ Rendered Guide (guides/Week7.html)
β€’ Practice Notebook (Week7.ipynb)
β€’ Custom two_sample_z_test()
β€’ t.test(..., var.equal = TRUE)
β€’ t.test(..., var.equal = FALSE)
β€’ t.test(..., paired = TRUE)
β€’ prop.test(..., correct = FALSE)
β€’ var.test()
Week 8 Ch. 11: Analysis of Variance
Ch. 12: Simple Linear Regression
β€’ One-Way ANOVA & partitioning $SS$
β€’ Tukey’s HSD post-hoc testing
β€’ Randomized Block & Two-Way ANOVA
β€’ Simple Linear Regression (OLS)
β€’ Correlation vs. Regression
β€’ Goodness of fit ($R^2$, $s_e$)
β€’ Source (Week8.Rmd)
β€’ Rendered Guide (guides/Week8.html)
β€’ Practice Notebook (Week8.ipynb)
β€’ aov() & summary(aov())
β€’ TukeyHSD()
β€’ lm()
β€’ summary(lm())
β€’ Residual analysis (plot(lm()))
β€’ predict()
Week 9 Ch. 12.4–12.9: Regression Inference & Forecasting
Wilcox Ch. 8.3: Correlation & $r^2$
Ch. 13: Multiple Regression
β€’ Residual diagnostics & LINE assumptions
β€’ Slope $t$-test, CI & ANOVA $F$-test equivalence
β€’ Confidence vs. Prediction intervals
β€’ Trend-line forecasting
β€’ Wilcox’s 5 distorting features & heteroscedasticity trap
β€’ Multiple regression, Adjusted $R^2$, dummy variables, $VIF$ & $\log_{10}$ transformations
β€’ Source (Week9.Rmd)
β€’ Rendered Guide (guides/Week9.html)
β€’ Practice Notebook (Week9.ipynb)
β€’ confint(), predict(..., interval = ...)
β€’ cor.test(), anova(), pf(), pt()
β€’ par(mfrow = c(2, 2)); plot(lm())
β€’ bartlett.test(), MASS::rlm()
β€’ Manual $VIF_j = 1/(1 - R_j^2)$ calculations
β€’ Applied analyses (tableware, newspapers, Airline Cost, Prime Interest Rate)

(Additional weekly modules will be added as the study guide expands.)


Prerequisites & Setup

R Environment

Required R Packages

Install the necessary visualization and publishing packages from CRAN:

install.packages(c("rmarkdown", "knitr", "ggplot2", "gridExtra"))

Rendering the Study Guides

Each study guide is authored in R Markdown (.Rmd) and configured to compile into a standalone HTML report with a floating table of contents in the guides/ directory.

To render via the R console:

# Render Week 1
rmarkdown::render("Week1.Rmd", output_dir = "guides")

# Render Week 2 (uses custom knit hook targeting guides/)
rmarkdown::render("Week2.Rmd", output_dir = "guides")

# Render Week 3
rmarkdown::render("Week3.Rmd", output_dir = "guides")

# Render Week 4 (uses custom knit hook targeting guides/)
rmarkdown::render("Week4.Rmd", output_dir = "guides")

# Render Week 5 (uses custom knit hook targeting guides/)
rmarkdown::render("Week5.Rmd", output_dir = "guides")

# Render Week 6 (uses custom knit hook targeting guides/)
rmarkdown::render("Week6.Rmd", output_dir = "guides")

# Render Week 7 (uses custom knit hook targeting guides/)
rmarkdown::render("Week7.Rmd", output_dir = "guides")

# Render Week 8
rmarkdown::render("Week8.Rmd", output_dir = "guides")

# Render Week 9 (uses custom knit hook targeting guides/)
rmarkdown::render("Week9.Rmd", output_dir = "guides")

Or from the command line:

Rscript -e 'rmarkdown::render("Week1.Rmd", output_dir = "guides")'
Rscript -e 'rmarkdown::render("Week2.Rmd", output_dir = "guides")'
Rscript -e 'rmarkdown::render("Week3.Rmd", output_dir = "guides")'
Rscript -e 'rmarkdown::render("Week4.Rmd", output_dir = "guides")'
Rscript -e 'rmarkdown::render("Week5.Rmd", output_dir = "guides")'
Rscript -e 'rmarkdown::render("Week6.Rmd", output_dir = "guides")'
Rscript -e 'rmarkdown::render("Week7.Rmd", output_dir = "guides")'
Rscript -e 'rmarkdown::render("Week8.Rmd", output_dir = "guides")'
Rscript -e 'rmarkdown::render("Week9.Rmd", output_dir = "guides")'

Using Positron or Quarto CLI:

quarto render Week1.Rmd
quarto render Week2.Rmd
quarto render Week3.Rmd
quarto render Week4.Rmd
quarto render Week5.Rmd
quarto render Week6.Rmd
quarto render Week7.Rmd
quarto render Week8.Rmd
quarto render Week9.Rmd

Editor


License

This project is licensed under the MIT License - see the LICENSE file for details.