How to create a Kish Grid Model

Overview

The Kish Grid was a method for randomly selecting members within a household to be interviewed. This method was used when there was a need to manually choose the random household member so to not  have the surveyor impacting the selection of the respondent but have a method that would select the respondent more or less randomly without the surveyor impacting the selection.  Since SurveyToGo has the ability to automatically randomize the selection (using the Random function) without any input from the surveyor, it is not necessary to use the Kish Grid in SurveyToGo surveys.

Here is an example of a survey that automatically chooses a random member from a household:

http://support.dooblo.net/hc/en-us/article_attachments/204509025/Household_Demo_-_Random_member.srv

This survey is based on our guide on creating a household survey:

http://support.dooblo.net/hc/en-us/articles/208296535

The random selection is scripted in Q11 (A7).

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

 

Creating a Kish Grid Model

If you require a kish grid model in your survey, please review the following:

 

Step 1: Organizing the Structure of the Kish Grid.

Step 2: Entering Scripts & Configuration.

Download the Kish Grid Demo Survey:
Download Kish Grid Demo Survey

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:
Please follow this structure in terms of ‘Question Type: Body Text’.

  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?”
    3. Chapter 3: “Adults Details”
      1. Free Text Question: “@[email protected]@[email protected] 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}”

        (Continue your survey…)

Step 2: Entering Scripts & Configuration.

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

Question 1 – Single Choice:

  1. Answers:
    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.

Chapter 3 – “Adult Details”

  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:
    Answer Scales
  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:
    SetTextFormat(CurrQues,Answer(CurrQues-1));
  • 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 NumOfAdults = Answer(2);     // line 2

          //Prompt("NumOfChildren:"+ NumOfChildren);

         

          var kishLineString = AnswerText(1,NumOfAdults); // line 3

          //Prompt("kishLineString:"+ kishLineString);

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

         

          var curInterviewID = DeviceIndex;  // line 5

          //Prompt("curInterviewID:"+ curInterviewID);

         

          var lastDigitOfInterview = curInterviewID.ToString().substring(curInterviewID.ToString().length-1,curInterviewID.ToString().length);      // line 6

          //Prompt("lastDigitOfInterview:"+ lastDigitOfInterview);

         

          var finalOneBasedIndex = lastDigitOfInterview == 0 ? 10 : lastDigitOfInterview; // line 7

          //Prompt("finalOneBasedIndex:"+ finalOneBasedIndex);

         

          var kishIdx = kishLineArray[finalOneBasedIndex - 1];  // line 8

          //Prompt("kishIdx:"+ kishIdx);

          Prompt(kishIdx);

          SetAnswer(6,kishIdx);   // line 9

    }

     

    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). For example: 31039-25

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

    Line 7: Save the "real" one-based index that will indicate the place of the chosen value in the Kish Grid Array.

    Line 8: Get the selected ID (adult) by choosing the number in the ‘finalOneBasedIndex - 1’ place in the Kish Grid Array.

    Line 9: 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:
    return (Answer(CurrQues));
  • This script will make the Expressions answer to be the ID that was chosen.

Chapter 5 – “Continue”

Question 7 – Empty Question

  1. Please add the following Start Script:
    SetTextFormat(CurrQues,AnswerIter(4,Answer(6)).ToString());
  • This script would pipe the name of the chosen adult into the place holder ‘{0}’.

That’s it!

Download the Kish Grid Demo Survey:
Download Kish Grid Demo Survey

 

 

 

 

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.