A Stata command to compare two versions of a SurveyCTO XLSForm and generate a clean, formatted Excel dashboard summarizing all changes in variables, labels, and choice lists.
- Detects added, removed, and updated survey questions
- Classifies label changes by nature (significant, minor, formatting)
- Compares choice lists and maps them to affected variables
- Exports a polished Excel dashboard with summaries and details
- Optional formatting using Python's openpyxl
To install the latest version using the github package by E. F. Haghish:
net install github, from("https://haghish.github.io/github/")
github install kellymontano/surveyctocompareTo update the command in the future:
github update kellymontano/surveyctocompareAlternatively, you can use classic net install:
net install surveyctocompare, from("https://raw.githubusercontent.com/kellymontano/surveyctocompare/main/") replacesurveyctocompare , form1("form_v1.xlsx") form2("form_v2.xlsx") output("dashboard.xlsx") [noformat]form1()andform2()— Paths to the two.xlsxSurveyCTO forms to compareoutput()— File path for the generated Excel reportnoformat— Skips optional Excel formatting (no Python required)
The Excel dashboard includes:
- A
Summarysheet with counts by type of change Variable Updates: new or removed survey fieldsLabel Updates: textual label changes with classificationChoice Updates: added/removed/edited choices and affected variables
- Stata 16 or newer
- Optional: Python 3 with
openpyxlinstalled (for formatting)
Kelly Montaño
Innovations for Poverty Action (IPA)
Feel free to share, reuse, or contribute.