# Can I make recommendations using inferences from multiple linear regression?

I have a question that doesn't seem to fall into classic "recommender systems", but may fall into the category of causal inference (though I'm not sure).

Say I have dataset of sales for a particular product in different geographic regions. In other words, each example in my dataset has a response variable of sales in that geographic region, and multiple predictor variables, # of stores, # of sales reps, advertising budget, etc. in that region.

I then run a multiple linear regression on the dataset to get the coefficients for each predictor variable, and maybe I find that the largest coefficient belongs to the # of sales reps variable.

Now if I look at one particular example (region) in the dataset that has low sales, is it appropriate to use the results of multiple linear regression to provide a recommendation to increase the number of sales reps in that region in order to increase sales?

I can imagine there are dangers with this, but what exactly are they? Does this question fall into the category of recommender systems, or causal inference, or both? What topics should I study to understand a scenario like this better?

• One of the first issues concerns the sense of "largest." For instance, if you were to redo the regression after recording the advertising budget in trillions of dollars (rather than dollars, say), then its coefficient would be enormous. How, then, do you propose to use your estimates to make recommendations in a non-arbitrary way? – whuber Nov 30 '20 at 20:29
• Good point. Wouldn't standardizing (e.g. rescale to have mean zero and standard deviation of 1) the predictor variables address this? – sedora Nov 30 '20 at 21:17
• It can -- but that's still somewhat arbitrary: why should modifying a variable with the largest standardized coefficient yield the best return (measured, perhaps, by increase in profit) relative to the potential cost of that modification? Most regression models--even assuming a causal interpretation turns out to be correct--don't include all the information needed to answer that question. – whuber Nov 30 '20 at 21:20
• I see, I didn't consider the cost of modification in this particular example (i.e. the cost of increasing the number of samples reps). Though I could imagine some other problem examples where the cost of modification is negligible, or you balance the cost by increasing certain predictors while reducing others. You're right that we won't have all the information to confidently answer the question, but I thought that one of the advantages of using linear regression was for purposes like this: for interpretability and inference. Why not use the inference to make recommendations? – sedora Nov 30 '20 at 21:46

This is a cost-benefit problem (or equivalently, a profit-optimisation problem) that is not fully answered by the regression model. This kind of problem requires you to combine your statistical inference about the product sales with economic analysis. Generally this entails writing the profit function for the firm as a function of the number of sales representatives, by including the sales and the variable costs of employing those representatives. You use your regression model to estimate the "sales function" for the firm and you then get an estimate of the "profit function" for the firm. You can then estimate the optimal number of sales representatives by taking account of the estimated number of sales you will get and the known variable costs (e.g., salary, etc.) of employing them.

A secondary problem here is whether you can interpret your regression outcomes causally, such that if the firm changes the number of sales representatives, they will thereby change the number of product sales. Using passive observation, it is unlikely that your regression outputs represent purely causal effects, and so you may need to do some further work later to deal with this. This is complicated, so I will just leave it as a caveat, and in the analysis below I will assume you can interpret your regression output in a causal manner.

Setting up a profit-optimisation problem: Let $$r$$ denote the number of sales representatives that are employed by the firm and let $$c$$ denote the "variable costs" of employing an additional sales representative (e.g., salary costs, etc.). Moreover, let $$\mathcal{P}$$ be the set of products sold by the firm and let $$\pi_i$$ be the profit from the sale of a single item of that product (i.e., the revenue for that item less variable costs of getting that item) for each product $$i \in \mathscr{P}$$. Let $$S(i, r)$$ be the number of sales of produce $$i$$ when the firm has $$r$$ sales representatives (and note that this part is stochastic --- hence the upper case). Then the profit function for the firm is:

$$\pi(r) = \sum_{i \in \mathcal{P}} \pi_i \cdot S(i,r) - r \cdot c - \text{Other Fixed Costs}.$$

