Learn R Programming

poliscidata (version 2.3.0)

wtd.sd: 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.

Value

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

Details

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

Examples

Run this code
# NOT RUN {
   library(poliscidata)
   
   wtd.sd(nes$polknow_combined, nes$wt)
# }

Run the code above in your browser using DataLab