wtd.sd: Find Standard Deviation of Variable

Description Usage Arguments Details Value Examples

View source: R/wtd.sd.r

Description

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

Usage

1

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

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

Example output

[1] 1.770014

poliscidata documentation built on July 8, 2020, 6:23 p.m.