Holt & Laury (2002)

Risk elicitation in experimental research often uses the method from Holt and Laury (2002), where incentives are used to elicit participants preferences. Below you will find a code example to implement this method within SoPHIE.

Simply copy the code into the Content tab and generate the input table.

Content Tab

<form action="<?php echo $this->url(); ?>" method="post">
<table class="table table-condensed" style="max-width: 800px;">
  <tr><th class="text-center">Option A</th><th class="text-center">Decision</th><th class="text-center">Option B</th></tr>
  
<?php if (!empty($message)): ?>
  <div class="alert alert-danger">
    <?= $message; ?>
  </div>
<?php endif; ?>
  
<?php
  $decisionCount = 10;
   for($riskResponse = 1; $riskResponse <= $decisionCount; $riskResponse++)
  {
     echo '<tr>';
     echo '<td class="text-center">';
        echo $riskResponse .'/' . $decisionCount . ' of $2.00, ' . (10 - $riskResponse) . '/' . $decisionCount . ' of $1.60';
     echo '</td>';
     echo '<td class="text-center">';
       echo '<label for="A' . $riskResponse . '">Option A </label>';
       $decisionValue = 0;
       echo ' <input type="radio" id="A' . $riskResponse . '" name= "decisionValue[' . $riskResponse . ']" value="' . 'a' . '"';
       if ($variableApi->getPE('riskDecision' . $riskResponse) == 'a')
       {
         echo ' checked="checked"';
       }
       echo '>';
       echo ' ';
       echo '<input id="B' . $riskResponse . '" type="radio" name="decisionValue[' . $riskResponse . ']" value="' . 'b' . '"';
       if ($variableApi->getPE('riskDecision' . $riskResponse) == 'b')
       {
         echo ' checked="checked"';
       }
       echo '>';
       echo '<label for="B' . $riskResponse . '">&nbsp;Option B</label>';
     echo '</td>';
     echo '<td class="text-center">';
        echo $riskResponse .'/' . $decisionCount . ' of $3.85, ' . (10 - $riskResponse) . '/' . $decisionCount . ' of $0.10';
     echo '</td>';
     echo '</tr>'; 
  }

?>  
</table>

  <input class="btn btn-default" type="submit" value="Continue" />
  
  <input type="hidden" name="contextChecksum" value="<?php echo $context->getChecksum(); ?>" />
</form>

By copying the code below into the Process tab, you will get multiple functionalities. Inputs will be saved, even if participants fail to enter an input for all of the 10 decisions, they will be displayed an error message and they will not have to enter their previous decisions again.

Process Tab

$decisionValue = $requestApi->getParam('decisionValue');
$view = $api->get('view');

if (!is_array($decisionValue))
{
  $decisionValue = array();
}
$noElements = count($decisionValue);
if ($noElements != 10)
{
    $view->set('message', 'Please make a decision for all of the given situations.');
    $proceed = false;
}

for ($i = 1; $i <= 10; $i++)
{
  if (empty($decisionValue[$i]) || ($decisionValue[$i] != 'a' && $decisionValue[$i] != 'b'))
  {
    $view->set('message', 'Please make a decision for all of the given situations.');
    $proceed = false;
  }
 $variableApi->setPE('riskDecision' . $i, $decisionValue[$i]);
}
return $proceed;

Result

When you finished the code implementation, you will get a result, that looks similar to the screenshot below. Your result table will contain the answers "a" or "b" for the variables riskDecision1 - riskDecision10 in the participant context.

Risk Elicitation - Holt & Laury (2002)