wtd.sd {poliscidata}R Documentation

Find Standard Deviation of Variable

Description

Takes in variable and calculates standard deviation, works with sampling weights.

Usage

wtd.sd(x, weights = NULL)

Arguments

x

A variable (must be numeric), should be in dataset$var form.

weights

Sampling weights of variable (optional), should be in dataset$weightvar form.

Details

Makes use of the freq function, part of the descr package.

Value

Returns the standard deviation of the variable, a numeric value.

Examples

   library(poliscidata)
   
   wtd.sd(nes$polknow_combined, nes$wt)

[Package poliscidata version 2.3.0 Index]