Skip to contents

This function display the number of filled forms conducted per day per consent status.

Usage

assessmentDailyValidSurveys(
  ds = NULL,
  surveyDate = NULL,
  dateFormat = NULL,
  surveyConsent = NULL,
  attempt = NULL
)

Arguments

ds

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

surveyDate

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

dateFormat

format used for the date: string ('%m/%d/%Y')

surveyConsent

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

attempt

name of the field in the dataset where the interview attempt output is stored: string

checkperiod

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

consentForValidSurvey

value defined in the kobo form to acknowledge the surveyed person gave his consent: string

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
surveyDate <- "survey_date"
dateFormat <- "%m/%d/%Y"
surveyConsent <- "survey_consent"
result <- assessmentDailyValidSurveys(
  ds = ds,
  surveyDate = surveyDate,
  dateFormat = dateFormat,
  surveyConsent = surveyConsent)

knitr::kable(head(result[["ret_log"]], 10))  
#> 
#> 
#> |calldate |survey_consent |  n|
#> |:--------|:--------------|--:|
#> |20-01    |no             |  1|
#> |20-01    |not_eligible   | 15|
#> |20-01    |yes            | 23|
#> |20-02    |no             |  5|
#> |20-02    |not_eligible   |  9|
#> |20-02    |yes            | 14|
#> |20-03    |not_eligible   |  2|
#> |20-03    |yes            | 12|
#> |20-04    |not_eligible   |  9|
#> |20-04    |yes            | 22|
print(result[["graph"]])