powered by
Takes in variable and calculates standard deviation, works with sampling weights.
wtd.sd(x, weights = NULL)
A variable (must be numeric), should be in dataset$var form.
Sampling weights of variable (optional), should be in dataset$weightvar form.
Returns the standard deviation of the variable, a numeric value.
Makes use of the freq function, part of the descr package.
# NOT RUN { library(poliscidata) wtd.sd(nes$polknow_combined, nes$wt) # }
Run the code above in your browser using DataLab