Learn R Programming

survey (version 4.5)

Analysis of Complex Survey Samples

Description

Summary statistics, two-sample tests, rank tests, generalised linear models, cumulative link models, Cox models, loglinear models, and general maximum pseudolikelihood estimation for multistage stratified, cluster-sampled, unequally weighted survey samples. Variances by Taylor series linearisation or replicate weights. Post-stratification, calibration, and raking. Two-phase and multiphase subsampling designs. Graphics. PPS sampling without replacement. Small-area estimation. Dual-frame designs.

Copy Link

Version

Install

install.packages('survey')

Monthly Downloads

75,924

Version

4.5

License

GPL-2 | GPL-3

Maintainer

Thomas Lumley

Last Published

February 24th, 2026

Functions in survey (4.5)

confint.svyglm

Confidence intervals for regression parameters
fpc

Small survey example
hadamard

Hadamard matrices
crowd

Household crowding
election

US 2004 presidential election data at state or county level
calibrate

Calibration (GREG) estimators
dimnames.DBIsvydesign

Dimensions of survey designs
ftable.svystat

Lay out tables of survey statistics
compressWeights

Compress replicate weight matrix
estweights

Estimated weights for missing data
nhanes

Cholesterol data from a US survey
multiphase

Multiphase sampling designs
multiframe

Dual-frame and multi-frame surveys
nonresponse

Experimental: Construct non-response weights
make.calfun

Calibration metrics
mu284

Two-stage sample from MU284
hospital

Sample of obstetric hospitals
myco

Association between leprosy and BCG vaccination
marginpred

Standardised predictions (predictive margins) for regression models.
oldsvyquantile

Deprecated implementation of quantiles
psrsq

Pseudo-Rsquareds
poisson_sampling

Specify Poisson sampling design
reweight

Reweight (optimise) the weights on frames
phoneframes

Database of household expenses for two sampling frames
open.DBIsvydesign

Open and close DBI connections
regTermTest

Wald test for a term in a regression model
pchisqsum

Distribution of quadratic forms
rake

Raking of replicate weight design
paley

Paley-type Hadamard matrices
postStratify

Post-stratify a survey
surveyoptions

Options for the survey package
scd

Survival in cardiac arrest
svrepdesign

Specify survey design with replicate weights
salamander

Salamander mating data set from McCullagh and Nelder (1989)
stratsample

Take a stratified sample
svrVar

Compute variance from replicates
subset.survey.design

Subset of survey
surveysummary

Summary statistics for sample surveys
smoothArea

Small area estimation via basic area level model
smoothUnit

Smooth via basic unit level model
svycoxph

Survey-weighted Cox models.
svycralpha

Cronbach's alpha
svycontrast

Linear and nonlinearconstrasts of survey statistics
svyciprop

Confidence intervals for proportions
svy.varcoef

Sandwich variance estimator for glms
svyby

Survey statistics on subsets
svytable

Contingency tables for survey data
svycoplot

Conditioning plots of survey data
svycdf

Cumulative Distribution Function
svyCprod

Computations for survey variances
svyfactanal

Factor analysis in complex surveys (experimental).
svykappa

Cohen's kappa for agreement
svyivreg

Two-stage least-squares for instrumental variable regression
svygofchisq

Test of fit to known probabilities
svyloglin

Loglinear models
svylogrank

Compare survival distributions
svykm

Estimate survival function.
svydesign

Survey sample analysis.
svyglm

Survey-weighted generalised linear models.
svyhist

Histograms and boxplots
svyprcomp

Sampling-weighted principal component analysis
svyqqplot

Quantile-quantile plots for survey data
svyratio

Ratio estimation
svyolr

Proportional odds and related models
svynls

Probability-weighted nonlinear least squares
svyranktest

Design-based rank tests
svyplot

Plots for survey data
svypredmeans

Predictive marginal means
svymle

Maximum pseudolikelihood estimation in complex surveys
newsvyquantile

Quantiles under complex sampling.
svyttest

Design-based t-test
svyscoretest

Score tests in survey regression models
weights.survey.design

Survey design weights
twophase

Two-phase designs
trimWeights

Trim sampling weights
svysurvreg

Fit accelerated failure models to survey data
svyrecvar

Variance estimation for multistage surveys
svystandardize

Direct standardization within domains
svysmooth

Scatterplot smoothing and density estimation
update.survey.design

Add variables to a survey design
with.svyimputationList

Analyse multiple imputations
xdesign

Crossed effects and other sparse correlations
withCrossval

Crossvalidation using replicate weights
withReplicates

Compute variances by replicate weighting
yrbs

One variable from the Youth Risk Behaviors Survey, 2015.
withPV.survey.design

Analyse plausible values in surveys
as.fpc

Package sample and population size data
bootweights

Compute survey bootstrap weights
as.svydesign2

Update to the new survey design format
HR

Wrappers for specifying PPS designs
SE

Extract standard errors
api

Student performance in California schools
as.svrepdesign

Convert a survey design to use replicate weights
brrweights

Compute replicate weights
barplot.svystat

Barplots and Dotplots
anova.svyglm

Model comparison for glms.