In econometric analysis for input factor optimisation by the firm, we generally wish to maximise the expected profit $$\mathbb{E} (\pi(r))$$ (which assumes that shareholders are risk-neutral at the margins). Your regression model is giving you a model for the stochastic part $$S$$, which lets you estimate this part, giving you some estimator $$\hat{S}$$ for the expected sales. Assuming you can estimate over all the products, you then have an estimator for the expected profit, which is:

$$\hat{\pi}(r) = \sum_{i \in \mathcal{P}} \pi_i \cdot \hat{S}(i,r) - r \cdot c - \text{Other Fixed Costs}.$$

The estimated optimal number of sales representatives is:

$$\hat{r} = \underset{r \in \mathbb{N}}{\text{arg max}} \ \hat{\pi}(r).$$

Assuming some basic properties that ensure smoothness and quasi-concavity of the revenue function, the optimum (real) number of sales representatives will occur at the "critical point" where the marginal revenue of an additional sales-rep is equal to the marginal cost (i.e., salary, etc.) --- i.e., we have:

$$\text{Marginal revenue}(\hat{r}) \equiv \sum_{i \in \mathcal{P}} \pi_i \cdot \frac{\partial \hat{S}}{\partial r} (i,\hat{r}) = c = \text{Marginal Cost}.$$

This is a standard result in the economics of firm behaviour --- under some basic regularity conditions, profit maximising firms will employ factors of production up to the point where their marginal revenue equals their marginal cost (called the profit maximisation rule).

This gives you a simple outline of how you might pose an econometric optimisation problem of this kind. As you can see, the answer here is affected not only by the inferences from the regression model, but also by the variable costs of employing the sales representatives. If the salary costs of employment increase then, ceteris paribus, we would expect the optimal number of sales reps to decrease, and vice versa.

• This is a great answer. Could it also apply to examples where costs are not necessarily a factor? Say instead I had a dataset of subjective ratings of the tastiness of many meals, where the response was a rating 1-10, and the predictors were "sodium", "sugar", "proportion of veggies", etc. Say "sodium" has the largest coefficient from regression. If I was only interested in increasing the tastiness of a meal, without considering costs of adding more sodium, would it be an easier case of finding a specific meal with a low rating and being able to say "we need to add more sodium"? – sedora Nov 30 '20 at 23:51
• Yes; once you take away the negative part of the "profit" function, optimisation simply requires you to maximise the positive part. – Ben Dec 1 '20 at 6:04

I believe what you are asking here is if the linear regression coefficients can be interpreted causally, i.e. if they can be used to calculate the effects of a (hypothetical) intervention, where you would change certain predictors by a value X, and use the regression to calculate the increase in sales etc.

The basic answer to that question is (apart from the usual caveats of finding the correct model, etc.): yes, if you stick to certain rules about the selection of variables, i.e. if you avoid having colliders in your regression, and maybe you should also think about mediators.

For a detailed explanation, see Lederer, D. J., Bell, S. C., Branson, R. D., Chalmers, J. D., Marshall, R., Maslove, D. M., … & Stewart, P. W. (2019) Control of confounding and reporting of results in causal inference studies. Guidance for authors from editors of respiratory, sleep, and critical care journals. Annals of the American Thoracic Society, 16(1), 22-28.

• Thank you, I'll take a look at this paper! – sedora Nov 30 '20 at 23:38

I agree with the sentiment and can also imagine there are dangers assuming an equal functionality of a few variable regression model applied to a different region is entirely appropriate to base a decision to increase the number of sale representatives.

Having at one time actually being in a sales position, one must understand that there are at least two parts to complete a sale, a good sale representative and a buyer capable of actually being able to afford buying the product. The implication of this last statement is that in a region that may be undergoing an economic downturn, while the rest of the country is showing growth, may be an outlier with respect to a national model. As fundamental economic variables are not part of the model, regional differentiation in sales by the model could be remiss.

So even though a summary national regression relationship seems to imply that one can improve total sales by simply adding salespeople, this may not be the case if all other things are not equal, namely the economic capacity of people in the region to actually purchase.

Understanding the potential limitations of a model for forecasting in practice is paramount.