mapStats will calculate statistics (mean, total, quantiles, variance, and standard deviation) for survey
variables, by geography level (e.g. state, county), and optional class variables
(such as year, if multiple years are included). The statistics for each variable
are then plotted on a shapefile with color codes. Statistics may be calculated either weighted or unweighted. The function
calcStats, which is called by
mapStats, can also be used on its own to calculate variable statistics.
To use the package, one should have a survey
data.frame with a geographic variable, and a
shapefile that displays the boundaries of this geographic variable (such as a map of the
United States). The function
mapStats is used to call function
calcStats (which can also be used on its own outside of the wrapper function) to calculate the desired statistics, and then calls
plotStats to display these statistics
on the provided shapefile. A list of the calculated statistics is returned by
Samuel Ackerman Maintainer: Samuel Ackerman <[email protected]>
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.