Home > FAQ, Survey Creation, SurveyToGo FAQ > How To: Create A Kish Grid Model

How To: Create A Kish Grid Model

Overview

One of today’s most popular model’s for selecting random respondents from a group – is the Kish Grid.
This ‘How-To’ will show you in a few simple steps how to implement you own Kish Grid on SurveyToGo.

Step 1: Organizing the Structure of the Kish Grid.

Step 2: Entering Scripts & Configuration.

And here is a an explanation of how to import it to your SurveyToGo Studio.
How To: Import A Survey

Step1: Organizing the Structure of the Kish Grid.

Basically, this is the structure you would need to implement:

1. Chapter 1: “Kish Template”
1. Single Choice Question: “Kish Grid”
2. Chapter 2: “Main Survey”
1. Numeric Question: “How many adults aged between 18 and above who are living here at the moment?”
2. Empty Question: “Firstly, I need to decide whom I should interview from this household. Can you give me the first names and ages of all the adults aged between 18 and above who are living here at the moment?”
1. Free Text Question: “@_@ITERNAME@_@ Adult name”
2. Numeric Question: “{0}’s Age:”
4. Chapter 4: “Kish Calculation”
1. Expression Question: “Dummy: Selected adult Index based on Kish Grid”
5. Chapter 5: “Continue”
1. Empty Question: “The selected adult is {0}”

Step 2: Entering Scripts & Configuration.

Now let’s go question by question, configure it and enter its scripts:

Question 1 – Single Choice:

1,1,1,1,1,1,1,1,1,1
2,1,2,1,2,1,2,1,2,2
1,2,3,1,2,3,1,2,3,1
1,2,3,4,1,2,3,4,1,2
4,5,1,2,3,4,5,1,2,3
4,5,6,1,2,3,4,5,3,1
3,4,5,6,7,1,2,3,4,5
3,4,5,6,7,8,1,2,3,4
2,3,4,5,6,7,8,9,1,2
1,2,3,4,5,6,7,8,9,1
2. Scripts:
None
1. Configuration:
Go to its Advanced tab and configure it to be hidden from the surveyor:

Question 2 – Numeric:

1. Scripts: None.

Question 3 – Empty Text:

1. Scripts: None.

1. Go to ‘Edit Answer Scales’ in the Survey’s Root ‘Advanced Tab’ and create the following scale, as the picture shows:

• In case you are not familiar with ‘Answer Scales‘, you can find information about it in the following link:
1. After creating the scale, Go to the current chapter’s ‘Loops tab’ and configure it to iterate according to the scale we just created and enable the use entrance rule.

• In case you are not familiar with ‘Loops‘, you can find information about it in the following link:
Programming Loops
1. Now add the following in the ‘Iteration Entrance Rule’ that is showing at the bottom of the ‘Loops’ tab:

• This rule will check each iteration index (Running index from 1 to the number of answers in ‘Number of Adults’ Answer Scale– as we configured it to iterate by scale) – if the iteration index is less or equal to the Answer of question 2 (number of adults we entered), enter the chapter, else – continue.
What basically means, once the running index will be greater than the number of adults we entered, it would stop asking for the adults name’s and age.

Question 4 – Free Text:

1. Scripts: None.

Question 5 – Numeric:

1. Start Script:
• This script would pipe the Name of the adult entered in Question 4 into the place holder{0}‘.
• In case you are not familiar with ‘Piping‘, you can find information about it in the following link:
Piping Video Tutorial
1. End Script:

if (IterationIndex == Answer(2))                     //line 1

{

var kishLineArray = StringToIntArray(kishLineString);    //line 4

var curInterviewID = DeviceIndex;                //line 5

var lastDigitOfInterview =                     //line 6

curInterviewID.ToString().substring(curInterviewID.ToString().length-1,curInterviewID.ToString().length);

var kishIdx = kishLineArray[lastDigitOfInterview];    //line 7

}

Code Description:
Line 1: Create an if statement asking: “if the current iteration index is equal to the answer of question 2 -> please enter”

Line 2: Variable Declaration: Number of adults is equal to the answer of question 2.

Line 3: The Kish Grid format chosen according to the text of the answer in the index of ‘Number of Adults’:    e.g. (2,1,2,1,2,1,2,1,2,2 – would be for 2 adults.)

Line 4: Turn the Kish Grid format we got from line 3 from a string to an integer array.

Line 5: Get the interview ID according to the ‘Device Index’ which normally would be in this format: ‘NUMBER’-i    (i is a running index).

Line 5: Get the last digit of the interview id and insert it into a variable called “lastDigitOfInterview”.

Line 7: Get the selected ID (adult) by choosing the number in the ‘lastDigitOfInterview’ place in the Kish Grid Array.

Line 8: Set our Expression (Question 6) with the ID we chose.

Chapter 4 – “Kish Calculation”

1. Scripts: Inside the Expressions ‘Answers’ tab, you should enter the following script:
• This script will make the Expressions answer to be the ID that was chosen.

Chapter 5 – “Continue”

Question 7 – Empty Question