Sampling

How to design your sampling

The sampling defines in a visual language when an action will be performed. With this visual language several sampling blocks can be combined to design a sampling scheme that fits nearly every study.

You can drag the blocks from the left side to the white sampling document on the right side. You can rearrange the blocks by dragging them around. You can adjust the view of the sampling document by dragging the white background.

After placing the blocks you can configure them. You can do so by double-clicking the block or clicking on the edit pen in the right top corner of the block. In the appearing window you need to configure the block. As soon as you saved the block configuration the block shows its configuration in an abbreviated version. The "Form" block only shows the internal id of the form. With the root block Sampling Running you can configure the study like the pin code or the lockout mode.

The sampling blocks can be combined in a specific order (the grammar of the visual language). This order is represented through the colors of a traffic light (red, yellow, green).

  1. One or more red conditions. These conditions narrow down the range of the sampling.
  2. One yellow trigger. This trigger defines when the actions below start.
  3. One or more green actions. These actions execute as soon as the trigger applies.

As soon as you have placed some blocks in the sampling document you can connect them. Do this by dragging the handle on the bottom of the block to the top of the subsequent block. The handle of the block (square or circle) assures that you only place one trigger in each path.

You can save your sampling by pressing the save button in the top right corner.

The alarm block triggers the participant to e.g. fill out a form. In the default configuration the alarm reminds the participant over five minutes.

By changing the Sound/Vibration duration, the Display duration and the Number of alarms, you can configure how often and how long the participant will be reminded. You can also allow the participant to delay or dismiss the alarm if he is currently busy.

The random time trigger follows a stratified randomization instead of allowing random prompts at any possible time. It takes the set time frame and divides it equally to accommodate the number of required prompts. It’s within these smaller chunks that the random prompt appears, only governed by the minimum time between prompts.

For Example, you set the Start Time to 8:00 and the End Time to 20:00, the Number of Prompts to 6 and the Minimum Time Between Prompts to 0:30 (30 minutes). The random time trigger will now divide the 12 hour time frame between start time and end time into 6 chunks of 2 hours. So the 6 prompts appear randomly in the following time frames:

Note: If a prompt occurs near the end of its time frame, the next prompt actually falls in a smaller time frame due to the minimum time between prompts. E.g. in the example above, if the first prompt occurs at 09:50 and the minimum time between prompts is set to 0:30, the second prompt triggers sometime between 10:20 and 12:00.

Simple Scheme

Sampling every day between 08:00 and 20:00, 8 alarms with one form. If you have a SIM-Card and mobile data contract installed in your smartphone you can instantly upload the collected forms by adding an upload block. For simplicity we only added this block to this example.

Simple Scheme + Participant Can Start the Form

The same scheme as before, but now the participant starts a form himself by pressing the button Start form. An alarm is not necessary if the participant triggered the form himself.

Weekday/Weekend Sampling Scheme

In this scheme we added two weekday blocks and two fixed time blocks. From Monday to Friday, the random sampling is active. At the weekend only at the fixed time 14:00 and 18:00 o’clock an alarm comes up.

Different Forms at Different Days

If you want to have different forms to appear at different days of the study you can use the Sampling Day blocks. In the example below the first path is only executed at day one, the second path is executed at day two.

Different Forms at Different Times

If you want to have different forms to appear at different times you can have a different path (with an alarm block and a form block) for each time.

Mixed Scheme

Of course you can also mix all the examples above, but we recommend keeping it as simple as possible.

Different Start Dates for Each Participant

It is very common, that you run a study with multiple participants that start at different days. Please try to keep your sampling scheme as date independent as possible and try not to use the Date Range block. Instead just define a start and end date for each participant in the Participants tab of your study.

In the example below the sampling for the first participant starts at 2013-03-12 and ends at 2013-03-19 (both days included). The sampling for the second participant starts one day later but does not end until you stop it on the smartphone. The sampling for the third participant starts as soon as you start the sampling on the device and will only stop if you stop it on the smartphone.

Mutable Values (a.k.a. Variables)

With mutable values the sampling scheme can be even more flexible. It is very powerful, but can also introduce errors, if the sampling scheme is not correctly designed. This feature is currently in beta, please contact us, if you want to test this feature!

  1. Make sure you use the movisensXS Android app version 0.6.3412 or newer.
  2. Go into the preferences of your study (wrench icon), select movisensXS Library v3357 or newer and save the changes.
  3. Go into the sampling, there are now new sampling blocks available in the Advanced tab (Check Mutable Value and Change Mutable Value).
