Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 3-2 Summarizing Relationships among variables ©

Similar presentations


Presentation on theme: "Lecture 3-2 Summarizing Relationships among variables ©"— Presentation transcript:

1 Lecture 3-2 Summarizing Relationships among variables ©

2 Numerical measures of summarizing the relationship between two variables 4To think of what numerical measures we need to represent relationships between variables, see the following three pairs of scatter plots.

3 Example 1: Relationships between the returns of different stocks Stock B return Stock A return * ** * * * * * * * * * * Stock D return Stock C Return * ** * * * * * * * * * Scatter plot I Scatter Plot II

4 Example 1 (Continued) 4Scatter Plot I shows a positive relationship while scatter plot II shows a negative relationship. 4We need a numerical measure that shows the direction of the relationship. 4 For this purpose, we use “Covariance”

5 Example 2: Relationships between advertisement spending and revenue Product I shows a clear linear relationship between the advertisement spending and revenue, while product II does not show much of a relationship. We need to have a numerical measure that shows the strength of linear relationship between two variables. We use “Correlation Coefficient”

6 Example 3: Number of promotion and sales Promotion seems to be more effective for Product A than product B in the sense that additional promotion brings greater increase in revenue (i.e., the “slope” is steeper). To measure the effectiveness of the promotion, we use “Regression Analysis”

7 Numerical measures of summarizing relationships 4This lecture covers the following topics 1.Covariance 2.Correlation coefficient 3.Regression Analysis

8 Covariance 4Covariance is a numerical measure that shows the direction of the relationship between two variables. 4Covariance is one of the most fundamental numerical measures of the relationship between two variables. It will appear in many areas (i.e., computation of returns of a portfolio of stocks) 4In the following slides, we will learn the logic behind the derivation of covariance.

9 How to measure the direction of the relationship x y * ** * * * * * * * * * * Positive Relationship w z * ** * * * * * * * * * Negative relationship * * * * * * Box I Box II Box III Box IV Box I Box II Box III Box IV

10 How to measure the direction of the relationship 4From the previous two scatter plots, notice that: 1.When two variables show a positive relationship, there are more data points in Box I and Box III, than in Box II and Box IV 2.When two variables show a negative relationship, there are more data points in Box II and Box IV, than Box I and Box III. 4We use these facts to measure the direction of the relationship.

11 How to measure the direction of the relationship: Example Number of promotions Revenue from the product A in 1000 yen 5600 101000 81100 9900 101500 12750 202200 182000 171700 The data shows the relationships between the number of promotions and revenue. (It is same data set used in the previous handout. Revenue is now denoted in 1000 yen) Suppose you want to know if there is positive relationship between these two variables. Next slide is the scatter plot of this relationship.

12 How to measure the direction of the relationship: Example, contd Number of promotions and revenue appears to have a positive relationship. Notice that most of the data points are either in Box I or Box III What can we say about Box I and Box III? See the next slide

13 How to measure the direction of the relationship: Example, contd For each data point, you can compute the distances from the means. Then we can notice that, for any data points in Box I, both of the distances are positive. For any data points in Box III, both of the distances are negative. See the next slide Distance from the mean of X = (X- the mean of X) Distance from the mean of Y = (Y- the mean of Y)

14

15 How to measure the direction of the relationship: Example, contd 4For a data point in Box I, distances from the means are both positive. That is, both (X- ) and (Y- ) are positive. Therefore, if we multiply the two distances together, we will have a positive number 4For a data point in Box III, distance from the means are both negative. That is (X- ) and (Y- ) are both negative. Therefore, if we multiply the two distances together, we will again have a positive number. 4Now, what we can say about Box II and Box IV? See next slide.

16

17 How to measure the direction of the relationship: Example, contd 4For any points in box II and box IV, one distance will be positive and the other distance will be negative. So if we multiply them together, we will have a negative number.

18 How to measure the direction of the relationship: Example, contd 4Consider, for each data point, you compute the distances from the means, then multiply them together. Further, consider you sum all the multiplied distances together. If the resulting number is positive, this roughly indicates that there are more data points in Box I and Box III than Box II and Box IV. This in turn indicates that the data shows positive relationship. If the resulting number is negative, this indicates a negative relationship. 4This is the basic idea of measuring the direction of the relationship between two variables, and this is the first step to compute “Covariance”.

19 Computation of the Sample Covariance 4The sample covariance is computed in the following way. 1.Compute the mean for each variable. 2.For each observation, and for each variable, compute the distances from the means, i.e. compute (X- ) and (Y- ). Then multiply them together. 3.Sum all the multiplied differences. 4.Divide the sum of the multiplied differences by n-1, (that is the number of observations minus 1).

20 Computation of Sample covariance Exercise 4Open “Computation of Covariance” data set. Using data on the sheet “data 1”, compute the covariance between the number of promotions and the revenue.

21 Exercise, contd 4The covariance between the number of promotions and revenue is 2561.8 4Positive covariance indicates that the number of promotions and revenue have a positive relationship.

22 Characteristics of Covariance 1.If covariance is positive, the two variables have a positive relationship 2.If covariance is negative, the two variables have a negative relationship. 3.A large value of covariance does not indicate that the two variables have a strong linear relationship.

