SPSS Multiple Response Coded Data: CSV and Syntax Walkthrough
A coded open-ended answer can mention several themes. In SPSS, a practical representation is one row per respondent and one binary variable per theme. The CSV holds the values; an accompanying .sps file records how to read them and what they mean. This guide builds a small example you can reproduce without a survey-coding application.
Choose a wide binary layout
Suppose the question is “What stood out about the app?” Use q_price for cost or value, q_ease for learning and navigation, and q_support for contact with customer support. Include positive and negative mentions in each theme. A purely visual comment falls outside this small frame. The companion codebook records these definitions and boundaries.
Store 1 when the theme is mentioned and 0 when it is not. Several ones in a row are valid. Avoid storing a list such as price;ease in a single variable as your only analytical representation: that string needs another transformation before ordinary theme counts are available. You may retain it as a convenience alongside binary columns.
Keep respondent IDs as strings, particularly if they contain leading zeros. Maintain a separate response status. For this example, valid means at least one theme applies, other means substantive text outside the frame, and non_response means no usable text. Do not make zero a missing value: it carries the meaningful statement that a theme was not mentioned.
Worked example: ten source answers
These are invented comments. The original text should remain in your source file; the small import CSV below contains IDs, status and final code decisions only.
| ID | Answer | Assigned codes |
|---|---|---|
| 001 | “Easy to learn.” | ease |
| 002 | “The subscription costs too much.” | price |
| 003 | “Support patiently explained the problem.” | support |
| 004 | “Simple menus, but the monthly charge is high.” | price; ease |
| 005 | “Support took ages to reply.” | support |
| 006 | “I found my way around straight away.” | ease |
| 007 | “Good value compared with our old app.” | price |
| 008 | “Easy setup and helpful support.” | ease; support |
| 009 | “Please change the logo.” | other |
| 010 | Empty answer | non_response |
Save this exact content as a UTF-8 file named coded.csv. The header order must match the variable list in the syntax.
id,response_status,q_price,q_ease,q_support
001,valid,0,1,0
002,valid,1,0,0
003,valid,0,0,1
004,valid,1,1,0
005,valid,0,0,1
006,valid,0,1,0
007,valid,1,0,0
008,valid,0,1,1
009,other,0,0,0
010,non_response,0,0,0
Quote fields containing commas, quotation marks or line breaks if you later add text to the export. This example avoids those complications by leaving comments in a separately preserved source file. Do not remove quotation marks by search-and-replace in a real CSV; they protect field boundaries.
Import with explicit variable types
Open a new syntax window, change the file path and run the following import. Use the actual absolute path on your computer, not the illustrative folder. Check the command output for warnings before continuing.
GET DATA
/TYPE=TXT
/FILE='/your/folder/coded.csv'
/ENCODING='UTF8'
/ARRANGEMENT=DELIMITED
/DELCASE=LINE
/FIRSTCASE=2
/DELIMITERS=","
/QUALIFIER='"'
/VARIABLES=
id A8
response_status A16
q_price F1.0
q_ease F1.0
q_support F1.0.
DATASET NAME survey.
EXECUTE.
FIRSTCASE=2 skips the header. A8 preserves the ID as a string; A16 is wide enough for the status values shown. The three numeric variables use a one-digit format. If your IDs or statuses are longer, enlarge those string widths before import. A display format is not a validation rule, so still check that code values are only zero or one.
For a semicolon-delimited export, change DELIMITERS accordingly. Do not assume your spreadsheet's regional settings match this example. If names or accents look damaged, investigate the file encoding rather than editing individual characters in the imported dataset.
The PSPP text-import reference explains the encoding and first-case settings used in this import.
Add labels and the multiple-response definition
Readable variable labels describe themes; value labels describe zero and one. A multiple dichotomy set tells SPSS that the binary columns belong to one question and that 1 is the counted value. IBM's MRSETS reference documents the command and its dollar-prefixed set names.
VARIABLE LABELS
q_price 'Price and value'
q_ease 'Ease of use'
q_support 'Customer support'.
VALUE LABELS q_price q_ease q_support
0 'Not mentioned'
1 'Mentioned'.
VARIABLE LEVEL q_price q_ease q_support (NOMINAL).
MRSETS
/MDGROUP NAME=$themes LABEL='App feedback themes'
VARIABLES=q_price q_ease q_support VALUE=1
/DISPLAY NAME=[$themes].
Defining the set does not itself produce a frequency table. SPSS procedures and installed options differ in their use of multiple-response sets. In particular, do not assume that defining MRSETS also configures every legacy Multiple Response dialog. The ordinary binary-variable frequencies below remain a direct way to reconcile the import.
Check counts and choose the denominator
FREQUENCIES VARIABLES=response_status q_price q_ease q_support.
TEMPORARY.
SELECT IF response_status <> 'non_response'.
FREQUENCIES VARIABLES=q_price q_ease q_support.
The full file has ten rows. Price is mentioned three times, ease four times and support three times. Those are ten theme assignments across eight answers with a topical code. One further answer is substantive but outside the frame; one is empty. The second frequency command excludes the empty answer for that procedure only.
On a nine-substantive-answer base, ease is four divided by nine. On the eight-answer base with an assigned theme, it is four divided by eight. A multiple-response table may choose a different case base from the one your report requires, especially when rows contain only zeros. Inspect the output definition and label the intended denominator explicitly.
Do not confuse percentage of respondents with percentage of assignments. The latter uses ten theme assignments as its base here. Several themes per respondent mean respondent percentages need not sum to 100 percent. Keep any weighting decision separate and reconcile unweighted counts first.
PSPP and saved deliverables
PSPP works too for this binary-data workflow: import the CSV, label variables and inspect their frequencies. Its official manual documents MRSETS, while noting limits on using those sets in analytical procedures. Do not promise identical menus or multiple-response tables across PSPP and SPSS. Individual binary variables provide a portable checking route.
A CSV and .sps bundle is not a native .sav file. After inspecting the imported data, you can save a system file from your analysis software. Preserve the original CSV, codebook and syntax as well, so another analyst can reconstruct the variable definitions and check the import.
Handover checklist
- Match source and imported row counts, including residual statuses.
- Confirm leading zeros, encoding and string widths.
- Check the allowed binary values and the three expected theme totals.
- Inspect at least one answer with two assigned codes.
- Record the response base and archive the syntax used.
FAQ
Should zeros be declared missing?
No. Zero means a theme was not mentioned. Use the separate status to exclude non-responses when appropriate.
Does MRSETS calculate the table?
No. It defines a set. Choose a supported reporting procedure or tabulate the individual binary variables.
Why do my percentages differ from a spreadsheet?
Check whether the bases differ: all rows, substantive answers, answers with a code or total assignments. Also check filters and weights.
Can I import the text as well?
Yes, with an explicit string variable and suitable CSV quoting and width. Keep a source copy and verify long and multiline comments after import.
Survey Coding by Decision Models (Beta) accepts CSV/XLSX and a codebook or template, shows probabilities per code and offers review of uncertain answers. Export options include CSV/XLSX and CSV with SPSS syntax; up to 500 answers per project are free. Try Survey Coding.