Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

ACBC - Customize summed price attribute


In a question prior to the ACBC exercise (Q3), we ask respondents how many devices they have (say, "X").

Then, in the ACBC exercise, I would like the respondent to see a total price, which is this variable X times the price (per device) as defined in the ACBC exercise setup. However, the analysis and utility estimation should only depend on the original price per device.
So, if I define for instance a price range of €70 - €130, some people will see prices between €700 and €1300 (X=10), while others could see prices between €70,000 and €130,000 (X=100).

What would be the best way to accomplish this? If I just define the base price of the summed pricing attribute as [% Q3 * 100], the analysis will depend on Q3, which I don't want. Maybe I could add a dummy variable for each concept showing Q3*<price of that concept>, but I have no idea how this would work.

Moreover, I would like to use multiple currencies in the same exercise. I'm assuming if I can make the part above work, this could work as well by defining an exchange rate Y and then showing Q3*Y*<price of that concept> to the respondent (while ignoring both Y and Q3 in the analysis and utility estimation - except for using it as segmentation variables.

Thanks for any pointers in the right direction!
asked Aug 28, 2018 by Bart (150 points)
If you want respondents to see the total price while analysis sees the price per device, it sounds like your best option would be to keep the normal summed price settings in Lighthouse and to just use JavaScript to replace the prices shown to the respondents with the total price.  Now respondents would never see the price per device.  Is this what you have in mind?
Hi Zachary,

Thanks for the info - indeed this seems like the right approach. Meanwhile we decided to just show prices per device, so we only need the currency stuff. Could you point me in the right direction for the javascript in terms of syntax and how/where to include it - I have limited experience using javascript in Sawtooth?

In pseudocode I would need something like this (FX being the variable where the respondent currency type, i.e. USD, EUR, ..., is stored)

If FX = 1 show <concept price> (in default currency, being USD)
If FX = 2 show <concept price>*<exchangeRate1>
If FX = 3 show <concept price>*<exchangeRate2>

I assume I can just complete the 'pricing' tab of the ACBC exercise settings for USD, and just to add the javascript on the screener / tournament pages?

Final remark: currently original prices are rounded to the nearest 5; doing the above would mean that prices in other currencies are not rounded. I guess that could be solved by not rounding in the 'pricing' tab but doing it in the javascript for all currencies (incl default)? It would be nice that would be possible :)

Thanks for your help.
I'm not a conjoint expert, but I would definitely think you'd want to keep the actual ACBC pricing settings in a single currency.  Otherwise, you'll have some tricky hoops to jump through come the analysis stage - the Choice Simulator won't know that the "100" an American respondent saw represents a different value than the "100" a European respondent saw.  By doing it in JavaScript, the simulator thinks everyone saw the same currency - it's only the respondents who know they saw something else.

It's certainly possible to do the rounding in the JavaScript, even necessary if you don't want to show decimal points that don't make sense (e.g., "$5.1234").  I don't think you'd want the rounding to be too crazy, though.  If the ACBC thinks it showed a respondent $100, the rounding during conversion needs to stay close enough to equivalent to $100 so that the simulator isn't comparing apples-to-oranges.
I'm not sure I understand correctly. Indeed I want all prices in the ACBC to be in one currency (USD), but the respondents to 'see' the corresponding value in their currency.

So if the ACBC generates $100, I want a European to see €86, but the system to still simply store $100 for the analysis, which I was assuming would be possible with javascript (but no idea how to start on it, so any pointers on this are much appreciated).

Point taken on the rounding. When rounding to e.g. the nearest 5, if the system generates $102, the American will see $100 and the European €90, which is actually almost $105.  I'll take this into account.
JavaScript is definitely the way to go.  I can help, but we should clear up some questions first because there's a lot of ACBC settings that could change the exact JavaScript required.

Will the price always show up on the same row number in your questions (settings like merged rows could change the row number)?  If not, are attribute labels being show to respondents?

Are you including price in your Unacceptables?

Does your ACBC include calibration questions?
The row number of price varies due to merged rows and the fact that the number of attributes taken into the ACBC exercise can vary based on answers in previous questions.
We do show attribute levels.

We don't include price in unacceptables.

No calibration questions.

Thanks so much for your support in this.

1 Answer

0 votes
Best answer
Start by adding this to your price attribute's label:

<input type="hidden" id="acbcPriceAttribute"/>

Then add this code to your screener and choice questions:

    var priceTr = $('#acbcPriceAttribute').closest('tr').index() + 1;
    $('#[% QuestionName() %]_div .inner_table > tbody > tr:nth-child(' + priceTr + ') > td:not(:first-child) .level_text').each(function(){
        var price = $(this).text();
        price = Number(price.replace(/[^0-9\.]/g, ''));
        switch (1) { // to be replaced with value from Sawtooth Script
            case 1:
                price *= 1.3;
            case 2:
                price *= .6;
            case 3:
                price *= 30;
        price = Math.round(price / 5) * 5; // round to nearest 5
        switch (1) { // to be replaced with value from Sawtooth Script
            case 1:
                price = '£' + price;
            case 2:
                price = price + '€';
            case 3:
                price = price + '¥';

Note the two "switch."  You can replace that 1 with your relevant Sawtooth Script, as well as updating the multiplication factors and currency symbols here.
answered Sep 7, 2018 by Zachary Platinum Sawtooth Software, Inc. (147,925 points)
selected Sep 10, 2018 by Bart
Thank you so much for this Zachary, worked like a charm!
ACBC - Customize summed price attribute - BYO