Learn R Programming

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

survey (version 4.0)

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. Principal components, factor analysis.

Copy Link

Version

Install

install.packages('survey')

Monthly Downloads

77,056

Version

4.0

License

GPL-2 | GPL-3

Maintainer

Thomas Lumley

Last Published

April 3rd, 2020

Functions in survey (4.0)

barplot.svystat

Barplots and Dotplots
as.svydesign2

Update to the new survey design format
bootweights

Compute survey bootstrap weights
brrweights

Compute replicate weights
HR

Wrappers for specifying PPS designs
as.fpc

Package sample and population size data
as.svrepdesign

Convert a survey design to use replicate weights
crowd

Household crowding
confint.svyglm

Confidence intervals for regression parameters
anova.svyglm

Model comparison for glms.
estweights

Estimated weights for missing data
marginpred

Standardised predictions (predictive margins) for regression models.
ftable.svystat

Lay out tables of survey statistics
nhanes

Cholesterol data from a US survey
SE

Extract standard errors
hadamard

Hadamard matrices
postStratify

Post-stratify a survey
mu284

Two-stage sample from MU284
psrsq

Pseudo-Rsquareds
fpc

Small survey example
pchisqsum

Distribution of quadratic forms
api

Student performance in California schools
calibrate

Calibration (GREG) estimators
scd

Survival in cardiac arrest
hospital

Sample of obstetric hospitals
regTermTest

Wald test for a term in a regression model
svy.varcoef

Sandwich variance estimator for glms
compressWeights

Compress replicate weight matrix
election

US 2004 presidential election data at state or county level
rake

Raking of replicate weight design
svyCprod

Computations for survey variances
svyby

Survey statistics on subsets
svymle

Maximum pseudolikelihood estimation in complex surveys
svydesign

Survey sample analysis.
nonresponse

Experimental: Construct non-response weights
svylogrank

Compare survival distributions
make.calfun

Calibration metrics
svysmooth

Scatterplot smoothing and density estimation
open.DBIsvydesign

Open and close DBI connections
svypredmeans

Predictive marginal means
svyfactanal

Factor analysis in complex surveys (experimental).
dimnames.DBIsvydesign

Dimensions of survey designs
svyrecvar

Variance estimation for multistage surveys
paley

Paley-type Hadamard matrices
svyciprop

Confidence intervals for proportions
svycdf

Cumulative Distribution Function
surveyoptions

Options for the survey package
stratsample

Take a stratified sample
subset.survey.design

Subset of survey
svytable

Contingency tables for survey data
svyquantile

Quantiles for sample surveys
with.svyimputationList

Analyse multiple imputations
svycoxph

Survey-weighted Cox models.
svykm

Estimate survival function.
svrVar

Compute variance from replicates
trimWeights

Trim sampling weights
svynls

Probability-weighted nonlinear least squares
yrbs

One variable from the Youth Risk Behaviors Survey, 2015.
surveysummary

Summary statistics for sample surveys
svyttest

Design-based t-test
svycralpha

Cronbach's alpha
svyolr

Proportional odds and related models
weights.survey.design

Survey design weights
svykappa

Cohen's kappa for agreement
svyloglin

Loglinear models
withPV.survey.design

Analyse plausible values in surveys
svyprcomp

Sampling-weighted principal component analysis
svyivreg

Two-stage least-squares for instrumental variable regression
svycontrast

Linear and nonlinearconstrasts of survey statistics
svyglm

Survey-weighted generalised linear models.
svyplot

Plots for survey data
svystandardize

Direct standardization within domains
svrepdesign

Specify survey design with replicate weights
update.survey.design

Add variables to a survey design
twophase

Two-phase designs
svyranktest

Design-based rank tests
withReplicates

Compute variances by replicate weighting
svyratio

Ratio estimation
svyhist

Histograms and boxplots
svycoplot

Conditioning plots of survey data
svysurvreg

Fit accelerated failure models to survey data