Showing posts with label solver. Show all posts
Showing posts with label solver. Show all posts

Friday, January 14, 2011

Using Excel Solver To Optimize Your Marketing Budget

Using the Excel Solver To

Optimize Your Marketing

Budget


The Excel Solver allows you to calculate how to allocate your resources to get an optimal result. It is such a useful and versatile tool that almost any manager can put it use effectively but not many are familiar with how to use it.

This article will provide a simple example of how an Internet marketing manager can use the Excel Solver to optimize the allocation of marketing budget funds among 4 pay-per-click networks to achieve the highest number of conversions (sales).


Solver Problem Summary

In summary, here’s what we are trying to do:

1) Maximize the total number of conversions from all 4 pay-per-click vendors.

2) Not spend more than $500 on each individual pay-per-click provider


3) Not spend more than $1,500 total


We are also provided with the average cost per click and average conversion rate (percentage of clicks that convert to sales) for each network. The information is placed on a spreadsheet as follows:

Click On the Image To See a Larger Version

Our Solver Optimization Task

We have a total monthly paid search budget of $1,500 that must be allocated between the 4 following paid search providers: Google AdWords Search Network, Google AdWords Content, Facebook paid search, and LinkedIn paid search. We want to keep our pay-per-click efforts diversified; we will spend no more than $500 per month any single pay-per-click providers, but no more than $1500 total.

We know our average cost-per-click and conversion rate for each of the 4 pay-per-click vendors. Conversion rate is the percentage of clicks that convert (buy and become customers).


Running the Problem on the Excel Solver

Once the Solver has been installed as an add-in (To add-in Solver: File / Options / Add-Ins / Manage / Excel Add-Ins / Go / Solver Add-In), you can access the Solver in Excel 2010 by: Data / Solver.

The following blank Solver dialogue box appears:

Click on Image To See Larger Version

The Solver dialogue box has the following 5 parameters that need to be set:

1) The Objective Cell – The is the target cell that we are either trying to maximize, minimize, or achieve a certain value.

2) Whether we want to minimize or maximize the target, or attempt to achieve a certain value in the Objective cell.

3) Decision Variables – A set of variables that will be changed by the Excel Solver in order to optimize the target cell.

4) Constraints – These are the limitations that the problem subjects the Solver to during its calculations

5) Solving Method to be used.
Here once again is the Excel spreadsheet input data that will be used:


Click On Image To See Larger Version


Objective:

Maximize the total number of conversions from all 4 pay-per-click vendors (green cell H10)


Decision Variables:

By varying the budget amounts allocated to each of the 4 pay-per-click networks (tan cells – C6 to F6)
 
Objective and Decision Variables Selected in Solver


Click on Image To See Larger Version


Choice of Solver Method

Click on Image To See Larger Version

a1x1 + a2x2 + … + anxn = objective

We can tell that we are dealing entirely with linear equations in this example because all equations which used to determine the objective (the final number of conversions) are first-order. These basic equations are as follows:

Number of Clicks = (Average Cost Per Click) * (Amount Spent)

Number of Conversions = (Average Conversion Rate) * (Number of Clicks)

The GRG Nonlinear method is used when the equation producing the objective is not linear but is smooth (continuous). Examples of smooth nonlinear functions are:
=1/C1, =Log(C1), and =C1^2

These functions have graphs that are curved (nonlinear), but have no breaks (smooth)

The Evolutionary method is used for non-smooth functions. These are functions whose graph is discontinuous at any point.

The use of the GRG Nonlinear and Evolutionary methods would require much more discussion than time permits in this article. We will therefore work exclusively with the Simplex LP method here.

Constraints

Constraints must be added separately. To add a new constraint, just click the Add button and select the cell that will have the constraints applied to it. You then select the type of constraint, for example, the constrained cell must be less than a certain number. Finally you specify the constraining value, for example, the number that the constrained variable must be less than.

When setting constraints, it is important to remember which variables cannot take a negative number and then specify this as a constraint. In this case, the Amount Spent for any of the pay-per-click networks cannot take a negative value.

The constraint highlighted in blue ( $C$4:$F$4 Greater Than or Equal To 0) illustrates this type of constraint in this example:
Click On Image To See   Larger Version



Close-Up of Constraints Input Into Solver

Click On Image To See Larger Version

Solve

You are now ready to hit the Solve button and get the final result. Solver changes the Decision Variables to optimize the Objective Cell. When Solver changes the Decision Variables, all other variables which depend upon these Decision Variables will be recalculated. By definition, the Objective Cell must be a variable that is derived from the Decision Variables. The end result of running the Solver are as follows:


Click On Image To See Larger Version


Final, Optimized Result

We can see that the Excel Solver calculated the maximum possible number of conversions to be 392. Solver did this by setting the Decision Variables as follows:

