Learn R Programming

survey (version 4.4-8)

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 subsampling designs. Graphics. PPS sampling without replacement. Small-area estimation.

Copy Link

Version

Install

install.packages('survey')

Monthly Downloads

65,927

Version

4.4-8

License

GPL-2 | GPL-3

Maintainer

Thomas Lumley

Last Published

August 28th, 2025

Functions in survey (4.4-8)

dimnames.DBIsvydesign

Dimensions of survey designs
confint.svyglm

Confidence intervals for regression parameters
hadamard

Hadamard matrices
fpc

Small survey example
crowd

Household crowding
election

US 2004 presidential election data at state or county level
ftable.svystat

Lay out tables of survey statistics
calibrate

Calibration (GREG) estimators
estweights

Estimated weights for missing data
compressWeights

Compress replicate weight matrix
marginpred

Standardised predictions (predictive margins) for regression models.
open.DBIsvydesign

Open and close DBI connections
myco

Association between leprosy and BCG vaccination
nhanes

Cholesterol data from a US survey
make.calfun

Calibration metrics
nonresponse

Experimental: Construct non-response weights
hospital

Sample of obstetric hospitals
oldsvyquantile

Deprecated implementation of quantiles
paley

Paley-type Hadamard matrices
smoothArea

Small area estimation via basic area level model
mu284

Two-stage sample from MU284
postStratify

Post-stratify a survey
smoothUnit

Smooth via basic unit level model
psrsq

Pseudo-Rsquareds
regTermTest

Wald test for a term in a regression model
rake

Raking of replicate weight design
scd

Survival in cardiac arrest
salamander

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

Distribution of quadratic forms
poisson_sampling

Specify Poisson sampling design
surveyoptions

Options for the survey package
svyby

Survey statistics on subsets
svycdf

Cumulative Distribution Function
surveysummary

Summary statistics for sample surveys
svy.varcoef

Sandwich variance estimator for glms
svrVar

Compute variance from replicates
stratsample

Take a stratified sample
svrepdesign

Specify survey design with replicate weights
svyCprod

Computations for survey variances
subset.survey.design

Subset of survey
svygofchisq

Test of fit to known probabilities
svyciprop

Confidence intervals for proportions
svycontrast

Linear and nonlinearconstrasts of survey statistics
svycoplot

Conditioning plots of survey data
svyfactanal

Factor analysis in complex surveys (experimental).
svycralpha

Cronbach's alpha
svycoxph

Survey-weighted Cox models.
svyglm

Survey-weighted generalised linear models.
svydesign

Survey sample analysis.
svytable

Contingency tables for survey data
svyhist

Histograms and boxplots
svyolr

Proportional odds and related models
svykappa

Cohen's kappa for agreement
svyloglin

Loglinear models
svylogrank

Compare survival distributions
svymle

Maximum pseudolikelihood estimation in complex surveys
svynls

Probability-weighted nonlinear least squares
svyivreg

Two-stage least-squares for instrumental variable regression
svyplot

Plots for survey data
svykm

Estimate survival function.
svyratio

Ratio estimation
svystandardize

Direct standardization within domains
svysmooth

Scatterplot smoothing and density estimation
svyranktest

Design-based rank tests
svypredmeans

Predictive marginal means
svyprcomp

Sampling-weighted principal component analysis
svyqqplot

Quantile-quantile plots for survey data
svyrecvar

Variance estimation for multistage surveys
svyscoretest

Score tests in survey regression models
newsvyquantile

Quantiles under complex sampling.
withReplicates

Compute variances by replicate weighting
weights.survey.design

Survey design weights
trimWeights

Trim sampling weights
twophase

Two-phase designs
xdesign

Crossed effects and other sparse correlations
svyttest

Design-based t-test
svysurvreg

Fit accelerated failure models to survey data
withPV.survey.design

Analyse plausible values in surveys
with.svyimputationList

Analyse multiple imputations
yrbs

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

Add variables to a survey design
anova.svyglm

Model comparison for glms.
bootweights

Compute survey bootstrap weights
as.svydesign2

Update to the new survey design format
api

Student performance in California schools
brrweights

Compute replicate weights
as.fpc

Package sample and population size data
as.svrepdesign

Convert a survey design to use replicate weights
SE

Extract standard errors
HR

Wrappers for specifying PPS designs
barplot.svystat

Barplots and Dotplots