Scroll

Edit Routings

Follow
Summary This article explains the idea of edits routings which is essentially using logic to reshape or recode data after it has been collected.
Applies to askiadesign
Written for Scripters and Data Processors
Keywords Routing; logic; Conditions; Script; Design; Edits; Recode; Clear; Tidy

What are edits routings? You might know these by another name: Cleaning scripts, recode logic. The idea is simple. Once you have collected data, you can change this data or use it to create new data using logical conditions.

Example 1

Download test files here.

Imagine we have a multi-coded question which forces respondents to pick 5 candidates in order. However, after we have collected the data we realise that one of the candidates in the code-list is ineligible. We’d like to remove the responses given for this candidate and also trim all respondents’ answers so they have chosen only 3 candidates.

We open our original .qes file (ex1_BEFORE.qes) and write the routing logic in the normal way. The only difference is that we must check the ‘Edits’ option for the routing to be available in the edits routing menu in Askia Tools.

 

  • ??Candidate??-5 : removes the votes given to the 5th candidate (the ineligible one) from respondent’s answers.
  • ??Candidate??-??Candidate??[4] : removes the votes given to the 4th selected candidate from respondent’s answers.

Now we save the file and open it up in Askia Tools. Run the edits as follows:

You’ll note there are two other options:

  • On all interviews – This option runs all the edits in the .qes file together. There is no option to select a sub-set of edits to run. It takes slightly longer.
  • On N first interviews – This option runs all the edits in the .qes file together. However it gives you the option to run them on the firs N records found in your file i.e. records 1 – 10 or 1 – 50 but not records 33 – 78 for instance. There are other was to achieve this e.g. find/set a marker for these records using edits or existing logic and incorporate this into your final edits condition.

Now once we have run the edits we are left with ex1_AFTER.qes. Let’s compare the difference in the data:

 

Example 2

Download test files here.

Here we have two multi-coded variables: q12f1conv & q12f2conv then a loop with two iterations after this called: q12eLoop. Each q12f relates to one iteration of the loop. In order to tidy things up we

  • Need to edit these two questions into the loop which has two iterations.
  • Furthermore, the original code-frames have unnecessary dummy codes (codes 6 to 96). In our final q12f, we want these dummy codes to be removed so we have a much more concise code-frame.

You can see what I’m referring to in the example .qes files: ex2_BEFORE.qes and ex2_AFTER.qes

In ex2_AFTER.qes, the edits have been run:

You can run some spot checks to see that the data from the original code-frames have been put in the correct positions in the new code-frame for q12f. You can now remove q12f1conv & q12f2conv to leave a more concise .qes file than we began with. 

Brief note on clearing / cleaning data:

Download test files here.

You can use edits routings to remove data from questions as well. For example, below you can see the values you would set for the different question types and the result on the data.

 

Have more questions? Submit a request

Comments

  • Avatar
    Steven De Backer

    Are the before-after screenshots from AskiaAnalyse?
    How are they made? this is the first time I see raw data in Analyse. Would be handy.

  • Avatar
    Seyf Altindal

    Hi Steven,

    Yes from Analyse. Highlight variable(s) > View menu > Data

    Kind regards

    Seyf