MyNixOS website logo
Description

Quick and Flexible Survey Weighting.

Quickly and flexibly calculates weights for survey data, in order to correct for survey non-response or other sampling issues. Uses rake weighting, a common technique also know as rim weighting or iterative proportional fitting. This technique allows for weighting on multiple variables, even when the interlocked distribution of the two variables is not known. Interacts with Thomas Lumley's 'survey' package, as described in Lumley, Thomas (2011, ISBN:978-1-118-21093-2). Adds additional functionality, more adaptable syntax, and error-checking to the base weighting functionality in 'survey.'

svyweight

Quick and Flexible Survey Weighting

Ben Mainwaring

Description

R package for quickly and flexibly calculating rake weights (also known as rim weights, or iterative proportional fitting). This allows post-stratification/non-response weighting on multiple variables, even the interlocked distribution of the two variables is not known. Interacts with Thomas Lumley's survey package, and adds additional functionality, more adaptable syntax, and error-checking to the weighting functionality in survey.

The core function in svyweight is rakesvy (and the related rakew8), which calculates post-stratification weights for a dataset or svydesign object, given targets. The command is designed to make weighting as simple as possible, with the following features:

  • Imputing unknown (NA) targets based on observed distributions
  • Accepting targets of 0 (equivalent to dropping cases from analysis)
  • Assessing weight quality using Kish' effective sample size
  • Weighting to either counts or percentage targets
  • Allowing specification of targets as vectors, matrices, or data frames
  • Allowing targets to be quickly rebased to a specified sample size
  • Flexibly matching targets to the correct variables in a dataset
  • Dynamically specifying weight targets based on recodes of variables in observed data

More details about the package are available in the R help files (see package?svyweight in R).

Planned Features

The package is under development, and additional features are planned for future release. This includes:

  • Additional metrics of weight quality
  • Techniques for weighting numeric and ordinal data based on histograms/binning

Contributions to the package, or suggestions for additional features, are gratefully accepted via email or GitHub.

Metadata

Version

0.1.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows