
Explore the fundamentals and basic concepts of statistics with unique, detailed explanations for beginners, taught by Sara Sadik and applied to real life data sets using a programming language.
Discover why the free, widely used R is ideal for statistical computing in data science and machine learning, with small, easy steps and no coding experience required.
Explore what R and R Studio are, why R Studio acts as the interface to the R brain, and how typing commands in R Studio execute in R.
Install the latest R by downloading the base installer for Windows, Linux, or macOS, accept default options, set the install path, create shortcuts, and download the studio.
Download and install RStudio from the installer page, run the setup, choose an install path, complete installation, and open RStudio from the start menu or taskbar to explore its interface.
Explore the RStudio interface, focusing on the console and help tab, run code, view errors, and use the tutorial tab to practice with data frames like mpg.
Explore the RStudio interface essentials by navigating the file, packages, plot, and environment tabs, with a preview of project folders, installed packages, and generated data objects.
Create a new project, save its folder on the desktop, and open the project file to access the AR studio within the working directory of the project.
Download and extract the R Script and Data zip, organize the folders in your project, open the RStudio project, and create a new script file; then learn about R packages.
Explore how to download, install, load, and update R packages from the CRAN repository, using mobile apps as an analogy for expanding functionality in R.
Install the ggplot2 package for data visualization and the readxl package for reading Excel files in R, using the packages tab or the console, and ensure dependencies are installed.
Learn to load packages at the top of your R code using library('ggplot2'), run code to access package functions, reload on restart, and access help with ?ggplot2.
Explore the data sets package in R and the women data set, a data frame with 15 observations on height and weight for American women aged 30–39.
Clean the working space in R Studio by deleting all objects with the broom, including hidden ones, and clear the console, preparing for viewing data sets with R functions.
Load the built-in women data frame in R with data() and no library needed, and view it in the environment to get a feel before applying statistical commands.
Open the data frame with the view() function to use the built-in viewer. Hover over height and weight to see numeric ranges 58–72 and 110–170.
Load the deployer package and use the glimpse function to explore a data frame. The mtcars example shows 32 rows, 11 columns, and double-typed variables with the first few entries.
Explore types of variables in R by loading the air quality data set, inspecting its structure, and identifying six variables, including ozone, solar, temperature, month, and day, as integer variables.
Explore integers as whole numbers, including negative, zero, and positive values, as a discrete data type in statistics in R, with examples like kids, deaths, purchases, and books.
Explore numerics in R by distinguishing numeric values and continuous data, with examples like height, time, and money, and illustrate the length variable in the tooth growth dataset.
Explore factors, or categorical variables, by examining a two-level supplement variable with orange juice and vitamin C, and understand how these levels influence tooth growth in guinea pigs.
Identify unordered and ordered categorical variables in R using factors, with diet as unordered categories and weight-ordered factors, and use levels to reveal category order.
Explore how a studio-like console uses red, black, and blue messages to indicate errors, warnings, and information, and set up expectations for discussing errors in the next lecture.
Explore how R displays error messages in red, such as 'error in glimpse' when a function isn’t found. Load the correct library to fix it and view data set details.
Identify how to distinguish errors from informational messages in R, including loading packages, note that function outputs appear in black while code runs in blue or black, and recognize warnings.
Explore how warning messages in R appear when taking the square root of a negative number, producing NaN, and learn to fix issues that could affect your result.
Identify the three message types in data work: errors stop progress, warnings signal caution, and simple messages indicate safe continuation. Preview population and its subjects.
Explore how statistics studies populations by defining subjects and examining real-world exemplars like orange trees, cars, and chickens; learn to load and explore data sets and help files.
Explore how statistical questions aim to understand the population by selecting a sample and collecting data. Learn the two data types, categorical and quantitative.
Identify a population, select a sample, and collect data to explore five types of statistical questions—descriptive, comparative, relationship, causal, and predictive—preparing you for the next lecture on descriptive questions.
Summarize data sets with descriptive questions by using mean, median, mode, standard deviation, and proportion to reveal populations and behaviors through examples like average height and belief proportions.
Compare two or more groups to identify differences or similarities, then summarize and contrast their data using tutoring vs no tutoring or male vs female earnings as examples.
Explore relationship questions that examine the connection between two variables—such as exercise and health, education and income, or study hours and exam performance—in population data.
Investigate causal questions to determine whether one variable directly causes another, using experimental studies. Examples include water and skin hydration, exercise and weight loss, and smoking and lung cancer.
Explore how descriptive questions describe the current state and how predictive questions forecast outcomes using past data, such as election results, store visits, weather, and goals.
Identify two data types, quantitative and categorical, and see how data as a variable captures population variability; statistics helps understand and analyze differences across individuals.
Explore how categorical data group responses into categories like eye color or political affiliation, and learn to summarize distributions and distinguish nominal and ordinal types.
Explore nominal categorical data where categories are names or labels with no natural order, illustrated by political parties and gender, and represented as factors.
Explore ordinal categorical data with ordered categories where the level rises or falls, illustrated by socioeconomic status, education level, cancer stages, and Likert scales, represented as ordered factors in R.
Identify the dichotomous variable as a subtype of nominal categorical variable with two categories, such as yes/no, agree/disagree, disease/no disease, win/lose, and pass/fail.
Identify quantitative data and its numeric examples, then distinguish discrete from continuous data, with a preview that the next lecture covers discrete quantitative data.
Explore discrete quantitative data by examining whole-number outcomes, such as the ideal number of kids and integer counts in R; age may be discrete or continuous, depending on precision.
Understand continuous data—from height and weight to travel time and price—recorded in multiple units and numerics in R, highlighting why to classify variables.
Classify data to guide graphs and summaries: categorical data use bar and pie charts with percentages and the modal category; quantitative data use mean, median, mode, range, and standard deviation.
Learn how descriptive and inferential statistics address questions about populations, decide when to collect data from the entire population or from a representative sample, and preview descriptive statistics.
Explain current data with descriptive statistics, covering descriptive, comparison, relationship, and causal questions, then use inferential statistics to generalize findings to the population.
Explore the General Social Survey data since 1972, navigate categories and topics like gender issues, abortion, suicide, and working mothers, and examine how descriptive statistics appear in GSS surveys.
Learn descriptive statistics with the GSS 1985 survey, summarizing a 1472-person sample via proportions and a bar chart, showing that 62.5% disagree that a wife should prioritize her husband's career.
Explain how descriptive statistics fully describe data for the population, contrasting with inferential statistics used when only a sample is available, illustrated by census age groups and a population pyramid.
Summarize data with descriptive statistics, then apply inferential statistics to predict the population from a sample. Use a 95% confidence level and a 3% margin of error.
Learn the distribution of a variable and its frequency table, summarizing how data spread for categorical (nominal, ordinal) and quantitative (discrete, continuous) data.
Examine how a categorical variable, nominal or ordinal, distributes across categories by counting observed values, and summarize with a frequency table using the race variable.
Create a frequency table for a categorical variable by listing all categories, counting each category’s frequency, and computing proportions and percentages as relative frequencies of the total observations.
Understand relative frequency by treating the total as 100% and dividing it among categories, where proportions and percentages describe observations such as 80.9% white, 13.9% black, and 5.1% other.
Explore how the distribution of a quantitative variable is analyzed by defining range, choosing discrete or continuous methods, and counting observations in intervals or via frequency tables and graphs.
Learn to build frequency tables for discrete quantitative variables by listing all values and counting observations when the range is under 30, and use intervals for larger ranges.
Build a frequency table for the discrete quantitative variable hours per day watching TV, listing outcomes 0 to 24 with observed counts from the General Social Survey.
Build a frequency table for a discrete quantitative variable—the ideal number of kids—with a small outcome range from 0 to 7, including a seven or more category.
Learn to build a frequency table for discrete data by dividing a large range into non-overlapping intervals and counting observations using a starting-point convention (0–10, 10–20, etc.).
Investigate how a continuous quantitative variable can take any value within a range, divide the range into non-overlapping intervals, and tally counts in a frequency table.
Explore how age serves as a continuous variable in census data, construct a 21-interval, five-year age table, and interpret sex-based distributions in an age pyramid with Excel considerations.
Calculate proportions and percentages in Excel by computing male and female shares within each age group, then build a UK age-frequency table using dollar signs to fix the total.
Create a frequency table for a discrete variable in excel by listing hours per day to relax, 0–24, and computing frequencies, proportions, and percentages; plan a table for categorical variable.
Create a frequency table for a categorical variable in Excel, listing each category with its frequency, proportion, and percentage from a GSS survey, and explore its creation in R programming.
Analyze the Titanic dataset in R to build a frequency table, using an Excel file of passengers and crew with survival status and class.
Load the Titanic data set from an Excel file into R by locating the file with the here package, saving the path, and reading it with read_xls.
Explore the Titanic dataset in R by examining variables like passenger id, gender, age, hometown, boarded port, survived, class, and crew to understand its structure.
Create a gender frequency table for a categorical variable in R from Titanic data using group_by and summarize to count observations, then rename the frequency column for future proportion calculations.
Compute proportions and percentages for each gender category in the Titanic frequency table by using mutate to add proportion and percentage columns and save the result.
Learn how to use the pipe operator in R to chain data wrangling steps—group by, summarize, and mutate—to build a frequency table and compute proportions, exemplified on the Titanic dataset.
Explore constructing a frequency table for a discrete quantitative variable. Understand that discrete variables take whole numbers, with examples like number of kids or number of deaths, not fractions.
Explore the ideal number of kids as a discrete variable using General Social Survey data, and learn to recreate the data and generate a frequency table with R.
Recreate the GSS survey data in Excel by entering the ideal number of kids, then build a frequency table with R to count occurrences regardless of sequence.
Load the ideal number of kids dataset in R using the same approach as the Titanic data, then create a frequency table for the discrete range 0–7 with 3837 observations.
Group by number of kids, count groups with summarize, then compute proportion and percentage with mutate, rounding to one decimal. The result: 56% two kids, 25% three, 12% four.
Load the Titanic data from an Excel file into a data frame, then create a frequency table for the continuous age variable by dividing the range into equal intervals.
Determine the range of ages to build a frequency table. Exclude missing values with na.rm and split the range into five-year intervals to group Titanic passengers.
Create a new age group column beside age in the Titanic data frame using mutate, then convert ages to interval categories with cut and 0–75 breaks.
Explore left-closed, right-open intervals in R with the cut function and setting the right endpoint to open, then replace ages with age-group labels to prepare a frequency table.
Create a frequency table for a continuous variable by grouping the Titanic data frame by age group, counting occurrences with n, and computing proportion and percentage.
Filter out missing age groups, then group by age categories to build a frequency table for continuous data with missing values, showing Titanic distribution: 0–5, 15–50, 70–75.
Visualize distributions with graphs by using pie charts and bar graphs for nominal and ordinal categories, and histograms for discrete and continuous data, with a note on bar graph lecture.
Visualize one-variable data with bar graphs, where each category has a vertical bar and the height shows its percentage. Learn to make bar graphs in R in the next lecture.
Learn how a pie chart visualizes data as circular slices with sizes proportional to each category's proportion, preparing you to create one in R in the next lecture.
Learn to transform the Titanic gender bar chart into a pie chart in R using coord_polar and theta = y, with rounded percentage labels inside slices.
Visualize the distribution of a discrete variable with a histogram, where each distinct value forms a vertical bar and height equals its frequency or percentage; future lessons cover coding.
Create a histogram for a discrete variable in R using a frequency table and ggplot, mapping x to number of kids and y to percentage, with custom axis scales.
Identify the range of a continuous variable, divide it into intervals, count observations per interval to build a frequency table, and draw bars to form a histogram.
Learn to create a histogram for the continuous age variable using ggplot's geom_histogram, adjust bin width, add borders, and refine the x-axis breaks and boundaries.
Construct a left-closed, right-open histogram for a continuous variable using intervals like 0-5, 5-10, and 10-15, placing values into the correct range and interpreting interval ends.
Learn to handle missing and non-finite values in a continuous variable when building a histogram in R. Filter out na values using is.na, then pipe into ggplot to plot.
Adjust the interval length and bin width to shape a histogram of a continuous variable, moving from few tall bars to many short bars and examining the distribution's shape.
Explore how to read distributions using pie charts, bar charts, and histograms. Identify the modal category and examine shapes: unimodal, bimodal, and uniform, to understand how values spread.
Identify unimodal distributions as having a single peak and classify them as symmetric or skewed. Differentiate skewed distributions into left and right skew and note next lecture covers symmetric distributions.
Explore symmetric, or normal, distributions centered at a point with mirror-image halves and a bell-shaped curve, where data cluster near the center for variables like weight, height, temperature, and IQ.
Explore the symmetric distribution of male height, with 69.3 inches as the center. Understand how average height, variability, and tails describe the distribution and preview generating artificial height data.
Generate a hypothetical normal distribution of male heights in R. Create 1 million observations with mean 69.3 in and sd 2.8 in, illustrating mean and three-sigma range.
Plot a histogram of the height data with ggplot in R, adjusting bin width and x axis breaks to reveal a symmetric distribution; the next lecture covers skewed distributions.
Explore skewed distributions, where a center is pulled toward an extreme value and one tail is longer than the other. Identify right-skewed and left-skewed cases and which extreme is farther.
Analyze a left-skewed distribution of product ratings, where most observations cluster at 4-5 stars with a center near 4.6, and prepare the data in Excel for an R histogram.
Show how to create a left-skewed histogram of product ratings in R with ggplot2, reading data from Excel and using a 0–5 axis. The next lecture explores right-skewed distributions.
Explore a right-skewed distribution of relaxation hours (0–24) via a bar chart, centered around three hours with a tail toward 24, and recreate the data in Excel with GSS file.
Load packages, import data, and create a right-skewed distribution histogram in R. Apply colors with the fill aesthetic, convert the relaxed variable to a factor, and run the code.
Explore bimodal distributions, where two populations create two peaks, such as female and male height data, each with its own center and spread, leading to a merged histogram.
Demonstrate how to build a bimodal histogram by combining male and female height samples in R, showing two peaks aligned with each population’s distribution.
Explore how a bimodal distribution arises when a population splits on a controversial issue, using a product rating example with five-star and one-star scores and an Excel histogram dataset.
Visualize bimodal product rating data using a histogram to reveal two peaks at one and five stars, and contrast unimodal and bimodal distributions while previewing uniform distribution.
Explore the uniform distribution where all outcomes are equally likely, illustrated by coin tosses and six-sided dice, and learn how to generate data by simulation in code.
Simulate a six-sided die in R by generating 100,000 samples from 1 to 6 with replacement, using ggplot2 to create a histogram and illustrate a uniform distribution.
Construct a histogram of a uniform distribution by plotting a data frame with ggplot, using bin width 1 and x-axis breaks 0–6; 100,000 die rolls show near-equal counts for 1–6.
Summarize quantitative data by examining the center and spread, focusing on the symmetric, normal distribution. Apply mean, median, and mode for the center and standard deviation for spread.
Identify the mode as the most frequent value in a distribution, useful for discrete variables with few possible values, while noting that for continuous data multiple modes exist or none.
Explore creating a symmetric product rating distribution, compute its mode with R and the Description tools package, and visualize it with a ggplot histogram showing a mode at three.
Identify the mode in a left skewed distribution of product ratings and learn to visualize it by drawing a mode line on the histogram using the Description Tools package.
Identify the mode in a right-skewed discrete distribution of relaxing hours by loading data, computing the mode, and adding a mode line to the histogram.
Explore the mode in a uniform discrete distribution with a die and learn to compute and plot it in R, noting the mode is not informative when outcomes are even.
Learn to identify the mode in categorical data, using a mode function to find the most common category, as demonstrated with a gender variable from Titanic data.
Explore how the mean serves as the most popular center measure, balancing deviations in a data set, and how to compute it by summing values and dividing by n.
Calculate the mean of this small height data set in Excel, compute each height's difference from the mean, and observe that the sum of differences balances to zero.
See how outliers pull the mean in a data set, shifting it from 64 to 64.7 inches and from 64 to 58.6 inches after a mistyped observation.
Load the female height data from Excel, then summarize it with deployer in R to compute the population mean. Outputs 64 inches as the population mean for 1 million females.
Select a random sample of size 300 without replacement, load Excel data, compute the sample mean with summarize in R, and compare to the population mean.
Explore how to compute a sample mean in R and obtain reproducible samples with set.seed, observe how different samples yield different means, and preview the upcoming median topic.
Sort data in ascending order and select the middle value to find the median for odd data. Average the two middle values for even data, and verify with Excel's median.
Demonstrate how extreme values do not affect the median, illustrating its resistance to outliers, and introduce the formula for calculating the median.
Compute the population median in R by importing the full height data from Excel, summarizing the data frame, and applying the median function to the height column (63.99).
Load the population data in r, set the seed, sample from the population, and compute the median of the height column to compare with the mean, noting symmetry.
Compare the mean and the median in symmetric distributions with no outliers to show they lie at the center and are equal.
Explore mean and median in a symmetric distribution using R: build a histogram with a density curve, add mean and median vertical lines, and confirm they are equal.
Explore mean and median in a right-skewed distribution using R. Build a density curve with ggplot, then compare mean and median lines, noting the mean's pull toward skew.
Load the product rating data from Excel into R, plot a density curve with mean and median lines for a left-skewed distribution, and compare mean versus median.
Welcome to our comprehensive course on statistical analysis! This course is designed to equip you with the essential skills and knowledge needed to excel in statistical analysis, whether you're a beginner or seeking to enhance your expertise.
Through a series of engaging modules, we'll guide you through the fundamentals of statistics using the powerful R programming language. From understanding the basics of R programming to exploring descriptive and inferential statistics, data types, visualization techniques, and more, this course covers a wide range of topics essential for effective statistical analysis in various fields.
Each module is carefully crafted with practical examples and explanations, ensuring you grasp each concept thoroughly. By the end of the course, you'll have the confidence and skills to apply statistical analysis techniques in real-world scenarios, making better-informed decisions and driving impactful outcomes.
**Key concepts taught in the course are:**
1. R Programming
2. Subjects in the Population
3. Statistical Questions
4. Types of Data
5. Descriptive and Inferential Statistics
6. Distribution of a Variable and Frequency Table
7. Visualizing Distribution with Graphs
8. Shape of Distribution
9. Center of Quantitative Data
10. Measuring Variability of Quantitative Data
11. Empirical Rule
12. Percentiles and Quartiles
13. Relationship Between Variables
Congratulations on taking the first step towards mastering statistical analysis! Dive in and let's embark on this exciting journey together.