With these two blocks it is possible to activate/deactivate different parts of your sampling in dependency of previous actions.

The following example demonstrates on how to activate a random triggering only, if a participant filled out an "Out of bed" questionnaire.

The following example demonstrates on how to activate a random triggering only, if a participant is not asleep.

The following example demonstrates on how to show a button only, if the participant has not yet completed this form today.

The following example demonstrates on how to implement a Do not Disturb button, that the participant can use if he does not want any alarms in the next hour.

Study Running

This node is active if the study is running.

Label Description Type Default-Value
Enable Messaging Allow participant to write/receive messages to/from the study supervisor. Boolean true
Full Screen movisensXS runs in fullscreen during the study. Boolean false
Lock other Applications If you activate this other applications are not accessible for the participant. Boolean false
PIN code This pin code allows the supervisor to control the study. The pin code '0' enables accessing the study control without pin. Integer 2486

Advanced

Delay

This event delays the previous event for the specified time and then triggers the successor nodes.

Label Description Type Default-Value
Delay Time to delay the source signal in seconds Integer 10

Forms

Alarm

This notifies the participant about a task he has to perform e.g. fill out a form.

Label Description Type Default-Value
Title Title text of the alarm. String Alarm
Sound/Vibration duration How long the sound and vibration lasts per alarm in seconds. Integer 10
Display duration How long one alarm will be shown after sound and vibration in seconds. Integer 50
Number of alarms How often a alarm shows. Integer 5
Maximum delay time How long the participant can delay the alarm in minutes (0=disabled). Integer 20
Dismissable The participant can dismiss the alarm. Boolean true

Form

This action runs the specified form. Place an alarm before to notifiy the participant about the form!

More information about randomization and page indicators can be found here

Label Description Type Default-Value
Form ID Id of the form to run String
Timeout Interval After how many seconds of inactivity a timeout warning will be shown. (0 = disable) Integer 60
Timeout Length Length of the timeout alarm in seconds. Integer 20
Display back button Allows the user to go back to the previous question. Boolean true
Show Page Indicator Shows a small page indicator at the top of the form. Boolean true
Screen orientation Locks the screen orientation [Free, Portrait, Landscape]. String Free

Upload Results

This action uploads the collected results to the server.

Label Description Type Default-Value
Automatic upload retry Retry upload automatically if no internet connection was available. Options [None, Wlan, Any] String Wlan

Study

Button pressed

This event fires if the participant presses a presented button and triggers the successor nodes. A.k.a. Event-contingent.

Label Description Type Default-Value
Button label Label of the button that is shown in the home screen String Start form
Button order The order of the buttons on the home screen. The higher the order/weight, the deeper it sinks. Integer 1
One time button If you activate this the button is only once clickable. Boolean false

Time

Date Range

This condition is true if the current date is in the selected range. Start and end date is included.

Label Description Type Default-Value
Start date Start date of the condition. Dates must be formatted as yyyy-MM-dd Date
End date End date of the condition. Dates must be formatted as yyyy-MM-dd Date

Fixed Time

This event fires if the specified time is reached and triggers the successor nodes. A.k.a. Interval-contingent.

Label Description Type Default-Value
Time Time in the format HH:mm Date 14:00

Immediately

This event fires as soon as the previous node is true.

Initial

This event fires only once after the previous node is true.

Random Time

This event fires randomly a specified number of prompts in the specified time period and triggers the successor nodes. A.k.a. Signal-contingent.

Label Description Type Default-Value
Start Time Time in the format HH:mm Date 08:00
End Time Time in the format HH:mm Date 20:00
Number of Prompts Number of Prompts between start and end time Integer 8
Minimum Time Between Prompts Time in the format HH:mm Date 00:30

Repeated

This trigger fires in the configured interval as long as the previous condition stays true.

Label Description Type Default-Value
Repeat interval Interval to trigger in seconds. 3600 = 1 hour. Integer 3600

Sampling Day

This condition is true if the sampling day is in the defined range (Sampling day starts with day 1 and increments at midnight if sampling is running).

Label Description Type Default-Value
Start day Start day as number Integer 1
End day End day as number Integer 2

Time Range

This condition is true if the current time is between the specified time range.

Label Description Type Default-Value
Start Time Time in the format HH:mm Date 08:00
End Time Time in the format HH:mm Date 20:00

Weekday

This condition is true if the enabled weekday is reached.

Label Description Type Default-Value
Weekdays Comma-seperated list of enabled weekdays. [Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday] String Monday, Tuesday