Create test data with AutoAnswer

Do you need to create some test metadata and data that you can play with. If you do then check this article out. In it we will show you how to use the AutoAnswer system that comes with Author and Author Professional Data Collection tools.

 The first thing we need to do is to make a survey, so we have taken some code from the ddl ( short_drinks ) and are going to use that. so make a new file and past the code into the new file.

Metadata(en-US, Question, Label)
title "Short Drinks Survey"
    info;
   intro "Hello, I am from ABC Research and I would like to ask you a
          few questions about your drinking
habits."
    info;
    gender "Gender of respondent"
    categorical [1..1]
    {
        MALE "Male",
        FEMALE "Female"
    };
    age "How old were you on your last birthday?"
    long [0 .. 99];
    occup "What is the occupation of the chief income earner in your household?"
    text;
   hhsize "How many people (including yourself) live in your home?"
    categorical [1..1]
    {
        HH_1 "1 person",
        HH_2 "2 people",
        HH_3 "3 people",
        HH_4 "4 people",
        HH_5 "5 people",
        HH_6 "6 or more people",
        NA "Not answered"
    };
    childhhz "How many children of the following ages live with you?"
    loop
    {
        YEARS_0_5 "0-5 years",
        YEARS_6_10 "6-10 years",
        YEARS_11_15 "11-15 years"
    } fields -
    (
        questi1 ""
        categorical [1..1]
        {
            CHILDH_0 "None",
            CHILDH_1 "1",
            CHILDH_2 "2",
            CHILDH_3 "3",
            CHILDH_4 "4",
            CHILDH_5 "5 or more"
        };
    ) column expand grid;
    income "What is your approximate family income?"
    long [1 .. 999999];
   numdrksz "Can you tell me how many of the following drinks you consumed each day last week? (WRITE IN THE
NUMBER OF DRINKS CONSUMED EACH DAY.)"
    loop
    {
        TEA "Tea",
        COFFEE "Coffee",
        CSD "Carbonated soft drinks",
        MILK "Milk",
        FRUIT "Fruit and vegetable drinks",
        PSD "Powdered soft drinks",
        WATER "Water"
    } fields -
    (
        mond "Monday"
        long [0 .. 10];
       tuesd "Tuesday"
        long [0 .. 10];
      wednsd "Wednesday"
        long [0 .. 10];
       thursd "Thursday"
        long [0 .. 10];
       frid "Friday"
        long [0 .. 10];
   ) column expand grid;
    frequenz "How often do you drink the following kinds of tea?"
    loop
    {
        BLACK "Black",
        GREEN "Green",
        HERBAL "Herbal",
        CHINA "China"
    } fields -
    (
        questi2 " "
        categorical [1..1]
        {
            ONEPRDAY "Once a day or more",
            TWOTOTHREEPRWEEK "2-3 times a week",
            ONEPRWEEK "About once a week",
            ONEPRMONTH "About once a month",
            LESS "Less often",
            NA "Not answered"
        };
  ) column expand grid;
   close "Thank respondent and close"
    info;
End Metadata

Our routing is simple , we just ask all the questions.

Routing(Web)
     title.Show()
     intro.Show()
     gender.Ask()
     age.Ask()
     occup.Ask()
     hhsize.Ask()
     childhhz.Ask()
     income.Ask()
     numdrksz.Ask()
     frequenz.Ask()
    close.Show()
 End Routing

 ok , so we have an MDD, next we need to get some data, to do this , we should first check that we can get to the end of our survey the normal way. If we can then we are ready to go, if not then you need to fix up any issues you may have.  Next we need to ( in Author Professional ) click tools and then write to database, what you should end up with is this

Write to Database
Write to Database

Once we have the tick next to write to database we then need to start the AutoAnswer program, to do this ( in Author Professional ) , click tools and then “Auto answer Data Generation” when you have done this you will end up with the following screen.

Start Auto Answer
Start Auto Answer

The first thing we want to do is to set the first number to 100. What this means is that the Auto Answer system will attempt to run 100 interviews, the second  number we can leave at 10 , this means that the system will attempt to answer a question 10 times and if it cannot succeed in getting past it on the tenth time it will give up. You will also see a check box to tick, we will leave this unchecked but if you check it and you have hints , or custom properties in you metadata that help auto answer get passed the complicated sections of your file, then it will use them. You can add hints easily in Author , by going to the advanced properties of the question. Anyway, we don’t need hints , as our survey is simple we can move on by clicking start. When we have done this we will see the following screen

Data Link Properties
Data Link Properties

 This is the standard Data Link Properties screen that we have seen many times before, this time when we use it we will be setting it up for an SPSS Data Collection File.

Data Collection File
Data Collection File

When we are happy with the settings we can click on OK and we will then start to see the generator run through the survey. In Author professional we should see the following screens. If you don’t you may need to play around with the views a little.

GO
GO

 As the survey completes you will see that at least all the questions will have a number against them, if you start see a question that remains at 0 then this means that there may be something wrong with your survey and it would seem that you have a question in your survey that was not asked at all in 100 surveys. Also in some cases you may see that you have a question that has more than 100 against it, this means that the generator tried to answer the question and perhaps failed to produce an answer that fitted in the desired range.

 if you now take a look in the directory where you specified the data to sit you should see that you have a ddf file as well as an mdd file now. You should note that at present if you mess up the data link properties screen  it is not possible to go back and fix it up. What we have to do is to open up the file in mdmExplorer  and delete the datacollection datasource , save the mdd file and then start again.

3 thoughts on “Create test data with AutoAnswer”

  1. Thanks for the comment W.

    Thats a great idea , we will start on a article right away. You should see something in a couple of days, if you would like something quicker then please feel free to drop us an email.

Leave a Comment

%d bloggers like this: