# Basic structure of linear regression equation for s-shaped response curve

Can anyone enlighten me with the equation structure for the following basic theoretical (although common) scenario:

Sales, $S$, are related to "Advertising", $A$, such that when $A$ is small $S$ grows exponentially, and when $A$ is large, $S$ grows more slowly until at some point any increase in $A$ produces zero increase in $S$. So, a typical S-shaped response to advertising.

The total number of sales made in any period in the market is $T$. So our average market share works out as $\Sigma S/\Sigma T$. When advertising is zero, our sales are static at some level $s$ (i.e. the effect some other supporting influence other than advertising).

I know this can be solved through linear regression by transforming the variables, but I'm struggling to get my head around the most basic version of this - essentially $f(S) =\gamma+ \beta g(A)+\epsilon$, (with $\gamma$ being some intercept (possibly $0$) and $\epsilon$ being residuals) but what do $f$ and $g$ look like, and therefore what does the equation look like that I need to solve to estimate $S$?

EDIT

To show how the final equation would look, I have the logit transform in mind, so I'm looking for how the logit transform is applied using the parameters in the question, then what the final equation would look like with the transformations in place.

In addition, I'm specifically looking for a form to solve via linear regression rater than anything non-linear.

Possible S-shaped transformations are the logit ($log(x/(1-x))$) and the complementary log-log ($log(-log(x))$) to name a couple. See https://en.wikipedia.org/wiki/Sigmoid_function for more.

In your case, it is hard to say whether to transform the outcome ($S$) or the predictor ($A$) without seeing the data. If you'd start with transforming the predictor using logit transformation and then fitting your model, the final regression formula would look like this:

$S=γ+β*log(A/(1-A))+ϵ$ *

*Note that the logit and cloglog transformation will have trouble with data outside the $[0,1]$ range. This happens for most sigmoid functions. To use these transformations, you will need to transform the data if the data range is outside of the $[0,1]$. By suggestion of OP:

$A$ can be brought to the $[0,1]$ range by: $A′=(A+1)/(max(A)+2)$

the full regression formula would then be:

$S=γ+β*log(A′/(1-A′))+ϵ$

$= γ+β*log(((A+1)/(max(A)+2))/(1-((A+1)/(max(A)+2))))+ϵ$

A more straightforward approach to this non-linear association between advertising and sales would be to use a spline function. That way you are not so much dependent on 'accidentally' picking a more or less properly fitting transformation and the preprocessing is not needed! Implementation of splines in regression models can be done in R using, for example, the rms package.

• Thanks - the logit transform I've come across and this is what I have in mind, but not the log-log (I'll read more on this). What I'm looking for is the final form of the equation - just to join the dots, which is what I'm struggling with. I've read in many, many texts that I should "apply the transform abc", but without seeing the form of the equation after doing this. This is why I've asking about what $f(.)$ and $g(.)$ look like and what the final equation looks like. – Andy C Nov 1 '17 at 14:14
• edited my answer to show what I meant. – IWS Nov 1 '17 at 14:17
• Brilliant! Your sentence "In your case, it is hard to say whether to transform the outcome (S) or the predictor (A) without seeing the data" I think explains why I've found this so hard to get my head around - I have believed so far that there is a "correct" answer to that regardless of data. Do you have an example of something found in the data that would help make this decision? – Andy C Nov 1 '17 at 14:22
• In the general case I'd argue against transforming the outcome ($S$) as transformed outcomes hamper direct interpretation of the expected outcome value. Using the formula from my answer for instance, you could obtain the expected amount of sales $S_A$, by plugging in a value for $A$. If you would have had a formula where S was transformed, on the other hand, you would need to back-transform the result of the formula first. Moreover, when there are multiple predictors, transforming the outcome $S$ might 'straighten' some associations, while bending others. – IWS Nov 1 '17 at 15:11
• I'm assuming there is an initial simple transformation required on $A$, $A^\prime=f(A)$ so that it satisfies $0<A^\prime<1$ ? E.g. if A ranges between, say, 0 and 1000 units, $A^\prime=(A+1)/(max(A)+2)$ (+1 and +2 chosen arbitrarily here to push away from 0 and 1). – Andy C Nov 1 '17 at 15:39

One approach that is used sometimes is the ADBUDG model proposed by John Little of MIT. The model assumes that:

$$S = b + (a-b) \frac{A^c}{d+A^c}$$

The model generates an s-shaped curve for $c>1$ and sales are bounded between $b$ and $a$. Estimating the model requires you to use non-linear least squares where you minimize the squared sum of residual errors between the actual sales and estimated sales using the function above.

Implementing the above should be possible in Excel (using its in-built optimization routines) or other platforms such as R, Python etc.

• Thanks @Srikant, although I'm looking for a linear approach for this question, I will definitely research the ADBUDG model. – Andy C Nov 1 '17 at 14:29