I encountered a real-world problem where I want to model the effectiveness of various advertising media of a brand (measured in terms of sales). Basically, the Y in this case is weekly sales, and the X's are media investments in newspaper, magazine, display boards, tv, radio and online, as well as incentive, which is a percentage (like 10% off the original).

There are a few problems with the modelling work:

  • all variables should have positive coefficients. Typically, more advertising or incentive is at least as good as less advertising/incentive (maybe this is not true if you buy all of the advertising spots in the world, as then your consumer will start to hate your brand, but this is not going to happen here). However, when I fit a typical regression (e.g. lm, glm, gls etc), some coefficients turn out to be negative (as data may be a bit noiser than expected, hence causing this problem?). I wonder if this can be controlled (I know in nonlinear regressions you can set constraints for parameters)

  • there should be some sort of diminishing marginal return of advertising spendings, but I am not exactly sure how to model that. Some ideas include using a log or square root transformation, another idea may be to use a nonlinear regression and estimator something like a*newspaper^b, where a is some coefficient, and b is an exponent between 0 and 1.

  • this is serial correlation, but this may not be exactly important here as the goal is only to estimate the parameters (if I use a regression I think I still get the unbiased estimators right? Autocorrelation only screws up the p-values, which is ignored here). Also, how to deal with seasonalities? I don't have much data (2 years) so maybe there is nothing we can do about it, but I have seen adding cos(0.0172*time) + sin(0.0172*time) to the regression equation to adjust for seasonal changes.


  • $\begingroup$ If you haven't already, it might be worth considering using some sort of polynomial lag model - an almon model for example. If you search distributed lag model, almon model, polynomial lag model, modelling sales in response to advertising, or terms like that, you should get some useful results. $\endgroup$ Feb 1, 2014 at 13:39
  • $\begingroup$ It seems to me you need to be very careful before you constraint the slopes. Is there a particular x that is causing this and is multicollinearity an issue? Have you tried a ridge regression? $\endgroup$
    – B_Miner
    Feb 1, 2014 at 20:50

1 Answer 1


1) All coefficients positive:
I could lay out an argument why this may not be so ("if you swamp consumers with advertising, they may get sick of you"), but let's accept this is a fringe result, not very likely to happen. And why data are "noisy"? From what I understand they are sales figures and advertisement expenses, why should they have increased noise? Anyway, if you want to constraint the parameters to be positive, you can run "Inequality Constraint OLS" - see this post

Negative values in predictions for an always-positive response variable in linear regression

and don't forget to read Whuber's comment. See also other approaches here:

Linear regression with slope constraint

2) Diminishing marginal returns You can include the squares of the variables -see the rationale here:
Why is functional form so important when specifying models?

3) Autocorrelation:
Make the distinction between autocorrelation, which technically leads to the inclusion of lag dependent variables in the regression, and reflects "habit formation" from the part of consumers (is your product such that creates strong habits? Is the brand really a brand, commanding "consumer loyalty"?), an effect which in any case, is partially captured by the constant term,

and time-deferred effects of the regressors on the dependent variable. If your data is weekly, most certainly you are going to have such effects: "non-perishable" advertisement (like press), may hang around for a while and affect consumer choices at a later week. Even "perishable" advertisement (radio, TV, etc) may show effects later on -the consumer is persuaded now, but it consumes later. Here you need to include lags of the regressors. You have 104 observations -you can spare one or two. Lags of regressors do not violate the standard assumptions on the linear regression model -they may make the dependent variable autocorrelated but this happens not through the error term but through the regressors. The only price to pay here is that, for asymptotic properties to hold, the assumption of strict exogeneity (which is needed for finite-sample unbiasedness) cannot be weakened to contemporaneous uncorrelatedness.

4) Seasonality
Do you have a priori knowledge that your dependent variable (Sales) exhibits or is expected to exhibit seasonality? If yes, does your regressors perhaps exhibit the same pattern?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.