
Master statistics using R coding, data wrangling, ggplot2 visualizations, and the full logic of statistical inference with real data, uncertainty, and decision making.
Explore how R empowers statistical analysis with a rich package ecosystem, beautiful visualizations, and free, open-source access.
Start with no prerequisites, rely on computer aid, and practice to ease math anxiety; stay engaged, pause to answer questions, download code, and revisit earlier lessons as needed.
Explore how to turn quantitative data into qualitative health assessments by integrating BMI, resting heart rate, and blood pressure, and navigate conflicting signals with critical thinking.
Install R and RStudio desktop, then download and extract the course code from GitHub or clone the repository. Explore RStudio's console, interface tabs, and appearance settings as you get started.
Learn how to share the course's repository of example code responsibly, keep credit attributions intact, and add your name to the attributions when you edit.
Provide a crash course on the R language and tidyverse, covering basics like loops, if statements, and functions to build coding skills and a programmer mindset.
Master statistics using r shows how to use rmarkdown to organize code and produce html outputs for presentations. Configure headers, a floating table of contents, and tidyverse packages, then knit.
Use R like a calculator to perform arithmetic, modulo, exponents, and operations; explore infinities and NaN from division by zero, and distinguish NaN from NA with is.finite, is.nan, and is.na.
Explore the four basic R variable types: numeric, character, boolean, and complex, and learn type checking, coercion, and handling NA and NaN, with environment setup tips.
Explore five categories of data—interval, ratio, discrete, ordinal, and nominal—and how they map to R variable modes, highlighting terminology differences and common confusions.
Explore how R handles assignment by storing values into variables with = or the arrow operator, and notice the directionality in 5 -> W and Q <- 1.
Explore vectors in R: index numeric and boolean vectors, use colon and negative indexing, learn about length, coercion, recycling, and creating sequences with seek and rep.
Explore arrays and matrices in R, learn column major indexing, switch to row major, and perform matrix operations, binding, recycling, and dimension handling with dim, byrow, and cbind.
Master advanced matrix indexing in R by selecting rows, columns, and the last element with colons, negatives, and the dim function, plus array and transpose techniques.
Explore lists in R, a flexible data structure that stores mixed types, indexed by names or numeric indices, with double brackets, the dollar operator, and coercion to vectors.
Learn how single versus double square brackets affect lists in R, when to extract values with double brackets, and when to move items with single brackets.
Load data into R by building precise file paths and using path expand to handle tilde directories. Set a base GitHub path to access the data subfolder and the Ourworldindata Covid csv.
Explore how data frames in R organize names, ages, and graduation status from vectors into a readable table; compare them to lists and practice indexing with rbind and cbind.
Learn to load real-world covid data in R, subset to the US, clean Na values, select informative columns, and convert to a tibble with tidyverse tools.
Master how if statements control program flow by evaluating conditions such as x equals two or not equals, with else, nesting, and logical operators.
Learn to vectorize if statements in R, evaluating a whole vector in one line to yield true/false results and indices. Practice extracting value-specific indices and bracket indexing techniques.
Master for loops in R to count odds in a vector, iterate over values, and use break to stop early; explore runs of ones and the all function.
Explore logs and exponents in R by exponentiating with e, linking log as the inverse, and using plots to compare growth rates on base ten scales with covid data.
Create reusable functions in R to package run-detection logic for vectors x and y, returning results with a flexible k parameter and a default value.
Learn to simulate covid case counts with a function in R, using a multiplicative growth rate, handle indexing issues, and compare to real data to understand growth dynamics.
Organize R code with a helper script that stores functions, source it in your main script, and keep analyses clean and readable for Covid simulations and growth-rate plots.
Learn to use ChatGPT for coding help while first drafting code yourself, then refining it to translate ambiguous questions into analyzable R code and think like an analyst.
Explain tidying data with tidyverse, showing how to import, name variables clearly, consolidate into one tidy data frame, and prepare data for analysis and visualization.
Download data from the internet into R with read_csv, load the mismanaged plastic waste dataset from Tidytuesday, and inspect coastal population and missing values.
Learn to rename variables in a cost versus waste data frame to improve navigation. Use janitor's clean_names to create shorter, meaningful labels in camel, dash, or period formats.
Rename the variables in the plastic waste data set using janitor's clean names, then hard code clearer names like country, country code, year, mismanaged total, coastal pop, and total pop.
Learn to group by and summarize data with the Tidyverse to count observations and na values by year, comparing with base R.
Learn to filter a data frame to remove non-na rows using tidyverse, create a good count, and perform a country-by-country sanity check with group by country.
Explore subsetting country waste data in R by using the in operator with filtering to analyze a targeted set of countries.
Learn to select numeric columns from a data frame using base R and tidyverse. Use is.numeric and where to filter columns for analysis.
Learn how to clean, standardize, and merge three data frames in R to create one unified plastic waste dataset, focusing on 2010 observations and handling missing values.
Learn to compute column averages in a plastic waste data frame with across and summarize in R, filtering numeric columns and handling missing values.
Learn to pivot data frames in R, flipping between long and wide forms, using pivot wider and pivot longer, and defining ID columns to unify observations.
Import and clean csv data in R, set up the environment, inspect EEG delta and S&P 500 changes with histograms, and convert character columns to numeric for analysis.
Transform and tidy a large public health cardio data set from the CDC by pivoting wider, selecting relevant columns, and averaging over years to analyze cardiovascular risk factors across states.
Learn to import and tidy cardio data in R, focusing on age-adjusted, overall stratification, pivot wider, and year-averaged state summaries to predict cardiovascular disease.
Explore data visualizations with ggplot and the grammar of graphics, learning about data, geometric objects, mappings, scales, and coordinate systems to craft visualizations.
Learn to build line and scatter plots in ggplot2 with the mpg data set in R, mapping displacement to highway mpg using aes and geom_point.
Create line and scatter plots with ggplot on US covid data, mapping date to x and total cases to y. Tune scales and labels, including a log y option.
Learn to build bar plots with ggplot in R, adjust aesthetics and positions using stat identity and position dodge, and summarize highway miles per gallon by class.
Plot histograms with ggplot to compare highway miles per gallon over time by creating a change score per model across 1999 and 2008 and interpreting the distribution.
Explore how to edit ggplot aesthetics in R, including text, colors, and backgrounds. Create a reusable course theme, adjust grids and axis elements, and standardize visuals across plots.
Explore descriptive statistics and inferential statistics, learning to describe data with mean, median, mode, and variance, and to generalize findings using p values, confidence intervals, and hypothesis testing.
Understand that data are plural and derive insights by compressing multiple observations into statistics. Learn that data points lose individuality, enabling us to summarize trends while avoiding predictions about individuals.
Actively collect data because they don't naturally exist, and assess how measurement instruments introduce noise and bias, how easy-to-measure proxies reduce complexity but lose information.
Explain how accuracy and precision differ in data quality by examining bias and measurement consistency, using driving examples to illustrate variability and links to variance and standard deviation.
Identify five data types—interval numeric (temperature in Celsius), ratio numeric (money), discrete numeric (population), ordinal categorical (education level), nominal categorical (gender)—and relate them to R terminology and analyses.
Explore samples vs populations, why random sampling aims for representativeness, and how random assignment differs from random sampling, with practical examples of measurement sources and bias.
Examine how n equals one case reports and anecdotes challenge representativeness, and how follow-up can validate rare observations, as shown by the Alzheimer's disease example.
Distinguish fake data from simulated data, and learn when simulating supports testing assumptions and validating analysis while presenting data transparently and never misrepresenting real data.
Explore how data arise from multiple distributions, identify common shapes like uniform, normal, lognormal, and Poisson, and distinguish empirical from analytic distributions using R simulations.
Simulate data from normal, uniform, lognormal, and Poisson distributions in R using r norm, r unif, r l norm, and r plus, visualize with ggplot histograms and freq poly.
Explore central tendency in statistics using R: compare mean, median, and mode, examine how distributions—normal, log-normal, Poisson—shape these measures, and analyze the impacts of outliers and bimodality.
Explore calculating central tendency in R using simulated normal data, including mean, median, and mode, and visualize results with ggplot and vertical lines.
Explore calculating central tendency across normal, uniform, Poisson, and log-normal distributions in R, from manual coding to built-in functions, with hands-on plotting.
Explore parametric variability concepts by contrasting variance and standard deviation, linking them to normal vs lognormal distributions, with practical intuition through deviations from the mean and degrees of freedom.
Explore parametric variability calculations in R by computing standard deviation and variance from simulated normal, uniform, and Poisson data, with hands-on data wrangling, plotting, and using built-in functions.
Explore non-parametric measures of variability—range, interquartile range, and mean absolute deviation—and compare their robustness to extreme values with the standard deviation, using incomes as a practical example.
Explore non-parametric variability calculations in R, including range, interquartile range, and mean absolute deviation, with visualizations like box plots and practical examples across normal and skewed distributions.
Plot variability using error bars on a ggplot bar chart in R, showing highway means and standard deviations from the miles per gallon dataset.
Review four distributions: normal, log normal, Poisson, and uniform, and show how central tendency, variability, skewness, and box plots reveal mean, median, range, and interquartile range.
Determine which distribution fits real, unlabeled data using descriptive statistics. Explore brainwaves, emails per day, S&P 500 changes, and memory D to identify log-normal, Poisson, or normal shapes.
Explore describing real data in R via EEG, email, S&P 500, and memory datasets; learn data cleaning, ggplot visualizations, and descriptive statistics to identify log-normal, Poisson, and normal distributions.
Compare empirical occipital delta power data against analytic distributions (normal, lognormal, Poisson) using descriptive statistics as parameters, visualize with density-based plots and frequency polygons in R.
Explore plotting empirical data against analytic distributions in R, using offsets and descriptive stats to compare normal, Poisson, and log-normal fits across email times, S&P 500, and memory data.
Explore quantile-quantile plots to compare empirical data with theoretical distributions, using qnorm for 25th and 75th percentiles to distinguish normal and lognormal fits along a diagonal line.
Learn to build and interpret Q-Q plots in R to compare empirical data with normal, log-normal, Poisson, and uniform distributions, using descriptive statistics and a reusable Q-Q plots function.
Explore q-q plots calculations part 2 as you load email times data and S&P 500 data, perform descriptive statistics, compare uniform, Poisson, lognormal, and normal distributions, and interpret memory data.
Select descriptive statistics that fit the data’s distribution, using central tendency (mean, median, mode) and variability (standard deviation, MAD, interquartile range) guided by QQ plots.
Transform data through normalization, scaling, and transformations to simplify math and sharpen interpretation. Use log scaling, offsets, and unit choices to align analyses with normal distributions and data ranges.
Explore how log transforms connect log normal and normal distributions, showing that transforming log normal data yields normality and enables standard normal-based inferences.
Apply log transformations in R to normalize EEG data, compare log normal and normal distributions with density plots, and observe equivalence when exponentiating back.
Apply constant value transformations to shift data into positive range, enabling log transform and comparison to a log-normal distribution while analyzing S&P 500 daily changes.
Understand why the normal distribution is a bedrock of inferential statistics with its symmetry and clear probabilities across standard deviations, enabled by the central limit theorem.
Learn how z scores standardize data by centering on the mean and scaling by the standard deviation, revealing normal distribution insights and interpretation without changing shape.
Compute z scores for S&P 500 changes in R using the mean and standard deviation, visualize the histogram, and use pnorm to interpret probabilities under the normal distribution.
Calculate z-scores for extreme S&P 500 days, estimate rarity with the normal distribution, and simulate 1000 years using rnorm to compare daily extremes.
Compare model-based probabilities using the normal model (mean, sd, pnorm) with empirical proportions for a 1% S&P 500 gain, finding ~11% empirically and close alignment.
Stack log and z-score transformations to analyze EEG data. Compute log-space mean and standard deviation, convert to z-scores, and compare with raw data.
Learn how min-max scaling redefines data to a 0-1 range by subtracting the minimum and dividing by (max minus min), making extreme or non-normal data interpretable.
Apply min-max scaling in R by computing the minimum and maximum, subtracting the minimum, and dividing by the range to normalize memory scores from 0 to 1, with histogram visualization.
Review how to transform data to different scales for easier interpretation, using log scaling, shifting, z scoring, min-max scaling, and stacking transformations to normalize or standardize data.
Unlock the power of data by learning statistics the modern way—hands-on, intuitive, and with real-world tools. This course is designed for students, researchers, and professionals who want to move beyond memorizing formulas and truly understand how to analyze data. Using R programming and the tidyverse, you’ll build both the coding fluency and the statistical intuition you need to work like a real analyst.
We’ll start at the ground level: organizing messy datasets into tidy data, writing clean and reproducible code, and visualizing information effectively. From there, you’ll gain practical experience with the logic of inference—sampling variability, distributions, confidence intervals, and hypothesis testing—through approachable, step-by-step examples. Along the way, you’ll see how t-tests, chi-square, correlation, and regression all fit together under the same framework.
But this isn’t just another lecture-heavy course. You’ll code alongside me with guided exercises, code-along scripts, and real datasets, building a skill set you can apply immediately to assignments, theses, publications, or workplace projects. You’ll also explore more advanced techniques like bootstrapping, resampling, and regression modeling, reinforcing how these tools extend beyond the classroom and into research and professional practice.
By the end of this course, you’ll be able to:
Write R code that is clean, efficient, and reproducible.
Apply a broad set of inferential statistical methods to real data.
Visualize results in clear and compelling ways.
Develop the confidence to approach data like an experienced analyst.
Whether you’re new to statistics, transitioning into a data-focused role, or seeking a stronger foundation for research, this course offers a comprehensive, structured, and practical pathway to mastering statistics with R. Join today, and start building the tools to transform data into knowledge.