Elements of a sampling design

Analyzing Survey Data in R

Kelly McConville

Assistant Professor of Statistics

Simple random sampling

Map of Pennsylvania

Analyzing Survey Data in R

Simple random sampling

Map of Pennsylvania with dots representing sampled residents

library(survey)
srs_design <- svydesign(data = paSample,
                        weights = ~wts,
                        fpc = ~N, id = ~1)
Analyzing Survey Data in R

Simple random sampling

Map of Pennsylvania with dots representing sampled residents and both Pittburgh and Philadelphia highlighted

Analyzing Survey Data in R

Simple random sampling

Map of Pennsylvania with dots representing sampled residents and both Pittburgh and Philadelphia highlighted.  Warren and McKean counties are colored green.

Analyzing Survey Data in R

Stratified sampling

Map of Pennsylvania with each county a different color

Analyzing Survey Data in R

Stratified sampling

Map of Pennsylvania with each county a different color and dots representing sampled residents

library(survey)
stratified_design <- svydesign(data = paSample, id = ~1, weights = ~wts, 
                               strata = ~county, fpc = ~N)
Analyzing Survey Data in R

Cluster sampling

Map of Pennsylvania with each county a different color

Analyzing Survey Data in R

Cluster sampling

Map of Pennsylvania with the five sampled counties in black

Analyzing Survey Data in R

Cluster sampling

Map of Pennsylvania with the five sampled counties in black and dots representing sampled residents

library(survey)
cluster_design <- svydesign(data = paSample, id = ~county + personid, 
                            fpc = ~N1 + N2, weights = ~wts)
Analyzing Survey Data in R

Let's practice!

Analyzing Survey Data in R

Preparing Video For Download...