Skip to contents

This function display the enumerators with very low or high productivity.

Usage

enumeratorProductivityOutliers(
  ds = NULL,
  enumeratorID = NULL,
  surveyDate = NULL,
  sdval = 2
)

Arguments

ds

dataset containing the survey (from kobo): labelled data.frame

enumeratorID

name of the field where the enumerator ID is stored: string

surveyDate

name of the field in the dataset where the date of the survey is stored: string

sdval

(Optional, by default set to 2) number of standard deviation for which the data within is considered as acceptable: integer

checkperiod

if not null number of day before today when the check should be made

Value

result a list that includes: * dst same dataset as the inputed one but with survey marked for deletion if errors are found and delete=TRUE (or NULL) * ret_log list of the errors found (or NULL) * var a list of value (or NULL) * graph graphical representation of the results (or NULL)

Examples

load(system.file("sample_dataset.RData", package = "HighFrequencyChecks")) 
ds <- sample_dataset
enumeratorID <- "enumerator_id"
surveyDate <- "survey_date"
sdval<-2

result <- enumeratorProductivityOutliers(ds = ds,
                                         enumeratorID=enumeratorID,
                                         surveyDate=surveyDate,
                                         sdval=sdval)

knitr::kable(head(result[["ret_log"]], 10))  
#> 
#> 
#> |   | enumerator_id| days_worked| total_surveys_done| daily_average| survey_outliers|
#> |:--|-------------:|-----------:|------------------:|-------------:|---------------:|
#> |4  |            12|           3|                  6|             2|        2.412083|
#> |12 |            28|           4|                  8|             2|        2.412083|
#> |59 |         10050|           3|                  6|             2|        2.412083|
print(result[["graph"]])