This article is part of The Definitive Guide to Importing and Preparing Data.
When a question in a survey is posed with a different brand, concept, or other item, this is what is known as piping in survey scripting.
For example, a respondent might be asked: “How do you feel about this <CONCEPT>?” where the concept is different for each respondent. The "Concept" here has been piped in, whether from another question or a dummy survey variable.
When respondents see multiple questions that involve piping, and the items being piped in are randomized or rotated, that is known as looping. The data is asked and captured a bit like the following:
- var1 = How do you feel about <1st_Concept>?
- var2 = How do you feel about <2nd_Concept>?
- var3 = How do you feel about <3rd_Concept>?
The variables above show the order of presentation in the questionnaire, but for analysis what you want are variables that reflect how they feel about each concept rather than the order of presentation. If 6 concepts were being evaluated, you would want to end up with 6 variables such as the below:
- var_depiped_a = How do you feel about <Concept_A>?
- var_depiped_b = How do you feel about <Concept_B>?
- var_depiped_c = How do you feel about <Concept_C>?
- var_depiped_d = How do you feel about <Concept_D>?
- var_depiped_e = How do you feel about <Concept_E>?
- var_depiped_f = How do you feel about <Concept_F>?
The variables A through F above are 'depiped' and 'delooped'.
In the web app
- Depiping and delooping variables is not available in the web app.
Crunch Automation
- CREATE CATEGORICAL CASE command (Utilizing the THEN VARIABLE optional argument.)
In the example below, respondents were asked 3 piped questions in a looping situation. Hidden dummy variables (hBRAND1, hBRAND2, hBRAND3) stored the rotation so we know which brand is being piped into the 3 questions (q5_1, q5_2, q5_3). The resultant variables are used to construct a new categorical array, are then grouped in a folder called "Q5", and hidden from the variable sidebar
CREATE CATEGORICAL
CASE
WHEN hBRAND1 = 1 THEN VARIABLE q5_1
WHEN hBRAND2 = 1 THEN VARIABLE q5_2
WHEN hBRAND3 = 1 THEN VARIABLE q5_3
ELSE INTO NULL
END
AS q5_brand1
DESCRIPTION "Coca-Cola";
CREATE CATEGORICAL
CASE
WHEN hBRAND1 = 2 THEN VARIABLE q5_1
WHEN hBRAND2 = 2 THEN VARIABLE q5_2
WHEN hBRAND3 = 2 THEN VARIABLE q5_3
ELSE INTO NULL
END
AS q5_brand2
DESCRIPTION "Coke Zero";
CREATE CATEGORICAL
CASE
WHEN hBRAND1 = 3 THEN VARIABLE q5_1
WHEN hBRAND2 = 3 THEN VARIABLE q5_2
WHEN hBRAND3 = 3 THEN VARIABLE q5_3
ELSE INTO NULL
END
AS q5_brand3
DESCRIPTION "Pepsi";
CREATE CATEGORICAL ARRAY
q5_brand1, q5_brand2, q5_brand3
LABELS COPY(DESCRIPTION)
AS q5_delooped
TITLE "Feelings Towards Brands"
DESCRIPTION "How do you feel about each of the following brands";
ORGANIZE q5_brand1, q5_brand2, q5_brand3 INTO HIDDEN "Q5";