23 A note on Covariance 4One may be tempted to conclude that if the covariance is larger, the relationship between two variables is stronger (in the sense that they have stronger linear relationship) 4However, this is not true. To see this, go over the next example.

24 A note on Covariance, example 4Open the data “Computation of Covariance”, work sheet “data 2”. Compute the covariance between variable X and Y. (The data 2 is in fact the same as data 1. Only the difference is, the revenue is measure in 1000 yen for data 1, while it is measure in 1 yen for data 2.)

25 Example, contd 4The covariance for data 2 is 2561805. This compares the covariance for data 1 which was 2561.8. 4Even if data 1 and data 2 show exactly the same relationship, covariance for data 2 is much larger. This is simply because the unit of measurement for revenue is different between data 1 and data2. 4This shows that a larger covariance does not mean a stronger relationship. (In this particular example, relationship is exactly the same.) 4To show the strength of the relationship, we use “ Correlation coefficient ”.

26 Sample Correlation Coefficient The measure of the strength of linear relationship 4Correlation coefficient between X and Y, denoted as r xy, is computed as

27 Characteristics of Correlation Coefficient 1.The correlation coefficient ranges from –1 to +1 with, r xy = +1 indicates a perfect positive linear relationship: the X and Y points would plot an increasing straight line. r xy = 0 indicates no linear relationship between X and Y. r xy = -1 indicates a perfect negative linear relationship: the X and Y points would plot a decreasing straight line. 2. Positive correlations 2. Positive correlations indicate positive or increasing linear relationships with values closer to +1 indicating data points closer to a straight line and closer to 0 indicating greater deviations from a straight line. 3. Negative correlations 3. Negative correlations indicate decreasing linear relationships with values closer to –1 indicating points closer to a straight line and closer to 0 indicating greater deviations from a straight line. 4.Correlation coefficient is not the slope of the relationship.

28 Correlation Coefficient Exercise 4Open “Computation of Covariance”. Compute correlation coefficient between the number of promotion and revenue for both data 1 and data 2.

29 Correlation Coefficient exercise 4Exercise 1: Open Data set “Correlation Coefficient Exercise 1”. This data set shows the relationships between advertisement cost and revenue for two different products. First, produce a scatter plot for each product. Then compute correlation coefficient for each product. 4Exercise 2: Open data set “Correlation Coefficient Exercise 2”. This data set contains two pairs of variables. First, make a scatter plot for each pair in a single graph. Second, compute correlation coefficient for each pair of the variables.

30 Exercise 1, Answer Product I shows strong positive linear relationship between advertisement cost and revenue. Correlation coefficient is 0.95, which is close to 1. Product II does not show much linear relationship. The correlation coefficient is close to 0.05, which is close to 0.

31 Exercise 2 (Answer)

32 Correlation Coefficient Exercise 2 (Answer) 4First, for both pairs, the correlation coefficients are -1. This means that the relationships are perfectly (negatively) linear for both pairs of variables. 4Also note that, even though the slope for the pair I is much steeper, the correlation coefficients are the same for both pairs. This shows that correlation coefficient is not the slope of the relationship.

33 Correlation Coefficient 4To have more idea about the coefficient correlation, see the following slides

34 Scatter Plots and Correlation (Figure 3.6) X Y (a) r =.8

35 X Y (b)r = -.8 Scatter Plots and Correlation (Figure 3.6)

36 X Y (c) r = 0

37 Understanding the mathematical notation for the covariance and correlation coefficient. Obs IDVariable X Variable Y 1X1X1 Y1Y1 2X2X2 Y2Y2 ::: nXnXn YnYn This is a typical data format for the use of describing two variables. Using this format, we would like to represent the covariance, and the correlation coefficient using mathematical notations.

38 Understanding the mathematical notation for the sample covariance and sample correlation coefficient. Obs IDVariable X Variable Y Each X – the mean of X Each Y- the mean of Y (each X- ) * (each Y- the mean Y) 1X1X1 Y1Y1 (X 1 - )(Y 1 - )(X 1 - )*(Y 1 - ) 2X2X2 Y2Y2 (X 2 - )(Y 2 - )(X 2 - )*(Y 2 - ) ::::: nXnXn YnYn (X n - )(Y n - )(X n - )*(Y n - ) The mean Covariance is computed by summing the last colum, then divide the sum by (n-1). Therefore, the mathematical notation for the covariance is given by Next Slide

39 Mathematical Notation for the sample covariance The mathematical notation for covariance between variable X and variable Y, denoted by either Cov(X,Y) or s xy, is given as where x i and y i are the observed values, and are the sample means, and n is the sample size.

40 Mathematical Notation for the sample correlation coefficient sample correlation coefficient, r xy, The sample correlation coefficient, r xy, is computed by the equation S x is the standard deviation of variable X. S y is the standard deviation for variable Y.

41 3. Ordinary Least Square estimation -A Regression Analysis- This is the scatter plot we saw in Lecture 3-1. From the graph, we can see that promotion is more effective for product A than product B. Then, how do we measure the effectiveness of promotions? Correlation coefficient cannot be used for this purpose since it is not the measure of the slope

