Overview
This article explains how to create a uniform distribution in Random-Trigger using user-defined variables, Recoding-Trigger, and the Modulo function. It provides an alternative solution to overcome the limitations of using a Random-Trigger with infinite participants.
Information
The article focuses on implementing a uniform distribution for random triggering in surveys, particularly when dealing with a large number of participants. It introduces the concept of Modulo and explains how to use it with user-defined variables and Recoding-Trigger to achieve the desired result.
Understanding the Problem
When using a Random-Trigger with a uniform distribution and infinite participants, the query for the trigger becomes very complex. This complexity leads to several issues:
- The installation process becomes very slow
- Participants may be rejected from the survey
- The trigger takes an excessive amount of time to load
To address these problems, an alternative approach using user-defined variables, Recoding-Trigger, and the Modulo function is recommended.
Introduction to Modulo
Modulo (mod) is a mathematical function that returns the remainder when dividing two integers. For example:
- 10 mod 3 = 1 (10 divided by 3 equals 3 with a remainder of 1)
- 14 mod 5 = 4 (14 divided by 5 equals 2 with a remainder of 4)
- 16 mod 3 = 1 (16 divided by 3 equals 5 with a remainder of 1)
Implementing Uniform Distribution
To implement a uniform distribution for random triggering, follow these steps:
Solution:
Recoding-Trigger with LFDN and Mod
What is lfdn?
Every participant has a unique lfdn (participants consequente number). If you use this number with mod you create also a random trigger with a uniform distribtution.
Setup uniform distribution for numbers 1-5
-
Setup User-defined-variables (Project properties -> user-defined-variables -> Number of user-defined-variables: 1)
-
Jump to the page where you wanna setup your random uniform distribution
-
Create Recoding Trigger (Suvey-Menu -> Questionnaire-Editor -> Page-> Trigger -> Recoding-Trigger)
Settings of the Trigger:
Detail configuration:
Variable to be recoded: c_000x
Value: MOD(#lfdn# , 5 ) + 1
For 6 Random-numbers use 6 instead of 5..
If you wanna see the values of the lfdn and c_000x (user-defined-variable) use the following code in the questionnaire text or where you want
FAQ
What is lfdn?
lfdn stands for "laufende Feldnummer" in German, which translates to "consecutive field number" in English. Every participant has a unique lfdn, which is essentially a participant's consecutive number. By using this number with the Modulo function, you can create a random trigger with a uniform distribution.
Why is this method better than using a Random-Trigger with infinite participants?
This method using Modulo and Recoding-Trigger is more efficient because it avoids the complexity of running through all participants, which can cause slow installation, participant rejection, and long loading times for the trigger. It provides a simpler and faster way to achieve a uniform distribution for random triggering.
Comments
0 comments
Article is closed for comments.