Sampling in R
Master sampling to get more accurate statistics with less data.
Start Course for Free4 hours15 videos51 exercises18,045 learnersStatement of Accomplishment
Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.Training 2 or more people?
Try DataCamp for BusinessLoved by learners at thousands of companies
Course Description
Sampling is a cornerstone of inference statistics and hypothesis testing. It's tremendously important in survey analysis and experimental design. This course explains when and why sampling is important, teaches you how to perform common types of sampling, from simple random sampling to more complex methods like stratified and cluster sampling. Later, the course covers estimating population statistics, and quantifying uncertainty in your estimates by generating sampling distributions and bootstrap distributions. Throughout the course, you'll explore real-world datasets on coffee ratings, Spotify songs, and employee attrition.
Training 2 or more people?
Get your team access to the full DataCamp platform, including all the features.In the following Tracks
Statistician in R
Go To Track- 1
Introduction to Sampling
FreeLearn what sampling is and why it is useful, understand the problems caused by convenience sampling, and learn about the differences between true randomness and pseudo-randomness.
Sampling and point estimates50 xpReasons for sampling50 xpSimple sampling with dplyr100 xpSimple sampling with base-R100 xpConvenience sampling50 xpAre findings from the sample generalizable?100 xpAre these findings generalizable?100 xpPseudo-random number generation50 xpGenerating random numbers100 xpUnderstanding random seeds100 xp - 2
Sampling Methods
Learn how to and when to perform the four methods of random sampling: simple, systematic, stratified, and cluster.
Simple random and systematic sampling50 xpSimple random sampling100 xpSystematic sampling100 xpIs systematic sampling OK?100 xpStratified and weighted random sampling50 xpWhich sampling method?100 xpProportional stratified sampling100 xpEqual counts stratified sampling100 xpWeighted sampling100 xpCluster sampling50 xpBenefits of clustering50 xpPerforming cluster sampling100 xpComparing sampling methods50 xp3 kinds of sampling100 xpSummary statistics on different kinds of sample100 xp - 3
Sampling Distributions
Learn how to quantify the accuracy of sample statistics using relative errors, and measure variation in your estimates by generating sampling distributions.
Relative error of point estimates50 xpCalculating relative errors100 xpRelative error vs. sample size50 xpCreating a sampling distribution50 xpReplicating samples100 xpReplication parameters50 xpApproximate sampling distributions50 xpExact sampling distribution100 xpApproximate sampling distribution100 xpExact vs. approximate50 xpStandard errors and the Central Limit Theorem50 xpPopulation & sampling distribution means100 xpPopulation and sampling distribution variation100 xp - 4
Bootstrap Distributions
Learn how to use resampling to perform bootstrapping, used to estimate variation in an unknown population. Understand the difference between sampling distributions and bootstrap distributions.
Introduction to bootstrapping50 xpPrinciples of bootstrapping100 xpWith or without replacement100 xpGenerating a bootstrap distribution100 xpComparing sampling and bootstrap distributions50 xpBootstrap statistics and population statistics50 xpSampling distribution vs. bootstrap distribution100 xpCompare sampling and bootstrap means100 xpCompare sampling and bootstrap standard deviations100 xpConfidence intervals50 xpConfidence interval interpretation50 xpCalculating confidence intervals100 xpCongratulations!50 xp
Training 2 or more people?
Get your team access to the full DataCamp platform, including all the features.In the following Tracks
Statistician in R
Go To TrackIn other tracks
Statistics Fundamentals in Rcollaborators
prerequisites
Introduction to Statistics in RRichie Cotton
See MoreData Evangelist at DataCamp
Richie is a Data Evangelist at DataCamp. He has been using R since 2004, in the fields of proteomics, debt collection, and chemical health and safety. He has released almost 30 R packages on CRAN and Bioconductor – most famously the assertive suite of packages – as well as creating and contributing to many others. He also has written two books on R programming, Learning R and Testing R Code.
Join over 15 million learners and start Sampling in R today!
Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.