The mEMA System allows you to use scores on a specific item from a baseline survey as the basis for triggering the appearance of survey elements (Forms, Sections, Questions/Messages) in another survey scheduled after the end of the baseline period. This allows you to automatically trigger intervention content or questions when the system detects a departure from the mean score set during the baseline period. 


For example, if you are interested in the change in "Loneliness" you can run a baseline survey for a number of days that includes a Loneliness question. Then when you are running your study/intervention period survey can include a question on Loneliness. If the User enters a response above (or below) the average Loneliness score captured during their baseline, then you can trigger a new branch in the survey. 


The key to connecting the items across surveys is using the same Analytics Code to tie the construct (e.g. Loneliness) together across two different surveys. 


For example, if the item being monitored is Loneliness then the question in the baseline survey that measures Loneliness should have the same Analytics Code as the question in the intervention / study phase that assesses Loneliness. 


Here are instructions on triggering a selection of intervention messages based on a user reporting a Loneliness score above the mean calculated from their baseline scores. 


1. Define the Baseline item


Create a question in the baseline survey that assesses the construct in which you wish to detect change. 

Check the box "Is Baseline Code" and take note of the Analytics Code (in this example, LONELINESS)


This tells the system that scores from this question are to be averaged to calculate the baseline score for Loneliness 


2. Define the Survey Element that Measures Deviation from the Baseline Score


Create a Question in the survey to be used post-baseline that will measure the same construct throughout the next phase of the study. 


Use the same Analytics Code as the question from the Baseline survey


3. Define the Element Dependent on Deviation from the Baseline Score


Create a Question, Section or Form in the second survey that you want to be delivered if the User's response to the above question is above or below their mean baseline score on the construct you are measuring. 


Check the box "Depends on Baseline" 


This opens up the new field "Baseline Dependencies" 


Dependencies are defined by comparing the value of questions, sections or forms in the current survey with those collected in the baseline survey. 

  • Applicable throughout Survey timeline:
  1. Average: avg(‘ANALYTICS_CODE’) 
  2. Maximum: max(‘ANALYTICS_CODE’)
  3. Minimum: min(‘ANALYTICS_CODE’)
  4. Average of the last N values collected: lst(‘ANALYTICS_CODE’, N)
  5. Average of the first N values collected: fst(‘ANALYTICS_CODE’, N)
  • Applicable within a certain period of time:
    1. Average within a time window: avg_window(‘ANALYTICS_CODE’, ‘time unit’, t)
    2. Maximum within a time window: max_window(‘ANALYTICS_CODE’, ‘time unit’, t)
    3. Minimum within a time window: min_window(‘ANALYTICS_CODE’, ‘time unit’, t)
    4. Average of the last N values collected within a time window: lst_window(‘ANALYTICS_CODE’, N, ‘time unit’, t)
    5. Average of the first N values collected within a time window: fst_window(‘ANALYTICS_CODE’, N, ‘time unit’, t)
    6. Time units (‘time unit’) must follow the following semantic rule:
      • For minutes: ‘minutes’
      • For hours: ‘hours’
      • For days: ‘days’
      • For month: ‘months’
    7. t is the number of time units >=1
  • Based on the time of the day: global(‘time unit’)
    1. Time units (‘time unit’) must follow the following rule:
      • For minutes: ‘minute’
      • For hours: ‘hour’

Baseline Dependency Comparisons that mEMA App currently supports are:

  • Equal: eql
  • Less than: lt
  • Greater than: gt
  • Less than or Equal to: lte
  • Greater than or Equal to: gte

 

Baseline Dependencies can be a single type of calculation, or a multiple type of calculation using the following comparisons: “and” or “or”. E.g. max(‘ANALYTICS_CODE’) eql 5 or max(‘ANALYTICS_CODE’) gte 5

 

 

Question Types that can currently use baseline dependencies are:

  • Single Selection
  • Dropdown
  • Discreet Sliders




The code in the Baseline Dependencies field in the above example is saying:


When the score for the question in this survey with the ID# 4194029 (which is the one we identified in step 2 above) 

is greater than the average score for LONELINESS (which has been identified as a Baseline Code),

then show this Section #4194172.