Amount Spent – Google AdWords Search: $500
Amount Spent – Google AdWords Content: $500
Amount Spent – Facebook Paid Ads: $300
Amount Spent – LinkedIn Paid Ads: $500


Constraints Satisfied

The constraints on the upper limits of each Amount Spent, Total Amount Spent, and non-negative constraint for each Amount Spent have all been satisfied.


Available Reports

There are 3 available reports that can be attached to the Solver’s result. These 3 reports are Answer, Sensitivity, and Limits as seen in the Solver Completion dialogue box below:


Click On Image To See Larger Version


We will briefly evaluate only a part of 1 of those reports in this article: the Sensitivity Report.



The Sensitivity Report

Part of the Sensitivity Report is shown below:


Click On Image To See Larger Version


The Objective Function column shows the coefficients for each Amount Spent to produce the Total Number of Conversions. Since this is a first-order equation, the result looks like this:

0.2 * (Amount Spent on Google AdWords Search) +
0.2857143 * (Amount Spent on Google AdWords Content) +
0.1066667 * (Amount Spent on Facebook Paid Ads) +
0.2333333 * (Amount Spent on LinkedIn Paid Ads) =


= Total Number of Conversions


We can see from the Objective Coefficients that an amount spent on the Google AdWords Content Network would have the greatest effect on the Total Number of Conversions.


Summary


The Excel Solver at its basic level is a simple tool to use to determine the optimal allocation of your available resources.


If you would like to create a link to this blog article, here is the link to copy for your convenience:

Using Solver To Optimize Your Marketing Budget


Excel Model Building - Experts vs. Non-Experts
Please post any comments you have on this article. Your opinion is highly valued!




If You Like This, Then Share It...
Excel Model Building - Experts vs. Non-Experts Excel Model Building - Experts vs. Non-Experts Excel Model Building - Experts vs. Non-Experts Excel Model Building - Experts vs. Non-Experts Excel Model Building - Experts vs. Non-Experts Excel Model Building - Experts vs. Non-Experts Excel Model Building - Experts vs. Non-Experts

Excel Master Series Blog Directory

Statistical Topics and Articles In Each Topic

Wednesday, April 28, 2010

Logistic Regression - How To Predict If a Prospect Will Buy Using Logistic Regression in Excel

Logistic Regression

Analysis in Excel

For Marketing



Wouldn’t it be great if there was a more accurate way to predict whether your prospect will buy rather than just taking an educated guess? Well, there is…if you have enough data on your previous prospects. The tool that makes this possible is called Logistic Regression and can be easily implemented in Excel.




Customer Quality Scores Are Created With Logistic Regression


Marketers use Logistic Regression to rank their prospects with a quality score which indicates that prospect’s likelihood to buy. The more data you’ve collected from previous prospects, the more accurately you’ll be able to use Logistic Regression in Excel to calculate your new prospect’s probability of purchasing.


Here is a video which will show you how to perform Logistic Regression in Excel and why it works. The example that will be presented in the video will also be covered below in the article:




Step-By-Step Video Showing How To Predict if a Prospect Will Buy Using Logistic Regression in Excel:
(Is Your Sound Turned On?)




What is Logistic Regression?


Logistic Regression calculates the probability of the event occurring, such as the purchase of a product. In general, the thing being predicted in a Regression equation is represented by the dependent variable or output variable and is usually labeled as the Y variable in the Regression equation. In the case of Logistic Regression, this “Y” is binary. In other words, the output or dependent variable can only take the values of 1 or 0. The predicted event either occurs or it doesn’t occur – your prospect either will buy or won’t buy. Occasionally this type of output variable also referred to as a Dummy Dependent Variable.




An Example of Logistic Regression In Action


Here is a marketing example showing how Logistic Regression works. The embedded video walks through this example in Excel as well:


Suppose that you have collected three pieces of data on each of your previous prospects. The data you have collected on each prospect was:


1) The prospect’s age
2) The prospect’s gender (1 = Male and 0 = Female)
3) Whether the prospect purchased or not (Did purchase Y = 1, Did not purchase, Y = 0).
regression, logistic regression, logit regression, logit, regression model, logit model, logistic regression spss, logistic regression models, statistical analysis in excel






Create the Predictive Equation


With the above data, you could create a predictive equation that would calculate a new prospect’s probability of purchasing by inputting this new prospect’s age and gender. This predictive equation will be in the form of:


P(X) = eL/ (1+eL)


P(X) represents the possibility of event X occurring.




The Logit


Event X is a purchase. In other words, P(X) is the probability that Y = 1.


P(X) has only one variable. That is L, which is called the Logit.


The Logit, L = Constant + A * Age + B * Gender


L, the Logit, has 3 variables: Constant, A, and B. They must be known before P(X) can be calculated. Those 3 variables can be found in Excel by using the Excel Solver. The Excel Solver will find the optimal combination of those 3 variables that causes the resulting P(X) to most accurately predict whether Y = 1 or 0 for all previous prospects.




