Learn R Programming

⚠️There's a newer version (1.6) of this package.Take me there.

PracTools (version 1.4.1)

Tools for Designing and Weighting Survey Samples

Description

Functions and datasets to support Valliant, Dever, and Kreuter, Practical Tools for Designing and Weighting Survey Samples (2nd edition, 2018). 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 and sample sizes in two-phase designs. A number of example data sets are included.

Copy Link

Version

Install

install.packages('PracTools')

Monthly Downloads

722

Version

1.4.1

License

GPL-3

Maintainer

Richard Valliant

Last Published

November 9th, 2023

Functions in PracTools (1.4.1)

GeoDistMOS

Split geographic PSUs based on a measure of size threshold
BW3stagePPSe

Estimated relvariance components for 3-stage sample
ThirdGrade

Third grade population
CVcalc2

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

Relvariance components for 2-stage sample
BW3stagePPS

Relvariance components for 3-stage sample
BW2stagePPS

Relvariance components for 2-stage sample
clusOpt2

Compute optimal sample sizes for a two-stage sample
GeoDistPSU

Form PSUs based on geographic distances
HMT

Generate an HMT population
BW2stagePPSe

Estimated relvariance components for 2-stage sample
TPV

TPV Data
deffCR

Chen-Rust design effect
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
GeoMinMOS

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

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

Design effects of various types
MDarea.pop

Maryland area population
nAuditAttr

Sample sizes for an attribute sample in an audit
nAuditMUS

Sample sizes for a Monetary Unit Sample in an audit
deffH

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

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

Labor force population
nWilson

Calculate a simple random sample size for estimating a proportion
deffK

Kish design effect
dub

Sample sizes for a double sampling design
mibrfss

Michigan Behavioral Risk Factor Surveillance Survey
deffS

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

Sample sizes for a nonresponse follow-up study
nCont

Compute a simple random sample size for an estimated mean
gamEst

Estimate variance model parameter \(\gamma\)
NRadjClass

Class-based nonresponse adjustments
nhispart

National Health Interview Survey data from 2003: socioeconomic variables
pclass

Form nonresponse adjustment classes based on propensity scores
nProp

Compute simple random sample size for estimating a proportion
clusOpt2fixedPSU

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

Compute a simple random sample size for an estimated mean of a continuous variable based on margin of error
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
nProp2sam

Simple random sample size for difference in proportions
clusOpt3

Compute optimal sample sizes for a three-stage sample
smho98

Survey of Mental Health Organizations Data
smho.N874

Survey of Mental Health Organizations Data
nDep2sam

Simple random sample size for difference in means
strAlloc

Allocate a sample to strata
nhis

National Health Interview Survey: Demographic variables
nhis.large

National Health Interview Survey: Demographic and health variables
gammaFit

Iteratively estimate variance model parameter \(\gamma\)
wtdvar

Compute weighted variance
hospital

Hospital Data
nDomain

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

Calculate simple random sample size for estimating a proportion
Domainy1y2

Domain data
CVcalc3

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

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