Using Baseline Dependency to trigger questions – named Cross Survey Dependency Piping


 

Baseline dependencies across surveys works similar to baseline inside the same survey, but instead of using the question ID, you have to use the Analytics code of that question.

 

Example:

  • You have Survey A with a question that uses analytics code “QUESTION_1”, and the question is marked as “Is Baseline Code” 
  • In Survey B you select the question that you want to use the baseline from Survey A, and click “Depends on Baseline Code” checkbox
  • Inside the Baseline Dependencies field, you add the dependency functions but instead of putting the Question ID first, you write the type of calculation with the Analytics code inside (e.g. max(‘TIME’) gt 3 )
    1. Additionally if you want the baseline calculation to be for a period of time of 8h for example because the first survey is scheduled in the morning and the 2nd one is scheduled for the evening, and you don’t want the answer from today to be used as a baseline on the next days, you can used one of the time window calculation types mentioned later in this document
  • After  the participant takes survey A and responses to the question that uses “QUESTION_1” analytics code with an answer that has a value higher then 3, when the participant will start Survey B they will be presented with the question that fulfills the baseline condition

Example:

Graphical user interface, application

Description automatically generated

 

 

Examples of how to write a dependency code across surveys

 

Survey A contains a question that asks the participant how much time they intend to spend on the phone during the day. The analytics code for the Survey is TIME_SPENT_ON_PHONE, and has “Is Baseline” checkbox selected.

Survey answers and values are:

  • Answer 1: Value 1 and text is “1 hour”
  • Answer 2: Value 2 and text is “2 hours”
  • Answer 3: Value 3 and text is “3-6 hours”
  • Answer 4: Value 4 and text is “6+ hours”

 

Survey B contains questions:

  1. Did you manage to spend only 1 hour on the Phone?
  2. Did you manage to spend only 2 hours on the Phone?
  3. You spent 3-6 hours on phone today, do you want to try an exercise to spend less?
  4. You spent more then 6 hour on phone today, do you want to try an exercise to spend less?

 

 

 

Dependency examples:

  • Using max: max(‘TIME_SPENT_ON_PHONE’) gt 3 -> Triggers question 4 from Survey B if the max value of the responses from Survey A is grater then 3
  • Using avg: avg(‘TIME_SPENT_ON_PHONE’) eql 2 -> Triggers question 2 from Survey B, only if the average responses from participant is 2
  • Using min:  min(‘TIME_SPENT_ON_PHONE’) lt 2 -> Triggers question 1 from Survey B if the min value of the responses from Survey A is less then 2
  • Using average of last N responses: lst(‘TIME_SPENT_ON_PHONE’,2) eql 2 -> Triggers question 2 from Survey B, based on the last 2 times that the participant responded to Survey A, only if the average value of the responses equals to 2
  • Using average of the first N responses: fst(‘TIME_SPENT_ON_PHONE’,2) eql 2 -> Triggers question 2 from Survey B, based on the first 2 times that the participant responded to Survey A, only if the average value of the responses equals to 2
  • Using average within a time window: avg_window(‘TIME_SPENT_ON_PHONE’, ‘hours’, 8) lte 1 -> Triggers question 1 from survey B, based on the participant responses from the last 8 hours, and only if the average value of the response is 1 or less
  • Using max withing a time window: max_window(‘TIME_SPENT_ON_PHONE’, ‘days’, 1) gte 4 -> Triggers question 4 from Survey B, if the max value of responses from Survey A is greater or equal to 4, based only on responses from 1 day since Survey A was taken
  • Using min within a time window: min_window(‘TIME_SPENT_ON_PHONE’, ‘months’, 1) eql 2 -> Triggers question 2 from Survey B, based only on responses from last month since Survey A was taken, if the minim value of responses equals to 2
  • Using average of last N responses from a time window: lst_window(‘TIME_SPENT_ON_PHONE’,2, ‘minutes’, 100) lt 2 -> Triggers question 1 from Survey B, based only on responses from the last 100 minutes since Survey A was taken, only if the average value of the last 2 responses from Survey A is less then 2Using average of the first N responses from a time window: fst_window(‘TIME_SPENT_ON_PHONE’, 2, ‘hours’, 6) eql 3 -> Triggers question 3