Thoughts on research, forecasting, statistics, and other distractions.

Subject ▸ Rstats

Calculating standard deviations for survey subgroups in R

If you work with survey data in R, you would already know how useful the package survey is. Among its many other uses, the survey package can compute summary statistics by subgroups. For example, if you have 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…