Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Data Science Basics Getting Started with Data Science Selecting Data

Where is Systematic Sampling?

In the Selecting Data video of Data Science Basics Dr. Kat mentions four types of sampling (simple random, stratified, cluster, and systematic). She then illustrates the first three but not the fourth (systematic). I assume that our sampling will be systematic because we have created a system by which the sampling is to be done. The omission is however a mite odd.

3 Answers

Ryan Ruscett
Ryan Ruscett
23,308 Points


This is the best example I could find on this. Read it a while back and it was helpful.

Let me give you a brief discussion on the systematic sampling to help you understand the code. The idea in systematic sampling is that, given the population units numbered from 1 to N, we compute for the sampling interval, given by k=Nn, where n is the number of units needed for the sample. After that, we choose for the random start, number between 1 and k. This random start will be the first sample, and then the second unit in the sample is obtained by adding the sampling interval to the random start, and so on. There are two types of systematic sampling namely, Linear and Circular Systematic Samplings. Circular systematic sampling treats the population units numbered from 1 to N in circular form, so that if the increment step is more than the number of N units, say N+2, the sample unit is the 2nd element in the population, and so on. The code that I will be sharing can be used both for linear and circular, but for this particular problem only. Since there are rules in linear that are not satisfied in the function, one of which is if k is not a whole number, despite that, however, you can always extend it to a more general function.


Thank you, I'm hoping that this will get incorporated into the course because it is odd to mention a type of sampling and then neglect to explain it.