Snap has the capability to analyse times of the day using the 24 hour clock. If a questionnaire contains a start time and end time question, Snap can calculate the time difference between the two answers. The time difference can be expressed in minutes and further analysed in categories of a derived variable. The following worksheet explains how to set up the Start Time and End Time questions, and also how to set up two variables that will calculate and present this information in a comprehensive format.

The following worksheet refers to these example questions as displayed below.

Q1. Start Time 14.17
Q2. End Time 16.05
Difference in Time 108 Minutes

Note: Time is analysed in minutes. There are 60 minutes in each hour and 1440 minutes in 24 hours: 60 (minutes in an hour) X 24 (hours in a day)

Creating a Start Time Variable and an End Time Variable

Step By Step

Step 1

Enter two open ended, quantity response questions, one for a start time and one for an end time. These can be set up in the Questionnaire window or as variables in the Variables window.

Step 2

Click on the Properties button in the Questionnaire window and set each question to 2 decimal places. Ensure the decimals are set to 2 otherwise Snap will not include seconds when calculating the Start Time, End Time or the difference between them.

Designing a Quantity Variable to Calculate the Differences in Time

A Variable needs to be set up in order for Snap to calculate the interval between the Start and End time. This variable needs to be set up as a Derived, Quantity-Response Variable. That is, a new variable deriving (taking information) from other variables.

Step 1

From the Variables window click on to create a new variable.

Step 2

Ensure the following settings are applied:

Name: V1
Label: Time difference
Type: Derived
Response: Quantity

Step 3

In the Values column in the same row as Not Ask type:

Q1 missing or Q2 missing

This will ensure that Snap will not perform the calculation shown in step 4 if Q1 or Q2 are empty.

Step 4

Type the formula below in the values column but this time in the same row as Valid:

((Q2\1)*60 + (Q2-Q2\1)*100) – ((Q1\1)*60 + (Q1-Q1\1)*100) + (1440 * num(Q2<Q1))

The formula is divided into 3 sections. The first section converts the answers to Q2 into minutes, the second section converts Q1 into minutes. The last section is only needed if times could span midnight – it adds 1440 minutes if Q2 has an answer after midnight and Q1 has an answer before midnight.

Note: This worksheet is using the example of Q1 being the Start Time variable and Q2 as the End Time variable. If in your questionnaire the Start Time variable is Q4 and your End time variable is Q5 you would need to amend the question numbering in response to this e.g. Q4 missing or Q5 missing would be inserted in the Value column opposite Not Asked.

Creating a Derived Variable to Display Time Categories

Another Variable needs to be set in order to display the results in time categories.

Step 1

From the Variables Window click on the to create a new Variable.

Step 2

Ensure the following settings are applied:

Name: V2
Label: Time Categories
Text: Duration between Start and End Time
Type: Derived
Response: Single

Step 3

Click in the label column of the code 1 row and type 0 – 15 minutes. Click in the Value column in the next column and type V1<=15. Add the following code information to create the categories and values:

Label Value
16 – 30 minutes V1<=30
31 minutes – 1 hour V1<=60
1 – 2 hours V1<=120
3 hours and above V1 ok

Step 4

Click on the Count Responses button to calculate the responses. The Counts column in the variable will display the results. Click on the Save button and use the variable to create a table or chart of the results. Type V1 in the analysis box of your table or chart to generate the results.

If there is a topic you would like a worksheet on, email to snapideas@snapsurveys.com