Free Access Week - Data Engineering + BI
Data Engineering and BI courses are free this week!
Free Access Week - Jun 2-8

PracTools (version 1.6.1)

Designing and Weighting Survey Samples

Description

Functions and datasets to support Valliant, Dever, and Kreuter (2018), , "Practical Tools for Designing and Weighting Survey Samples". Contains functions for sample size calculation for survey samples using stratified or clustered one-, two-, and three-stage sample designs, and single-stage audit sample designs. Functions are included that will group geographic units accounting for distances apart and measures of size. Other functions compute variance components for multistage designs, sample sizes in two-phase designs, and a stopping rule for ending data collection. A number of example data sets are included.

Copy Link

Version

Install

install.packages('PracTools')

Monthly Downloads

800

Version

1.6.1

License

GPL-3

Maintainer

Richard Valliant

Last Published

May 11th, 2025

Functions in PracTools (1.6.1)

HMT

Generate an HMT population
GeoDistPSU

Form PSUs based on geographic distances
SampStop

Stopping rule for surveys
GeoMinMOS

Check geographic PSUs to determine whether any are less than minimum measure of size threshold
TPV

TPV Data
NRFUopt

Sample sizes for a nonresponse follow-up study
Test_Data_US

Accounting data for some US cities with latitude and longitude of the city centroids
ThirdGrade

Third grade population
NRadjClass

Class-based nonresponse adjustments
MDarea.popA

Maryland area population
deffH

Henry design effect for pps sampling and GREG estimation of totals
deff

Design effects of various types
clusOpt2

Compute optimal sample sizes for a two-stage sample
dub

Sample sizes for a double sampling design
deffCR

Chen-Rust design effect
nContOpt

Compute the sample size required to estimate the mean of a continuous variable by optimizing the numbers of take-alls and non-take-all units selected by probability sampling
deffS

Spencer design effect for an estimated total from a pps sample
clusOpt3

Compute optimal sample sizes for a three-stage sample
clusOpt3fixedPSU

Compute optimal number of sample secondary sampling units (SSUs) and elements per SSU for a fixed set of primary sampling units (PSUs) in a three-stage sample
clusOpt2fixedPSU

Optimal number of sample elements per PSU in a two-stage sample when the sample of PSUs is fixed
deffK

Kish design effect
nContMoe

Compute a simple random sample size for an estimated mean of a continuous variable based on margin of error
nCont

Compute a simple random sample size for an estimated mean
nAuditMUS

Sample sizes for a Monetary Unit Sample in an audit
gamEst

Estimate variance model parameter γ
labor

Labor force population
hospital

Hospital Data
mibrfss

Michigan Behavioral Risk Factor Surveillance Survey
nAuditAttr

Sample sizes for an attribute sample in an audit
nEdgeSRS

Compute the total sample size for a simple random sample based on an Edgeworth approximation
gammaFit

Iteratively estimate variance model parameter γ
nLogOdds

Calculate simple random sample size for estimating a proportion
nPropMoe

Simple random sample size for a proportion based on margin of error
nEdge

Compute the total sample size for a stratified, simple random sample based on an Edgeworth approximation
nDep2sam

Simple random sample size for difference in means
nDomain

Compute a simple random sample size for an estimated mean or total for a domain
nWilson

Calculate a simple random sample size for estimating a proportion
nPPS

Calculate the sample size for a probability proportional to size (PPS) sample
nProp2sam

Simple random sample size for difference in proportions
nhispart

National Health Interview Survey data from 2003: socioeconomic variables
pclass

Form nonresponse adjustment classes based on propensity scores
quad_roots

Compute the roots of a quadratic equation
smho.N874

Survey of Mental Health Organizations Data
smho98

Survey of Mental Health Organizations Data
wtdvar

Compute weighted variance
strAlloc

Allocate a sample to strata
nProp

Compute simple random sample size for estimating a proportion
unitVar

Compute the unit (population) variance for a variable
nhis

National Health Interview Survey: Demographic variables
nhis.large

National Health Interview Survey: Demographic and health variables
wtd.moments

Compute moments of a variable from either a population or sample
BW3stagePPS

Relvariance components for 3-stage sample
Domainy1y2

Domain data
CompMOS

Compute a composite measure of size for domain-based two-stage sampling
CVcalc3

Coefficient of variation of an estimated total in a 3-stage sample
BW3stagePPSe

Estimated relvariance components for 3-stage sample
GeoDistMOS

Split geographic PSUs based on a measure of size threshold
BW2stagePPSe

Estimated relvariance components for 2-stage sample
BW2stagePPS

Relvariance components for 2-stage sample
CVcalc2

Coefficient of variation of an estimated total in a 2-stage sample
BW2stageSRS

Relvariance components for 2-stage sample