Chat with us, powered by LiveChat Urgent Help need | Gen Paper
+1(978)310-4246 credencewriters@gmail.com
  

Objectives
Overview of regression analysis

Understanding control variables

Overview of Radiant

2

Regression
How is the outcome variable associated with the explanatory variable(s)

Sales ($)

Advertising ($1,000)

3

Regression
How is the outcome variable associated with the explanatory variable(s)

Sales ($)

Advertising ($1,000)

4

Regression

How is the outcome variable associated with the explanatory variable(s)

Sales ($)

Advertising ($1,000)

����� = � + � * ����������� + �

5

Regression
How is the outcome variable associated with the explanatory variable(s)

Sales ($) �

�

�

Advertising ($1,000)

����� = � + � * ����������� + �

6

Regression
How is the outcome variable associated with the explanatory variable(s)

Sales ($) !

#

Advertising ($1,000)

����� = � + � *
����������� +
�

Intercept: Baseline sales
in $ when advertising
expenditure is zero

7

Regression
How is the outcome variable associated with the explanatory variable(s)

Sales ($) !

#

Advertising ($1,000)

����� = � + � *
����������� + �

Slope: If you increase 1
unit of
advertising (in $1,000),

you expect sales increase by $ �

8

Regression
How is the outcome variable associated with the explanatory variable(s)

Sales ($) !

#

Advertising ($1,000)

����� = � + � *
����������� + �

Error: Individual
observation’s deviation
from the average

tendency, where the average tendency is summarized by � and �

9

Regression
How is the outcome variable associated with the explanatory variable(s)

Sales ($) !

#

Advertising ($1,000)

����� = � + � *
����������� + �

Error: Individual
observation’s deviation
from the average
tendency, where the

average tendency is summarized by � and �

Given Sales and Advertising observations, regression analysis
summarizes the pattern by finding � and � that minimizes overall
errors

10

Control variables
What if the data include observations during Thanksgiving break, such
as black Friday and cyber Monday?

Sales ($)

Advertising ($1,000)

11

Control variables
What if the data include observations during Thanksgiving break, such
as black Friday and cyber Monday?

Sales ($)

Advertising ($1,000)

12

Control variables
What if the data include observations during Thanksgiving break, such

as black Friday and cyber Monday?

Sales ($)
Thanksgiving!

Advertising ($1,000)

Can we say the advertising was effective? Aren’t we overconfident? 13

Control variables
What if the data include observations during Thanksgiving break, such

as black Friday and cyber Monday?

Sales ($)
Thanksgiving!

Advertising ($1,000)

����� = � + � * ����������� + � * � + �

14

Control variables

What if the data include observations during Thanksgiving break, such
as black Friday and cyber Monday? – Base sales is $� for Thanksgiving

Sales ($)
Thanksgiving!

�

Control variable
Z = 1 for Thanksgiving,
0 otherwise

Advertising ($1,000)

����� = � + � * ����������� + � * � + �

15

Control variables
What if the data include observations during Thanksgiving break, such
as black Friday and cyber Monday? – Base sales is $� for Thanksgiving

Sales ($)
Thanksgiving!

�

Control variable
Z = 1 for Thanksgiving,
0 otherwise

Advertising ($1,000)

����� − � * � = � + � * ����������� + �

16

Control variables
What if the data include observations during Thanksgiving break, such
as black Friday and cyber Monday?

Control

variable

Sales ($)

Z = 1 for Thanksgiving,
0 otherwise

Advertising ($1,000)

����� − � * � = � + � * ����������� + �

17

Control variables
What if the data include observations during Thanksgiving break, such
as black Friday and cyber Monday?

Control

variable

Sales ($)

Z = 1 for Thanksgiving,
0 otherwise

Advertising ($1,000)

����� − � * � = � + � * ����������� + �

18

Control variables
What if the data include observations during Thanksgiving break, such
as black Friday and cyber Monday? – Overconfident in ad spend!

Control

variable

Sales ($)

Z = 1 for Thanksgiving,
0 otherwise

Advertising ($1,000)

����� − � * � = � + � * ����������� + �

19

Control variables
Without the Thanksgiving control variable, we misunderstood that
advertising effectiveness is higher than the truth

That was baseline sales increase due to the Thanksgiving shopping
season, not the effects of advertising

We can consider various controls for baselines depending on the
information you have:

â—¦ Industry
â—¦ Brand
â—¦ Seasonality
â—¦ Months
â—¦ Day of the week
â—¦ Time of the day
â—¦ And many more!

20

Multiple regressions

We can expand it with multiple explanatory

variables

����� = � + �!” * ����������� + �# * ����� + � * � + �

We can also expand it with multiple control variables

����� = � + �!” * ����������� + �# * ����� + �$% * �$% + �&'()* *
�&'()* + �

21

Now let’s do it
Make sure to be ready to use Radiant using one of the three options: 1.
Install on your computer: https://radiant-rstats.github.io/docs/install.html

2. Log on to the virtual lab at http://ucr.apporto.com/ using your UCR Net ID
and remotely work on Radiant from the virtual lab

â—¦ Instructions for the virtual lab is here: https://ucrsupport.service
now.com/ucr_portal/?id=kb_article&sys_id=8b5964291b84d49026bd635bbc4bcbd7

â—¦ In case that you have trouble working on the virtual lab, you will need to directly contact the IT
office

