Package: PracTools 1.5

Richard Valliant

PracTools: Designing and Weighting Survey Samples

Functions and datasets to support Valliant, Dever, and Kreuter (2018), <doi:10.1007/978-3-319-93632-1>, "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 and sample sizes in two-phase designs. A number of example data sets are included.

Authors:Richard Valliant [aut, cre], Jill A. Dever [ctb], Frauke Kreuter [ctb], George Zipf [aut]

PracTools_1.5.tar.gz
PracTools_1.5.tar.gz(r-4.5-noble)PracTools_1.5.tar.gz(r-4.4-noble)
PracTools_1.5.tgz(r-4.4-emscripten)PracTools_1.5.tgz(r-4.3-emscripten)
PracTools.pdf |PracTools.html
PracTools/json (API)
NEWS

# Install 'PracTools' in R:
install.packages('PracTools', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Datasets:
  • Domainy1y2 - Domain data
  • MDarea.popA - Maryland area population
  • TPV - TPV Data
  • Test_Data_US - Accounting data for some US cities with latitude and longitude of the city centroids
  • ThirdGrade - Third grade population
  • hospital - Hospital Data
  • labor - Labor force population
  • mibrfss - Michigan Behavioral Risk Factor Surveillance Survey
  • nhis - National Health Interview Survey: Demographic variables
  • nhis.large - National Health Interview Survey: Demographic and health variables
  • nhispart - National Health Interview Survey data from 2003: socioeconomic variables
  • smho.N874 - Survey of Mental Health Organizations Data
  • smho98 - Survey of Mental Health Organizations Data

This package does not link to any Github/Gitlab/R-forge repository. No issue tracker or development information is available.

4.13 score 1 stars 90 scripts 802 downloads 47 exports 46 dependencies

Last updated 5 months agofrom:226f02a50d. Checks:OK: 2. Indexed: yes.

TargetResultDate
Doc / VignettesOKNov 22 2024
R-4.5-linuxOKNov 22 2024

Exports:BW2stagePPSBW2stagePPSeBW2stageSRSBW3stagePPSBW3stagePPSeclusOpt2clusOpt2fixedPSUclusOpt3clusOpt3fixedPSUCompMOSCVcalc2CVcalc3deffdeffCRdeffHdeffKdeffSdubgamEstgammaFitGeoDistMOSGeoDistPSUGeoMinMOSHMTnAuditAttrnAuditMUSnContnContMoenContOptnDep2samnDomainnEdgenEdgeSRSnLogOddsnPPSnPropnProp2samnPropMoeNRadjClassNRFUoptnWilsonpclassquad_rootsstrAllocunitVarwtd.momentswtdvar

Dependencies:classclassIntclicolorspaceDBIdplyre1071fansifarvergenericsgeosphereggplot2gluegtableisobandKernSmoothlabelinglatticelifecyclemagrittrMASSMatrixmgcvmunsellnlmepillarpkgconfigproxyR6RColorBrewerRcpprlangs2scalessfsptibbletidyselectunitsusmapusmapdatautf8vctrsviridisLitewithrwk

Creating Geography-Based PSUs with as Similarly-Sized MOS as Possible

Rendered fromDistance-and-MOS-PSUs.Rmdusingknitr::rmarkdownon Nov 22 2024.

Last update: 2023-11-09
Started: 2023-03-19

Design Effects and Effective Sample Size

Rendered fromDesign-effects.Rmdusingknitr::rmarkdownon Nov 22 2024.

Last update: 2023-11-09
Started: 2023-11-09

Sample Size Calculation in Single-stage Sampling

Rendered fromSinglestage-samsize.Rmdusingknitr::rmarkdownon Nov 22 2024.

Last update: 2023-11-09
Started: 2020-08-03

Selection of Appropriate PracTools Sample Size Function

Rendered fromSelect-samsize-fcns.Rmdusingknitr::rmarkdownon Nov 22 2024.

Last update: 2023-11-09
Started: 2023-05-23

Variance Component Estimation in Multistage Sampling

Rendered fromVarcomps-multistage.Rmdusingknitr::rmarkdownon Nov 22 2024.

Last update: 2023-12-06
Started: 2020-08-03

Readme and manuals

Help Manual

Help pageTopics
Relvariance components for 2-stage sampleBW2stagePPS
Estimated relvariance components for 2-stage sampleBW2stagePPSe
Relvariance components for 2-stage sampleBW2stageSRS
Relvariance components for 3-stage sampleBW3stagePPS
Estimated relvariance components for 3-stage sampleBW3stagePPSe
Compute optimal sample sizes for a two-stage sampleclusOpt2
Optimal number of sample elements per PSU in a two-stage sample when the sample of PSUs is fixedclusOpt2fixedPSU
Compute optimal sample sizes for a three-stage sampleclusOpt3
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 sampleclusOpt3fixedPSU
Compute a composite measure of size for domain-based two-stage samplingCompMOS
Coefficient of variation of an estimated total in a 2-stage sampleCVcalc2
Coefficient of variation of an estimated total in a 3-stage sampleCVcalc3
Design effects of various typesdeff
Chen-Rust design effectdeffCR
Henry design effect for _pps_ sampling and GREG estimation of totalsdeffH
Kish design effectdeffK
Spencer design effect for an estimated total from a _pps_ sampledeffS
Domain dataDomainy1y2
Sample sizes for a double sampling designdub
Estimate variance model parameter gammagamEst
Iteratively estimate variance model parameter gammagammaFit
Split geographic PSUs based on a measure of size thresholdGeoDistMOS
Form PSUs based on geographic distancesGeoDistPSU
Check geographic PSUs to determine whether any are less than minimum measure of size thresholdGeoMinMOS
Generate an HMT populationHMT
Hospital Datahospital
Labor force populationlabor
Maryland area populationMDarea.popA
Michigan Behavioral Risk Factor Surveillance Surveymibrfss
Sample sizes for an attribute sample in an auditnAuditAttr
Sample sizes for a Monetary Unit Sample in an auditnAuditMUS
Compute a simple random sample size for an estimated meannCont
Compute a simple random sample size for an estimated mean of a continuous variable based on margin of errornContMoe
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 samplingnContOpt
Simple random sample size for difference in meansnDep2sam
Compute a simple random sample size for an estimated mean or total for a domainnDomain
Compute the total sample size for a stratified, simple random sample based on an Edgeworth approximationnEdge
Compute the total sample size for a simple random sample based on an Edgeworth approximationnEdgeSRS
National Health Interview Survey: Demographic variablesnhis
National Health Interview Survey: Demographic and health variablesnhis.large
National Health Interview Survey data from 2003: socioeconomic variablesnhispart
Calculate simple random sample size for estimating a proportionnLogOdds
Calculate the sample size for a probability proportional to size (PPS) samplenPPS
Compute simple random sample size for estimating a proportionnProp
Simple random sample size for difference in proportionsnProp2sam
Simple random sample size for a proportion based on margin of errornPropMoe
Class-based nonresponse adjustmentsNRadjClass
Sample sizes for a nonresponse follow-up studyNRFUopt
Calculate a simple random sample size for estimating a proportionnWilson
Form nonresponse adjustment classes based on propensity scorespclass
Compute the roots of a quadratic equationquad_roots
Survey of Mental Health Organizations Datasmho.N874
Survey of Mental Health Organizations Datasmho98
Allocate a sample to stratastrAlloc
Accounting data for some US cities with latitude and longitude of the city centroidsTest_Data_US
Third grade populationThirdGrade
TPV DataTPV
Compute the unit (population) variance for a variableunitVar
Compute moments of a variable from either a population or samplewtd.moments
Compute weighted variancewtdvar