/surveytools

Miscellaneous tools used for survey analysis

Primary LanguageROtherNOASSERTION

SurveyTools

surveytools is a new tidyverse compiant package for survey analysis, comprising of miscellaneous functions used often for survey analysis at Dalberg. We have used these tools internally to analyse multiple surveys and dataframes, as well as use as a base to build additional tools and GUI over. Please reach out to us for questions regarding use and example code.

Functions

We provide two key functions that can be used for survey analysis:

  1. Summariser:

summariser_base forms the work horse of the package. It takes in the following arguments:

Parameter Value
Data (Required) Data to be summarised
Variable (Required) Name of atleast one variable to be summarised by. Does not support vectors of values, but supports all tidyverse select formats
Grouping variables Name, or tidyverse selection, of any variable to group the results by. Supports multiple groups concurrently
Stat One of "mean", "median", or "total". Defines the stat to be summarised over
Survey Design Required for analysis of surveys. Provides the structure of the survey (i.e. pps, etc.) Please see the `survey` package for full list of available options that can be passed in the list
Compare significance to Changes the default total against which all significance resuts are tested. Please provide in a "group::response" structure
Default level of significance 0.95. Can be modified

The function is pipping compliant -> the output of the function is always a dataframe.

  1. Crosstabs:

cross_tab is our second primary function. It allows you to convert the tidy data recieved from the summarise_base function, into a more commonly discernable dataframe