Sampling in Statistics

Rina Mondal
4 min readMay 15, 2024

--

Photo by Testalize.me on Unsplash

Sampling is a process of selecting a subset of participants from a larger group. The larger group is known as population and the subset is called sample. A sample that is perfectly representative of the population allows you to generalize your findings to the population.

Why is Sampling Important?

1. Efficiency: It saves time and resources by analyzing a smaller, manageable subset.
2. Cost-Effectiveness: Reduces the cost of data collection and analysis.
3. Feasibility: Makes it possible to study large populations or areas.
4. Accuracy: When done correctly, it provides reliable and valid results.

Sampling is of two types:

  1. Probability Sampling 2. Non-Probability Sampling

1. Probability Sampling:

Selecting participants on a statistically random basis. Probability sampling ensures that every member of the population has a known and equal chance of being selected. This type of sampling is essential for producing statistically valid and generalizable results.

Some probability sampling techniques are:

Simple Random Sampling: Selecting participants in a completely random fashion, where each participant has an equal chance of being selected. Often done using random number generators.

#simple random sampling

import random

# Suppose you have a population of data
population = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

random_sample = random.sample(population, 2)

print("Simple Random Sample:", random_sample)

Systematic Sampling: Selects every nth member from a list after a random start.

# Suppose you have a population of data
population = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

# Define the sampling interval
k = 2

# Choose a random start index
start_index = random.randint(0, k - 1)

# Perform systematic sampling
systematic_sample = population[start_index::k]

print("Systematic Sample:", systematic_sample)

Stratified Sampling: Selecting participants randomly, but from within certain predefined subgroups (strata) that share a common trait. We can say, divides the population into strata (groups) first and samples from each group proportionally. Stratified random sampling gives you more control over the impact of large subgroups within the population.

from sklearn.model_selection import train_test_split

# Suppose you have a dataset with features X and labels y
X = [[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]] # Features
y = [0, 0, 1, 1, 1] # Labels

# Perform stratified sampling to split data into training and testing sets
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, stratify=y)

print("Stratified Sampling - Train Set:", X_train, y_train)
print("Stratified Sampling - Test Set:", X_test, y_test)

Cluster Sampling: Sampling from naturally occurring, mutually exclusive clusters within a population. Divides the population into clusters, randomly selects some clusters, and then samples all or some members from those clusters.

import random

# Suppose you have a dataset with individuals grouped into clusters
clusters = {
'Cluster 1': [1, 2, 3],
'Cluster 2': [4, 5, 6],
'Cluster 3': [7, 8, 9],
'Cluster 4': [10, 11, 12]
}

# Choose a random subset of clusters
sampled_clusters = random.sample(list(clusters.keys()), 3)

# Extract individuals from sampled clusters
cluster_sample = []
for cluster in sampled_clusters:
cluster_sample.extend(clusters[cluster])

print("Cluster Sample:", cluster_sample)

Cluster Sampling is a more economical approach. However, if the population is heterogeneous, Stratified sampling will work best and if the population is homogeneous, Cluster sampling is best to pick up.

2. Non-Probability Sampling:

Participant selection is not made on a statistically random basis. It is less reliable for generalizing to the entire population but useful for exploratory research.
Convenience Sampling: Selecting individuals who are easiest to reach. It may create bias.

# Suppose you have a list of individuals
population = ['Alice', 'Bob', 'Charlie', 'David', 'Eve', 'Frank', 'Grace', 'Helen', 'Ivy', 'Jack']

# Perform convenience sampling by selecting individuals who are readily available
convenience_sample = ['Alice', 'Bob', 'David', 'Eve']

print("Convenience Sample:", convenience_sample)

Purposive Sampling: The researcher selects the participants using their own judgement, based on the purpose of the study.

# Suppose you have a dataset of students with their exam scores and study hours
students = [
{"name": "Alice", "exam_score": 85, "study_hours": 10},
{"name": "Bob", "exam_score": 70, "study_hours": 5},
{"name": "Charlie", "exam_score": 90, "study_hours": 12},
{"name": "David", "exam_score": 75, "study_hours": 7},
{"name": "Eve", "exam_score": 95, "study_hours": 15}
]

# Perform purposive sampling by selecting students with high exam scores (> 80)
purposive_sample = [student for student in students if student["exam_score"] > 80]

print("Purposive Sample:", purposive_sample)

Judgmental Sampling: The researcher uses their judgment to select participants.
Snowball Sampling: Existing study subjects recruit future subjects from among their acquaintances. It is useful in situations where it’s difficult to identify and access a particular population. Prone to research bias.
Voluntary Sampling: where individuals self-select to participate in a study or survey.

Applications of Sampling:

Market Research: Understanding consumer preferences and behavior.
Quality Control: Inspecting a subset of products to ensure quality standards.
Environmental Studies: Monitoring pollution levels in air, water, or soil.
Health and Medicine: Conducting clinical trials and epidemiological studies.
Social Sciences: Studying population characteristics and social behaviors.

Best Practices in Sampling

1. Define the Population: Clearly identify the population you are studying.
2. Choose the Right Sampling Method: Select a method that fits your research goals and resources.
3. Determine the Sample Size: Ensure it is large enough to be representative but manageable.
4. Implement Randomness: For probability sampling, use random selection methods to avoid bias.
5. Monitor and Adjust: During the sampling process, monitor for any issues and adjust as necessary.
6. Document the Process: Keep detailed records of how sampling was conducted to ensure transparency and reproducibility.

Challenges in Sampling

Bias: Ensuring the sample is truly representative can be challenging, especially in non-probability sampling.
Non-Response: Dealing with subjects who do not respond can affect the validity of the results.
Sampling Errors: These occur due to the variability in the sample selection and can be minimized but not eliminated entirely.

Sampling is a powerful tool that, when used correctly, can provide insights and data that are both reliable and actionable. By understanding the different methods, applications, and best practices, you can design and implement effective sampling strategies for your specific needs.

Always consider your research aims and research questions when you are deciding which sampling method to use.

--

--

Rina Mondal

I have an 8 years of experience and I always enjoyed writing articles. If you appreciate my hard work, please follow me, then only I can continue my passion.