What is a Formula variable?
Put your algebra skills to the test! A Formula variable is a custom variable type that allows you to carry out calculations on other variables. Put your algebra skills to the test! With the Formula variable, you can
...
- Navigate to Manage Study --> Variables
- Click '+ New Variable'.
- Give the variable a friendly name.
- Tip! Choose something that you will remember when you are building the variable into target modifications or participant messaging and incidents.
- Tip! Choose something that you will remember when you are building the variable into target modifications or participant messaging and incidents.
- Select the arm. If the formula variable is calculating based on other arm-specific variables, you must select that arm. Otherwise the variable will not be available to use for the formula calculation.
- Next select the variable type. For this example, we want to select Formula.
- Once you select Formula, the formula field will display. You can use the following operators, +, -, *, or / create equations using any of the following supported characters. The formula variable supports order of operations!
- Supported characters:
- addition: +
- subtraction/negation: -
- division: /
- multiplication: *
- parentheses: ( )
- powers: ^ (e.g., 2^3)
- Supported characters:
- To create your formula, copy the variables exactly as listed and add any operators.
- Adjust rounding criteria, if needed.
- Click 'Save Variable'
- Your new variable will be listed on the Variables overview page.
...
- Navigate to Study Arms under Manage Study. Click 'Manage Event Schedule'. For arm specific Formula variables, remember to select the arm for which the new variable was created.
- Either create a new event or edit an existing event and then click into the event logic screen.
- Imagine the same scenario as above: I have told the participant that their new goal is going to be 10% higher this week. Now I have to set their new target to increase to be 10% higher.
- In the 'Then' criteria, under 'Select Action' choose, 'modify the participant's target'.
- Next select 'Set' and choose the target. This will display all targets configured for this arm. In this scenario, we want to select the Fitbit steps target.
- Then select what to set the target to. Here we want to set the target to a Variable.
- Once you select 'Variable', all arm specific and study wide variables will display. Choose {{ @target x 10% }}
- Note! You could also set up the modify target via a calculation. However, the benefit of using the variable is that it can be included in messaging.
- Click 'Save logic'.
Creating ramp-up periods from baseline value to target value:
See Target Value Variable for step by step instructions!
Allowing participants to choose their own goal:
See Enrollment Run-In Variable for step by step instructions!