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:
- Average: avg(‘ANALYTICS_CODE’)
- Maximum: max(‘ANALYTICS_CODE’)
- Minimum: min(‘ANALYTICS_CODE’)
- Average of the last N values collected: lst(‘ANALYTICS_CODE’, N)
- Average of the first N values collected: fst(‘ANALYTICS_CODE’, N)
- Count the number of how many times question was presented: cnt('ANALYTICS_CODE')
- Sum of the values: cum('ANALYTICS_CODE')
- Applicable within a certain period of time:
- Average within a time window: avg_window(‘ANALYTICS_CODE’, ‘time unit’, t)
- Maximum within a time window: max_window(‘ANALYTICS_CODE’, ‘time unit’, t)
- Minimum within a time window: min_window(‘ANALYTICS_CODE’, ‘time unit’, t)
- Average of the last N values collected within a time window: lst_window(‘ANALYTICS_CODE’, N, ‘time unit’, t)
- Average of the first N values collected within a time window: fst_window(‘ANALYTICS_CODE’, N, ‘time unit’, t)
- Count the number of times the question was displayed within a time window: cnt_window('ANALYTICS_CODE',N,'time unit',t)
- Sum of the recorded values within a time window: cum_window('ANALYTICS_CODE',N,'time unit',t)
- Time units (‘time unit’) must follow the following semantic rule:
- For minutes: ‘minutes’
- For hours: ‘hours’
- For days: ‘days’
- For month: ‘months’
- t is the number of time units >=1
- Based on the time of the day: global(‘time unit’)
- Time units (‘time unit’) must follow the following rule:
- For minutes: ‘minute’
- For hours: ‘hour’
- For days: 'day'
- For months: 'month'
- For years: 'year'
- Time units (‘time unit’) must follow the following rule:
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 )
- 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:
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:
- Did you manage to spend only 1 hour on the Phone?
- Did you manage to spend only 2 hours on the Phone?
- You spent 3-6 hours on phone today, do you want to try an exercise to spend less?
- You spent more then 6 hour on phone today, do you want to try an exercise to spend less?
- Do you want to contact someone for an outdoors activity?
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
- Using the count function, you can decide if either to display a survey or not. For example if we would like to see question 5 from survey be the baseline dependency using cnt() function would look something like this: cnt('TIME_SPENT_ON_PHONE') eql 5 -> this will trigger the 5th question in Survey B if the question from Survey A was seen 5 times
- Using the cumulative function, you can decide if you want to display a question based on the cumulative values from the responses on a previous question. Following the example above here's how you could show Question 4 from survey B, if the participant responded with answers that together reaches an amount grater then 6 in the first survey the last 6 hours: cum_window('TIME_SPENT_ON_PHONE','hours',6) gt 6