Subject ▸ surveys

Calculating standard deviations for survey subgroups in R

The survey package is one of my favourites in R. Among its many other uses, it can compute summary statistics by subgroups. For example, if you have a survey of individuals from several countries with an item on the respondents’ income, you can calculate the average income in each subgroup with the svyby() function. However, like many other functions in the package, svyby() returns standard errors—but not standard deviations—of the mean values.

Read More…