Have an idea?

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

Piecewise linear price function - How is it coded in the design matrix?

Hi experts,

I want to model the effect of price on product choice as a piecewise linear function and estimate it with CBC/HB. So in the CBC/HB module I have to choose "user-specified" as coding method.
There are 7 price points and therefore 6 slopes.
Now my question is how is it coded in the design matrix?

Thank you in advance.
asked Aug 8, 2012 by anonymous

1 Answer

0 votes
Here's a cut-and-paste from our ACBC training:

One can fit non-linear functions using piecewise coding.  This amounts to coding price across separate columns.  Consider coding continuous price as three separate betas, with breakpoints at $650 and $800:

    If Price<=650,
    x1 = Price
    x2 = 0
    x3 = 0
    If Price>650 and Price<=800,
        x1 = 650
        x2 = Price-650
        x3 = 0
    If Price>800,
        x1 = 650
        x2 = 150
        x3 = Price-800
Prices and coded x variables for three concepts ($500, $750, and $900) would be:
Price    x1      X2    x3
500       500    0    0
750       650    100    0
900      650    150    100
answered Aug 8, 2012 by Bryan Orme Platinum Sawtooth Software, Inc. (175,290 points)
Also, although the example above is used for illustration, please recognize that you don't want to do "user-specified coding" in CBC/HB with columns taking on such large values in terms of absolute mangitude.  Independent variables in CBC/HB should be coded about in single units of magnitude to obtain faster and better convergence.  So, all prices above should be divided by 100 prior to coding the transformation above.