Analyse survey CSV exports (completion, Wilson intervals, segment cross-tabs, open-text themes) and vet questionnaires. Use when reporting survey results or checking leading, double-barrelled questions.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Survey Analyzer?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/borghei-survey-analyzer)
---
name: survey-analyzer
description: >
Analyse survey CSV exports (completion, Wilson intervals, segment cross-tabs,
open-text themes) and vet questionnaires. Use when reporting survey results or
checking leading, double-barrelled questions.
license: MIT
metadata:
version: 1.0.0
author: borghei
category: data-analytics
domain: survey
updated: 2026-12-03
tags: [survey, csv, likert, top-2-box, confidence-interval, cross-tab, questionnaire, open-text]
---
# Survey Analyzer
Two offline tools for survey work. `survey_results.py` reads the responses CSV you export from Typeform,
Google Forms or similar and reports what the data can and cannot support: counts, completion, rating
distributions with intervals, one segment cross-tab, open-text themes. `questionnaire_check.py` reads the
questionnaire before you send it and flags wording and answer-option faults. Small n is flagged on every
line it applies to, never hidden.
## What you get
Run on a flawed export (40 respondents, one region has 4 of them):
```bash
python3 scripts/survey_results.py assets/flawed_responses.csv --questions assets/sample_questions.json --segment region
```
Real output (excerpt, exit 1):
```
FIX 11 issues
Read assets/flawed_responses.csv: 42 rows, 13 columns, 9 questions (likert 5, numeric 1, single 1, multi 1, open 1); questions from assets/sample_questions.json
Excluded 2 blank rows (no answer to any question), e.g. data row 11
Findings:
3. [low-completion] all required questions: only 18 of 40 respondents (45.0%) answered every required question
rule: internal heuristic: completion below 70.0% suggests drop-off (change with --completion)
fix: Look at value (blank for 15 respondents) and shorten or reorder around it.
10. [small-segment] region: groups below the minimum size: East (n=4), North (n=28), South (n=8)
rule: internal heuristic: fewer than 30 respondents per group gives intervals too wide to compare
fix: Treat these groups as indicative only, or merge them into a larger group before comparing.
...
recommend [likert] "How likely are you to recommend Fernwood Studio to a friend?"
n=28 [SMALL n=28], not applicable=0, mean 3.79; top-2-box (4-5): 75.0% (21/28), 95% CI 56.6% to 87.3%
...
overall top-2-box by region ("Overall, how satisfied are you with Fernwood Studio?")
East: 75.0% (3/4), 95% CI 30.1% to 95.4% [SMALL]
North: 78.6% (22/28), 95% CI 60.5% to 89.8% [SMALL]
South: 50.0% (4/8), 95% CI 21.5% to 78.5% [SMALL]
North vs South: intervals overlap; do not report this as a difference
```
The questionnaire checker, on a flawed question list (`python3 scripts/questionnaire_check.py assets/flawed_questions.json`):
```
1. [leading-question] q1: "Don't you agree that our instructors are amazing?" uses "amazing"
rule: wording that signals the preferred answer biases responses (internal heuristic)
fix: Reword neutrally: "How would you rate our instructors?"
6. [overlapping-ranges] q4: options "18-25" and "25-34" both include 25
fix: Change one boundary so the ranges meet once, e.g. make "18-25" end at 24.
```
## When to Use
- You have a survey export (CSV) and need results you can defend: intervals, not bare percentages.
- You need to know whether a segment difference is real or within noise before it goes in a slide.
- You have open-text answers and want theme counts with quoted examples.
- You are about to send a questionnaire and want a wording and answer-option check first.
## Clarify First
Settle these before running; ask only about the ones that would change the result, otherwise pick a
default and say which.
- **Questions file:** is there a questions JSON (id, text, type likert|single|multi|numeric|open, scale)?
Without one the tool infers types and says so; likert scales and multi-select columns need the file.
- **Segment:** which column should results be split by (plan, region, tenure band)? One column per run.
- **Who is the population:** all customers, or only those who replied? The intervals describe
sampling noise only; say so when the response rate is low or the sample was self-selected.
- **Decision at stake:** a go/no-go needs tighter intervals than a directional read (`--min-n`).
If the user wants numbers straight away, run with defaults and state the assumptions at the top.
## Workflow 1: Analyse a survey export
1. Export responses as CSV (UTF-8, one row per respondent, one column per question).
2. Write or reuse a questions JSON (`assets/sample_questions.json` is the template). Ids equal the CSV headers.
3. Run `python3 scripts/survey_results.py responses.csv --questions questions.json`.
4. Fix or caveat every finding before reporting: blank rows, duplicates, items with high non-response.
5. Re-run with `--segment <column>` for the comparison; only report a gap the tool marks as non-overlapping.
6. For open text, run with `--themes my_themes.json` after adding words from the "frequent words" line.
7. Paste the table at the end of the output into the report; keep the `[SMALL]` markers.
## Workflow 2: Check a questionnaire before sending
1. Put the draft questions in a questions JSON (text, type, options, scale labels).
2. Run `python3 scripts/questionnaire_check.py questions.json`.
3. Apply the suggested rewrites (check the wording; they are mechanical), fix scale labels and ranges.
4. Re-run until PASS, then pilot with a few people; the checker cannot judge meaning.
## Workflow 3: Compare segments honestly
1. Run with `--segment`; read the group sizes line first.
2. Merge groups under `--min-n` or report them as indicative only.
3. Quote both intervals for any claimed difference. "Intervals overlap" means do not call it a difference.
## Most Damaging Mistakes (Anti-Patterns)
### Reporting a percentage with no n
**Mistake:** "75% satisfied" is quoted from 4 respondents. [PROVEN] Intervals from tiny groups span most of the scale (3 of 4 gives 30.1% to 95.4%).
**Instead:** Quote n and the interval, and keep the `[SMALL]` flag on the slide.
### Calling a gap a finding when intervals overlap
**Mistake:** 78% against 50% sounds large; with n of 28 and 8 the intervals overlap and the data does not separate them.
**Instead:** Report a segment difference only when the tool says the intervals do not overlap, and still do not claim a cause.
### Ignoring item non-response
**Mistake:** A question 37% of people skipped is reported as if it described everyone. [RECOMMENDED] It describes the people who answered.
**Instead:** Print the blank rate beside the result, and check why it was skipped (confusing, sensitive, not applicable).
### Leading or double-barrelled wording
**Mistake:** "How satisfied are you with the price and quality?" cannot be answered with one number, and no analysis fixes it afterwards.
**Instead:** Run `questionnaire_check.py` before fielding; split the question and pilot it.
### Counting keywords as meaning
**Mistake:** Theme counts match words, so "not expensive" counts under price. [EXPERIMENTAL] Keyword lists are a first pass, not coding.
**Instead:** Read the quoted examples, extend the keyword list, and quote answers rather than percentages when n is small.
### Treating blanks as zero or N/A as a low score
**Mistake:** Blanks and "N/A" answers pushed into the denominator or scored as the bottom of the scale.
**Instead:** Leave them out of n and show their count beside it, as the tool does.
## Files
- `scripts/survey_results.py` — responses CSV to counts, completion, intervals, cross-tab, themes
- `scripts/questionnaire_check.py` — questions JSON to wording and option findings
- `scripts/survey_core.py`, `survey_items.py`, `survey_segments.py` — shared library modules (not commands)
- `references/survey-methods.md` — what each number and rule means, thresholds, which are configurable
- `references/themes.json` — editable starter keyword lists for open text
- `references/question-rules.json` — editable word lists for the questionnaire checker
- `assets/` — `sample_*` (exit 0), `flawed_*` (exit 1), `malformed_*` (exit 2) inputs and `contract.json`
Exit codes (both tools): `0` clean, `1` findings to act on, `2` unusable input (one `BLOCKED:` line on
stderr). `--format json` gives the same report as JSON; `--help` works on both.
## Scope & Limitations
**In scope:** one responses CSV per run, rating, single-choice, multi-select, numeric and open-text
questions, one segment column, 95% Wilson intervals, keyword themes, questionnaire wording and option checks.
**Out of scope:** weighting and non-response adjustment, significance tests between segments (the tool
compares intervals only), multi-select exports with one column per option, conjoint or MaxDiff analysis,
sentiment or meaning from open text, fetching data from any survey platform (no network calls), and
sample-size planning (see `statistical-analyst`).
**Know the limits:** thresholds marked "internal heuristic" are rules of thumb. The intervals assume a
random sample and do not account for who chose to respond. Platform export formats change; check your
tool's current export. The questionnaire checks are word-list based and will miss and over-flag.