3. (Emergency protocol, but not recommended) Use online version of Radiant
at https://vnijs.shinyapps.io/radiant/

â—¦ Functionality is limited, and security is a concern

Download your sample dataset from eLearn, Course Materials 22

Radiant
First run “Rstudio”

23

Radiant
Click “Addins”

24

Radiant
Click “Start radiant (browser)”, then Radiant will show up on your web
browser

25

Radiant
On the left panel, click the drop down menu under “Load data of type”,
then choose “csv”

26

Radiant
Click “Load”, then select the folder you stored the data file. Select the

file (sample_data_reg.csv) then click “Select”

27

Data
There are 5 columns, 100 rows in the dataset
â—¦ Sales (in $1,000): Outcome variable
â—¦ Price (in $): Explanatory variable
â—¦ Ad spend (in $1,000): Explanatory variable
â—¦ Thanksgiving: Control variable
â—¦ Christmas: Control variable

First 10 rows are from Thanksgiving

Second 10 rows are from Christmas

Remaining 80 rows are from
“off-season”

28

Data
Control variables need to be
transformed from “numbers” to
“factors”

1. Click “Transform” on top 2.

Select “Thanksgiving” under

“Select variables”

3. Select “Change type” under
“Transformation type”

4. Select “As factor” under “Change
variable type”

5. Click “+Store”

Repeat this for “Christmas”
1

2

3

4

5

29

Visualization
First, we can visually inspect
data 1. Click “Visualize” on top

2. Select “Scatter” under “Plot-type”

3. Select “Sales_in_1_000” as “Y

1

variable”
5

4. Select “Price_in_” as “X-variable”
2

5. Click “Create plot”

3

How do sales change as prices
increase or decrease?

4

30

Visualization
First, we can visually inspect data

1. Click “Visualize” on top

2. Select “Scatter” under “Plot-type”

3. Select “Sales_in_1_000” as “Y
variable”

4. Select “Price_in_” as “X-variable”

5. Click “Create plot”

Repeat these five steps for

“AdSpend_in_1_000”

How do sales change as ad spend
increases or decreases?

31

Visualization
We can also inspect seasonality

1. Select “Bar” under “Plot-type”

2. Select “Sales_in_1_000” as “Y
variable”

3. Select “Thanksgiving” as “X- 4
variable”

4. Click “Create plot”

1

2

There is about $10K difference in
sales between Thanksgiving and

3

others on average

Repeat these four steps for
“Christmas”

32

Regression analysis
Click “Model” on top menu, and select “Linear

regression”

33

Regression analysis: Step 1
Select “Sales_in_1_000” as “Response variable”

Select “Price_in_” as “Explanatory variables”

Click “Estimate model”

Coefficient for “Price_in_” (i.e., �!) is -0.499
â—¦ What does it mean?
◦ Unit increase in price is associated with …

34

Regression analysis: Step 2

Select “Sales_in_1_000” as “Response variable”

Select “Price_in_” as “Explanatory variables”

Add “Thanksgiving” to the “Explanatory variables”
â—¦ Ctrl + Click multiple variables

Click “Re-estimate model”

How did coefficient for “Price_in_”
change?
â—¦ What does it mean?

35

Regression analysis: Step 3
Select “Sales_in_1_000” as “Response variable”

Select “Price_in_” as “Explanatory variables”

Add “Thanksgiving” and “Christmas” to the “Explanatory
variables” ◦ Ctrl + Click multiple variables

Click “Re-estimate model”

How did coefficient for “Price_in_”
change?
â—¦ What does it mean?

36

Regression analysis: Step 3
Select “Sales_in_1_000” as “Response variable”

Select “Price_in_” as “Explanatory variables”

Add “Thanksgiving” and “Christmas” to the “Explanatory
variables” ◦ Ctrl + Click multiple variables

Click “Re-estimate model”

How did coefficient for “Price_in_”

change?
â—¦ What does it mean?

Repeat the three steps for “Ad_Spend”
â—¦ How does the ad effectiveness estimate

change by adding control variables?

37

Regression analysis: Full
model
Select “Sales_in_1_000” as “Response variable”

Select “Price_in_” and “Ad_Spend” as “Explanatory variables” Add
“Thanksgiving” and “Christmas” to the “Explanatory variables” Click

“Re-estimate model”
38

Interpretation, on average
$1 increase in price is associated with …

$1,000 increase in ad spend is associated with …

Baseline sales in Thanksgiving are higher than those in off season by..

Baseline sales in Christmas are higher than those in off season by..

39

Assignment 7: Due May 16th
Carefully review the slides in pages 22 ~ 39

1. Visualization
â—¦ Obtain scatter plots of Sales vs. Price, and Sales vs. Ads, and explain the

relationship from your visual inspection of data

â—¦ Obtain bar plots of Sales by Thanksgiving and Christmas, and explain and
interpret the differences

2. Effects of control variables
â—¦ Regress Sales on Price, then interpret the coefficient
â—¦ Regress Sales on Price, Thanksgiving, then explain how coefficient changes â—¦
Regress Sales on Price, Thanksgiving, Christmas then explain how coefficient
changes

â—¦ Repeat this for Ad Spend instead of Price

3. Regression analysis
â—¦ Regress Sales on Price, Ad Spend, Thanksgiving, and Christmas
â—¦ Interpret all four coefficients

40

error: Content is protected !!