regression, logistic regression, logit regression, logit, regression model, logit model, logistic regression spss, logistic regression models, statistical analysis in excel
Click On Image To See Larger Version



Calculating the Logit Variables - A, B, and Constant


Here’s how the most optimal set of Logit variables (Constant, A, and B) are found in Excel:


Using Excel, each recorded prospect has the following calculation performed:


P(X)Y * [ 1 - P(X) ](1-Y)


The Y refers to Y = 1 if the prospect bought and Y = 0 if the prospect didn’t buy.


The P(X) is the probability of purchase that will be calculated using the equation listed above. In Excel, the P(X) calculation is initially performed by the Excel Solver using Logit variables (Constant, A, and B) which are not optimal. The Excel Solver will then continuously try new combinations of these variables until the optimal P(X) is found.

Optimizing the Logit Variables in the Excel Solver


Here’s how the Excel Solver knows when it has found the correct combinations of these 3 variables so that the resulting P(X) equation most accurately predicts whether Y = 1 or 0:


The equation P(X )Y * [ 1 - P(X) ](1-Y) is maximized when P(X) is most accurate. It approaches it highest value (1) when Y = 1 and P(X) approaches 1. It also approaches its highest value (1) when Y = 0 and P(X) approaches 0. When Y = 1 and P(X) = 1, that is a 100% correct prediction by P(X) that Y = 1. When Y = 0 and P(X) = 0, that is a 100% correct prediction by P(X) that Y = 0.


Each prospect has a separate P(X )Y * [ 1 - P(X) ](1-Y) value calculated for him or her.


The sum of each P(X )Y * [ 1 - P(X) ](1-Y) calculation for all prospects is taken.


The only variables that exist when calculating P(X )Y * [ 1 - P(X) ](1-Y) are Y and the variables of P(X), which are Constant, A, and B. Use the Excel Solver, these variable are adjusted until their values maximize the sum of all P(X )Y * [ 1 - P(X) ](1-Y).


regression, logistic regression, logit regression, logit, regression model, logit model, logistic regression spss, logistic regression models, statistical analysis in excel




The Final, Most Accurate Predictive Equation


When the sum of P(X )Y * [ 1 - P(X) ](1-Y) is maximized, then the final resulting P(X) equation is as accurate as possible at predicting whether Y will be 1 or 0.


regression, logistic regression, logit regression, logit, regression model, logit model, logistic regression spss, logistic regression models, statistical analysis in excel
Click On Image To See Larger Version



The Excel Solver Dialogue Box
regression, logistic regression, logit regression, logit, regression model, logit model, logistic regression spss, logistic regression models, statistical analysis in excel


Stated another way, we now have a predictive equation P(X ) which uses the optimal combination of Constant, A, and B which most accurately calculates the probability that Y = 1 given a prospect’s age and gender.


The embedded video provides a clear picture of all of this in action in Excel.


The use of the Excel Solver does require some hand-tweeking to ensure that the most accurate answer is obtained. The video shows an example of this. Ultimately what the Solver is doing is adjusting variables Constant, A, and B to maximize the sum of the column of


P(X )Y * [ 1 - P(X) ](1-Y) equations. The answer obtained by the Solver should maximize that sum and provide realistic answers for the probabilities of each prospect, including the new one.






You'll Have To Tweek the Constraints in the Excel Solver


You’ll probably find that you have to experiment by applying constraints to the variables that Solver is adjusting in order to maximize the target sum. The variables that Solver adjusts are called Decision Variables. Solver allows you to create constraints on the value of any Decision Variable.




Adding a Constraint to the Solver
regression, logistic regression, logit regression, logit, regression model, logit model, logistic regression spss, logistic regression models, statistical analysis in excel




regression, logistic regression, logit regression, logit, regression model, logit model, logistic regression spss, logistic regression models, statistical analysis in excel




In the video, you will be able to watch how a Decision Variable is constrained to make the final answer more accurate. The Decision Variable called Constant was constrained to always remain above -25 during the Solver analysis. This resulted in the most accurate and realistic maximization of the sum of the P(X )Y * [ 1 - P(X) ](1-Y) equations.




Conclusion - Incredible Predictor but Not the Simplest Analysis


Logistic Regression is not the simplest type of analysis to understand or perform. Hopefully this article and video have provided a much clearer picture for you.

 regression, logistic regression, logit regression, logit, regression model, logit model, logistic regression spss, logistic regression models, statistical analysis in excel





If you have any comments, questions, suggestions regarding the use of Logistic Regression, your input is welcome and appreciated.



If You Like This, Then Share It...
Dig this Stumble upon Delicious Technorati Reddit Buzz it Twitthis

Excel Master Series Blog Directory

Statistical Topics and Articles In Each Topic