42 Ordinary Least Square estimation A Regression Analysis To measure the effectiveness of promotion for each product, we use regression analysis. In this handout, we will talk about a type of regression analysis called “Ordinary Least Square Estimation”

43 Ordinary Least Square Estimation Ordinary Least Square (OLS) estimation is a method to find a linear equation that best fits the data. Left hand graph is a simple scatter plot of the relationship between the number of promotions and the revenue from product A. The right hand side graph shows the OLS estimation of the linear relationship between the number of promotion and revenue for the product A. Next several slides show the logic behind the OLS estimation.

44 Ordinary Least Square Estimation (Two variable case) Ordinary Least Square Estimation Ordinary Least Square Estimation assume that the number of promotions and the revenue from the product has the following relationship. More generally, ordinary least square estimation assume that, between variable Y and variable X, there is a following linear relationship. An equation, like this, that describes a relationship among variables is called a “model”, or “regression equation”. The model above contains two parameters,  0 and  1. They are called the model coefficients. The coefficient  0, is the intercept on the Y-axis and the coefficient  1 is the slope. (The slope is the change in Y for every unit change in X.)

45 Ordinary Least Square Estimation (Two variable case) 4Ordinary Least Square Estimation is a method to find (estimate) the values for β 0 and β 1 that fit the equation to the data “best”. 4The criteria to choose (estimate) the values for β 0 and β 1 is described in the following slides.

46 Ordinary Least Square Estimation Criteria to estimate the parameter values X (number of promotion) Y (Sales from Product A) eiei (x i, y i ) Vertical distance from the equation to i th data point We choose (estimate) the values for β 0 and β 1 so that the sum of the squared (vertical) distances from the equation to each data point is minimized. (Therefore, this estimation is called ordinary least square estimation.) Excel automatically estimates these values.

47 Ordinary Least Square Estimation Using Excel, Example Excel can estimate the linear equation model, and draw the line at the same time. The estimated β 0 =105827, and β 1 =99060. Exercise: Open Data “OLS Exercise 1-Promotion and Sales” and reproduce this figure.

48 Things we can do with OLS 4Using the estimated equation, we can 1.Find the effect of promotion on the revenue for product A. 2.Forecast revenue for different number of promotions. 3.Find the number of promotions necessary to achieve your sales goal.

49 Effect of promotion on the sales of product A The estimated slope parameter β 1 is the estimated effect of promotion on the revenue from product A. β 1 =99,060 means that if you increase the number of promotion by one, the revenue would increase by 99,060 on average.

50 Forecasting Revenue 4Estimated equation can be used to forecast revenue for different number of promotions. 4Suppose that you would like to know what would be the expected revenue from product A if the number of promotions is 12. Then expected revenue given the number of promotion equal 12 can be computed as (Expected revenue when number of promotion is 12) =99060*12 +105827 =1,294,547 4So you would expect the revenue to be roughly 1.3 million yen.

51 Finding the number of promotions that achieve sales goal 4Suppose that you would like achieve the sales of 3,000,000. How many promotions are necessary to achieve this goal? 4To answer this question, simply solve the following equation for X. 3,000,000=99060X+105827 X=29.2 4Therefore, if you would like to achieve at least 3,000,000, you would need to utilize promotion 30 times.

52 Exercise 4Open data “OLS Exercise 1-Promotion and Sales”. Plot the relationship between number of promotion and revenue for product A and product B. 4Estimate the following equation (revenue)= β 0 +β 1 (number of promotion) separately for product A and Product B using OLS. 4Are the effect of promotion different for product A and Product B? 4What would be the revenue from Product B if the number of promotion is 12. 4Suppose the sale goal from product B is 1,000,000.How many promotions are necessary to achieve this goal?

53 More Topics on Ordinary Least Square Estimations Above graph shows a relationship between advertisement cost and revenue along with the estimated linear equation. The estimated slope coefficient is 13.4, which means that every 1000 yen you spend on advertisement, revenue increases by 13.4 thousand yen. Next Page

54 More Topics on Ordinary Least Square Estimations However, the graph seems to indicate that there is not much relationship between advertisement spending and revenue. When we estimate linear equation, we typically would like to know if advertisement has any effect on the revenue at all. To answer such a question, just estimating β 0 and β 1 is not enough. We need more information.

55 More Topics on Ordinary Least Square Estimations To answer the following question, “Would the advertisement have any impact on the revenue?”, we use the concept of “hypothesis testing” using “t-statistics”. This is the topic for the next class.

56 Topics to be covered next week 4We will cover several more topics on ordinary least square estimation, which include 1.Testing whether advertisement spending has any effect on revenue, using t-statistics. 2.Ordinary Least Square estimation when there are more explanatory variables. 3.Ordinary Least Square estimation when you have a panel data ( repeated observations over time) 4.Analyzing the effect of a policy change (i.e, a new introduction of tax, change in compensation scheme etc) using OLS.


Download ppt "Lecture 3-2 Summarizing Relationships among variables ©"

Similar presentations


Ads by Google