help for ietestform

Title

ietestform -- Tests SurveyCTO form definition file for errors and best practices that the server does not check for.

This help file only covers information needed to run this command in Stata, for a description of the tests performed by this command please see this DIME Wiki article.

Syntax

ietestform using "/path/to/form.xlsx", reportsave("/path/to/report.csv") [statalanguage(string) replace date]

Options

Required

using "/path/to/form.xlsx" Specify the file path to the file with the SurveyCTO form definition.

reportsave("/path/to/report.csv") Specify the file path to the .csv report you want to create listing all issues found.

Optional

statalanguage(string) Specify the name used for the Stata language label in the form definition. Default is stata which works if the column name is label:stata.

replace Replaces the report file if there is already a file with that name in that location.

date Adds the current date to the report file name.

Description

ietestform takes a SurveyCTO form definition in Excel format and parses
it to test for errors and best practices that the SurveyCTO server does not check for. Some
of these test are testing that DIME Analytics' best practices are used, especially in
the context of collecting data that will be imported to Stata.

Tests performed

This helpfile is only meant to describe how to use the command in Stata. The tests this command performs are all described in detail in this DIME Wiki article.

Options

using "/path/to/form.xlsx" specifies the file path to the file with the SurveyCTO form definition. The form definition can be either in .xlsx or .xls format. If you are using an older version of Stata and a newer version of Excel, then you might encounter issues with the .xslx format. You can then save the file in .xls format but you might lose conditional formatting and other newer features, although no data will be lost. The old syntax surveyform("/path/to/form.xlsx") is still allowed for backward compatibility with earlier versions of ietestform.

reportsave("/path/to/report.csv") specifies the file path to the .csv report you want to create listing all issues found.

statalanguage(string) specifies the name used for the Stata language label in the form definition. Default is stata which works if the column name is label:stata. Whatever you call your columns, do not include label: in this option, only what comes after the colon in the column name in the form definition.

replace replaces the report file if there is already a file with that name in that location. If replace is not used, then an error is thrown if a file already exist.

date adds the current date to the report file name. If this option is used in combination with replace, then the last report generated each day will be saved on disk for future documentation.

Examples

All examples will use the following globals as folder paths:

global project "C:\username\Documents\ProjectA"

global formdef "$project\form_definitions\"

global output "$project\ietestform_reports"

Example 1.

ietestform using "$formdef/form.xlsx", reportsave("$output/report.csv")

This is the simplest possible way this command can be run. In this example the form form.xslx is read and all tests are applied to the form definition. A report with the name report.csv written to disk and it will include any cases caught by the command.

Example 2.

ietestform using "$formdef/form.xlsx", reportsave("$output/report.csv") date replace

This example will work very similarly to Example 1. But this command will overwrite any report already in the $output folder since the option replace is used. Also, since the option date the name of the report file will be report_31JAN2019.csv (the date will obviously be updated to the current date). Since replace and date are used together, then the last report created each day will be saved for documentation.

Author

All commands in iefieldkit is developed by DIME Analytics at DECIE, The World Bank's unit for Development Impact Evaluations.

Author: Kristoffer Bjarkefur, DIME Analytics, The World Bank Group

Please send bug-reports, suggestions and requests for clarifications
writing "iefieldkit ietestform" in the subject line to:

dimeanalytics@worldbank.org

You can also see the code, make comments to the code, see the version
history of the code, and submit additions or edits to the code through the GitHub repository of iefieldkit.