abdullah's picture
Add files using upload-large-folder tool
50deadf verified
raw
history blame
41.4 kB
1
00:00:06,480 --> 00:00:12,100
Last time, I mean Tuesday, we discussed box plot
2
00:00:12,100 --> 00:00:19,540
and we introduced how can we use box plot to
3
00:00:19,540 --> 00:00:24,160
determine if any point is suspected to be an
4
00:00:24,160 --> 00:00:28,280
outlier by using the lower limit and upper limit.
5
00:00:29,460 --> 00:00:32,980
And we mentioned last time that if any point is
6
00:00:32,980 --> 00:00:38,580
below the lower limit or is above the upper limit,
7
00:00:39,200 --> 00:00:43,000
that point is considered to be an outlier. So
8
00:00:43,000 --> 00:00:46,940
that's one of the usage of the backsplat. I mean,
9
00:00:47,000 --> 00:00:51,360
for this specific example, we mentioned last time
10
00:00:51,360 --> 00:00:56,910
27 is an outlier. And also here you can tell also
11
00:00:56,910 --> 00:01:02,770
the data are right skewed because the right tail
12
00:01:02,770 --> 00:01:06,090
exactly is much longer than the left tail. I mean
13
00:01:06,090 --> 00:01:10,450
the distance between or from the median and the
14
00:01:10,450 --> 00:01:14,150
maximum value is bigger or larger than the
15
00:01:14,150 --> 00:01:16,950
distance from the median to the smallest value.
16
00:01:17,450 --> 00:01:20,870
That means the data is not symmetric, it's quite
17
00:01:20,870 --> 00:01:24,050
skewed to the right. In this case, you cannot use
18
00:01:24,050 --> 00:01:29,370
the mean or the range as a measure of spread and
19
00:01:29,370 --> 00:01:31,730
median and, I'm sorry, mean as a measure of
20
00:01:31,730 --> 00:01:36,130
tendency. Because these measures are affected by
21
00:01:36,130 --> 00:01:39,450
outcomes. In this case, you have to use the median
22
00:01:39,450 --> 00:01:43,690
instead of the mean and IQR instead of the range
23
00:01:43,690 --> 00:01:48,090
because IQR is the mid-spread of the data because
24
00:01:48,090 --> 00:01:52,790
we just take the range from Q3 to Q1. That means
25
00:01:52,790 --> 00:01:57,450
we ignore The data below Q1 and data after Q3.
26
00:01:57,970 --> 00:02:01,370
That means IQR is not affected by outlier and it's
27
00:02:01,370 --> 00:02:04,610
better to use it instead of R, of the range.
28
00:02:07,470 --> 00:02:10,950
If the data has an outlier, it's better just to
29
00:02:10,950 --> 00:02:13,990
make a star or circle for the box plot because
30
00:02:13,990 --> 00:02:17,250
this one mentioned that that point is an outlier.
31
00:02:18,390 --> 00:02:21,390
Sometimes outlier is maximum value or the largest
32
00:02:21,390 --> 00:02:25,000
value you have. sometimes maybe the minimum value.
33
00:02:25,520 --> 00:02:28,480
So it depends on the data. For this example, 27,
34
00:02:28,720 --> 00:02:33,360
which was the maximum, is an outlier. But zero is
35
00:02:33,360 --> 00:02:36,520
not outlier in this case, because zero is above
36
00:02:36,520 --> 00:02:41,500
the lower limit. Let's move to the next topic,
37
00:02:42,140 --> 00:02:48,060
which talks about covariance and correlation.
38
00:02:48,960 --> 00:02:51,740
Later, we'll talk in more details about
39
00:02:53,020 --> 00:02:56,060
Correlation and regression, that's when maybe
40
00:02:56,060 --> 00:03:02,840
chapter 11 or 12. But here we just show how can we
41
00:03:02,840 --> 00:03:05,420
compute the covariance of the correlation
42
00:03:05,420 --> 00:03:10,220
coefficient and what's the meaning of that value
43
00:03:10,220 --> 00:03:15,840
we have. The covariance means it measures the
44
00:03:15,840 --> 00:03:21,090
strength of the linear relationship between two
45
00:03:21,090 --> 00:03:25,410
numerical variables. That means if the data set is
46
00:03:25,410 --> 00:03:29,770
numeric, I mean if both variables are numeric, in
47
00:03:29,770 --> 00:03:33,050
this case we can use the covariance to measure the
48
00:03:33,050 --> 00:03:38,390
strength of the linear association or relationship
49
00:03:38,390 --> 00:03:42,310
between two numerical variables. Now the formula
50
00:03:42,310 --> 00:03:45,330
is used to compute the covariance given by this
51
00:03:45,330 --> 00:03:52,540
one. It's summation of the product of xi minus x
52
00:03:52,540 --> 00:03:56,380
bar, yi minus y bar, divided by n minus 1.
53
00:03:59,660 --> 00:04:03,120
So we need first to compute the means of x and y,
54
00:04:03,620 --> 00:04:07,680
then find x minus x bar times y minus y bar, then
55
00:04:07,680 --> 00:04:11,160
sum all of these values, then divide by n minus 1.
56
00:04:12,870 --> 00:04:17,770
The covariance only concerned with the strength of
57
00:04:17,770 --> 00:04:23,370
the relationship. By using the sign of the
58
00:04:23,370 --> 00:04:27,010
covariance, you can tell if there exists positive
59
00:04:27,010 --> 00:04:31,070
or negative relationship between the two
60
00:04:31,070 --> 00:04:33,710
variables. For example, if the covariance between
61
00:04:33,710 --> 00:04:42,760
x and y is positive, that means x and y move In
62
00:04:42,760 --> 00:04:48,080
the same direction. It means that if X goes up, Y
63
00:04:48,080 --> 00:04:52,260
will go in the same position. If X goes down, also
64
00:04:52,260 --> 00:04:55,660
Y goes down. For example, suppose we are
65
00:04:55,660 --> 00:04:57,920
interested in the relationship between consumption
66
00:04:57,920 --> 00:05:02,440
and income. We know that if income increases, if
67
00:05:02,440 --> 00:05:07,160
income goes up, if your salary goes up, that means
68
00:05:07,160 --> 00:05:13,510
consumption also will go up. So that means they go
69
00:05:13,510 --> 00:05:18,650
in the same or move in the same position. So for
70
00:05:18,650 --> 00:05:20,690
sure, the covariance between X and Y should be
71
00:05:20,690 --> 00:05:25,550
positive. On the other hand, if the covariance
72
00:05:25,550 --> 00:05:31,110
between X and Y is negative, that means X goes up.
73
00:05:32,930 --> 00:05:36,370
Y will go to the same, to the opposite direction.
74
00:05:36,590 --> 00:05:40,090
I mean they move to opposite direction. That means
75
00:05:40,090 --> 00:05:42,230
there exists negative relationship between X and
76
00:05:42,230 --> 00:05:47,630
Y. For example, you score in statistics a number
77
00:05:47,630 --> 00:05:55,220
of missing classes. If you miss more classes, it
78
00:05:55,220 --> 00:05:59,860
means your score will go down so as x increases y
79
00:05:59,860 --> 00:06:04,820
will go down so there is positive relationship or
80
00:06:04,820 --> 00:06:08,720
negative relationship between x and y i mean x
81
00:06:08,720 --> 00:06:12,020
goes up the other go in the same direction
82
00:06:12,020 --> 00:06:16,500
sometimes
83
00:06:16,500 --> 00:06:21,800
there is exist no relationship between x and y In
84
00:06:21,800 --> 00:06:24,780
that case, covariance between x and y equals zero.
85
00:06:24,880 --> 00:06:31,320
For example, your score in statistics and your
86
00:06:31,320 --> 00:06:31,700
weight.
87
00:06:34,540 --> 00:06:36,760
It makes sense that there is no relationship
88
00:06:36,760 --> 00:06:42,680
between your weight and your score. In this case,
89
00:06:43,580 --> 00:06:46,760
we are saying x and y are independent. I mean,
90
00:06:46,840 --> 00:06:50,790
they are uncorrelated. Because as one variable
91
00:06:50,790 --> 00:06:56,010
increases, the other maybe go up or go down. Or
92
00:06:56,010 --> 00:06:59,690
maybe constant. So that means there exists no
93
00:06:59,690 --> 00:07:02,390
relationship between the two variables. In that
94
00:07:02,390 --> 00:07:05,950
case, the covariance between x and y equals zero.
95
00:07:06,450 --> 00:07:09,210
Now, by using the covariance, you can determine
96
00:07:09,210 --> 00:07:12,710
the direction of the relationship. I mean, you can
97
00:07:12,710 --> 00:07:14,850
just figure out if the relation is positive or
98
00:07:14,850 --> 00:07:18,980
negative. But you cannot tell exactly the strength
99
00:07:18,980 --> 00:07:22,100
of the relationship. I mean you cannot tell if
100
00:07:22,100 --> 00:07:27,640
they exist. strong moderate or weak relationship
101
00:07:27,640 --> 00:07:31,040
just you can tell there exists positive or
102
00:07:31,040 --> 00:07:33,520
negative or maybe the relationship does not exist
103
00:07:33,520 --> 00:07:36,580
but you cannot tell the exact strength of the
104
00:07:36,580 --> 00:07:40,120
relationship by using the value of the covariance
105
00:07:40,120 --> 00:07:43,060
I mean the size of the covariance does not tell
106
00:07:43,060 --> 00:07:48,520
anything about the strength so generally speaking
107
00:07:48,520 --> 00:07:53,150
covariance between x and y measures the strength
108
00:07:53,150 --> 00:07:58,590
of two numerical variables, and you only tell if
109
00:07:58,590 --> 00:08:01,270
there exists positive or negative relationship,
110
00:08:01,770 --> 00:08:04,510
but you cannot tell anything about the strength of
111
00:08:04,510 --> 00:08:06,910
the relationship. Any questions?
112
00:08:09,610 --> 00:08:15,210
So let me ask you just to summarize what I said so
113
00:08:15,210 --> 00:08:21,100
far. Just give me the summary or conclusion. of
114
00:08:21,100 --> 00:08:24,670
the covariance. The value of the covariance
115
00:08:24,670 --> 00:08:26,810
determine if the relationship between the
116
00:08:26,810 --> 00:08:29,410
variables are positive or negative or there is no
117
00:08:29,410 --> 00:08:31,970
relationship that when the covariance is more than
118
00:08:31,970 --> 00:08:34,170
zero, the meaning that it's positive, the
119
00:08:34,170 --> 00:08:36,930
relationship is positive and one variable go up,
120
00:08:37,290 --> 00:08:39,590
another go up and vice versa. And when the
121
00:08:39,590 --> 00:08:41,810
covariance is less than zero, there is negative
122
00:08:41,810 --> 00:08:44,250
relationship and the meaning that when one
123
00:08:44,250 --> 00:08:47,490
variable go up, the other goes down and vice versa
124
00:08:47,490 --> 00:08:50,550
and when the covariance equals zero, there is no
125
00:08:50,550 --> 00:08:53,350
relationship between the variables. And what's
126
00:08:53,350 --> 00:08:54,930
about the strength?
127
00:08:57,950 --> 00:09:03,450
So just tell the direction, not the strength of
128
00:09:03,450 --> 00:09:08,610
the relationship. Now, in order to determine both
129
00:09:08,610 --> 00:09:12,110
the direction and the strength, we can use the
130
00:09:12,110 --> 00:09:17,580
coefficient of correlation. The coefficient of
131
00:09:17,580 --> 00:09:20,320
correlation measures the relative strength of the
132
00:09:20,320 --> 00:09:22,780
linear relationship between two numerical
133
00:09:22,780 --> 00:09:27,940
variables. The simplest formula that can be used
134
00:09:27,940 --> 00:09:31,220
to compute the correlation coefficient is given by
135
00:09:31,220 --> 00:09:34,440
this one. Maybe this is the easiest formula you
136
00:09:34,440 --> 00:09:38,060
can use. I mean, it's shortcut formula for
137
00:09:38,060 --> 00:09:40,860
computation. There are many other formulas to
138
00:09:40,860 --> 00:09:44,490
compute the correlation. This one is the easiest
139
00:09:44,490 --> 00:09:52,570
one. R is just sum of xy minus n, n is the sample
140
00:09:52,570 --> 00:09:57,570
size, times x bar is the sample mean, y bar is the
141
00:09:57,570 --> 00:10:01,090
sample mean for y, because here we have two
142
00:10:01,090 --> 00:10:06,250
variables, divided by square root, don't forget
143
00:10:06,250 --> 00:10:11,490
the square root, of two quantities. One conserved
144
00:10:11,490 --> 00:10:15,710
for x and the other for y. The first one, sum of x
145
00:10:15,710 --> 00:10:18,850
squared minus nx bar squared. The other one is
146
00:10:18,850 --> 00:10:21,830
similar just for the other variables, sum y
147
00:10:21,830 --> 00:10:26,090
squared minus ny bar squared. So in order to
148
00:10:26,090 --> 00:10:28,650
determine the value of R, we need,
149
00:10:32,170 --> 00:10:35,890
suppose for example, we have x and y, theta x and
150
00:10:35,890 --> 00:10:36,110
y.
151
00:10:40,350 --> 00:10:44,730
x is called explanatory
152
00:10:44,730 --> 00:10:54,390
variable and
153
00:10:54,390 --> 00:11:04,590
y is called response variable
154
00:11:04,590 --> 00:11:07,970
sometimes x is called independent
155
00:11:21,760 --> 00:11:25,320
For example, suppose we are talking about
156
00:11:25,320 --> 00:11:32,280
consumption and
157
00:11:32,280 --> 00:11:36,700
input. And we are interested in the relationship
158
00:11:36,700 --> 00:11:41,360
between these two variables. Now, except for the
159
00:11:41,360 --> 00:11:44,900
variable or the independent, this one affects the
160
00:11:44,900 --> 00:11:49,840
other variable. As we mentioned, as your income
161
00:11:49,840 --> 00:11:53,800
increases, your consumption will go in the same
162
00:11:53,800 --> 00:11:59,580
direction, increases also. Income causes Y, or
163
00:11:59,580 --> 00:12:04,340
income affects Y. In this case, income is your X.
164
00:12:06,180 --> 00:12:07,780
Most of the time we use
165
00:12:10,790 --> 00:12:15,590
And Y for independent. So in this case, the
166
00:12:15,590 --> 00:12:19,370
response variable or your outcome or the dependent
167
00:12:19,370 --> 00:12:23,110
variable is your consumption. So Y is consumption,
168
00:12:23,530 --> 00:12:29,150
X is income. So now in order to determine the
169
00:12:29,150 --> 00:12:32,950
correlation coefficient, we have the data of X and
170
00:12:32,950 --> 00:12:33,210
Y.
171
00:12:36,350 --> 00:12:39,190
The values of X, I mean the number of pairs of X
172
00:12:39,190 --> 00:12:41,990
should be equal to the number of pairs of Y. So if
173
00:12:41,990 --> 00:12:44,930
we have ten observations for X, we should have the
174
00:12:44,930 --> 00:12:50,010
same number of observations for Y. It's pairs. X1,
175
00:12:50,090 --> 00:12:54,750
Y1, X2, Y2, and so on. Now, the formula to compute
176
00:12:54,750 --> 00:13:04,170
R, the shortcut formula is sum of XY minus N times
177
00:13:04,970 --> 00:13:09,630
x bar, y bar, divided by the square root of two
178
00:13:09,630 --> 00:13:12,770
quantities. The first one, sum of x squared minus
179
00:13:12,770 --> 00:13:17,270
n x bar. The other one, sum of y squared minus ny
180
00:13:17,270 --> 00:13:21,710
y squared. So the first thing we have to do is to
181
00:13:21,710 --> 00:13:24,210
find the mean for each x and y.
182
00:13:28,230 --> 00:13:37,210
So first step, compute x bar and y bar. Next, if
183
00:13:37,210 --> 00:13:41,690
you look here, we have x and y, x times y. So we
184
00:13:41,690 --> 00:13:48,870
need to compute the product of x times y. So just
185
00:13:48,870 --> 00:13:53,870
for example, suppose x is 10, y is 5. So x times y
186
00:13:53,870 --> 00:13:54,970
is 50.
187
00:13:57,810 --> 00:13:59,950
In addition to that, you have to compute
188
00:14:06,790 --> 00:14:12,470
100 x squared and y squared. It's like 125.
189
00:14:14,810 --> 00:14:18,870
Do the same calculations for the rest of the data
190
00:14:18,870 --> 00:14:22,290
you have. We have other data here, so we have to
191
00:14:22,290 --> 00:14:25,410
compute the same for the others.
192
00:14:28,470 --> 00:14:33,250
Then finally, just add xy, x squared, y squared.
193
00:14:35,910 --> 00:14:40,830
The values you have here in this formula, in order
194
00:14:40,830 --> 00:14:44,830
to compute the coefficient.
195
00:14:54,250 --> 00:15:00,070
Now, this value ranges between minus one and plus
196
00:15:00,070 --> 00:15:00,370
one.
197
00:15:06,520 --> 00:15:10,800
So it's between minus one and plus one. That means
198
00:15:10,800 --> 00:15:15,840
it's never smaller
199
00:15:15,840 --> 00:15:20,200
than minus one or greater than one. It's between
200
00:15:20,200 --> 00:15:21,480
minus one and plus one.
201
00:15:24,360 --> 00:15:28,300
Make sense? I mean if your value is suppose you
202
00:15:28,300 --> 00:15:34,520
did mistake for any of these computations and R
203
00:15:34,520 --> 00:15:41,710
might be 1.15, 115. That means there is an error.
204
00:15:42,270 --> 00:15:45,870
Or for example, if R is negative 1.5, that means
205
00:15:45,870 --> 00:15:49,610
there is a mistake. So you have to find or figure
206
00:15:49,610 --> 00:15:55,670
out what is that mistake. So that's simple
207
00:15:55,670 --> 00:15:59,090
calculations. Usually in the exam, we will give
208
00:15:59,090 --> 00:16:01,350
the formula for the correlation coefficient, as we
209
00:16:01,350 --> 00:16:03,590
mentioned before. In addition to that, we will
210
00:16:03,590 --> 00:16:04,330
give the summation.
211
00:16:07,780 --> 00:16:12,720
The sum of xy is given, sum x squared and sum y
212
00:16:12,720 --> 00:16:18,320
squared. Also sum of x and sum of y, in order to
213
00:16:18,320 --> 00:16:22,320
determine the means of x and y. For example,
214
00:16:22,520 --> 00:16:26,860
suppose I give sum of xi and i goes from 1 to 10
215
00:16:26,860 --> 00:16:31,760
is 700, for example. You have to know that the
216
00:16:31,760 --> 00:16:38,720
sample size is 10, so x bar. is 700 divided by 10,
217
00:16:39,320 --> 00:16:46,180
so it's 7. Then use the curve to compute the
218
00:16:46,180 --> 00:16:52,000
coefficient of correlation. Questions? I think
219
00:16:52,000 --> 00:16:55,900
straightforward, maybe the easiest topic in this
220
00:16:55,900 --> 00:17:02,980
book is to compute the coefficient of correlation
221
00:17:02,980 --> 00:17:09,070
or correlation coefficient. Now my question is, do
222
00:17:09,070 --> 00:17:13,090
you think outliers affect the correlation
223
00:17:13,090 --> 00:17:13,690
coefficient?
224
00:17:17,010 --> 00:17:23,210
We said last time outliers affect the mean, the
225
00:17:23,210 --> 00:17:28,310
range, the variance. Now the question is, do
226
00:17:28,310 --> 00:17:33,510
outliers affect the correlation?
227
00:17:37,410 --> 00:17:38,170
Y.
228
00:17:43,830 --> 00:17:51,330
Exactly. The formula for R has X bar in it or Y
229
00:17:51,330 --> 00:17:56,670
bar. So it means outliers affect
230
00:17:56,670 --> 00:18:01,210
the correlation coefficient. So the answer is yes.
231
00:18:03,470 --> 00:18:06,410
Here we have x bar and y bar. Also, there is
232
00:18:06,410 --> 00:18:10,690
another formula to compute R. That formula is
233
00:18:10,690 --> 00:18:13,370
given by covariance between x and y.
234
00:18:17,510 --> 00:18:21,930
These two formulas are quite similar. I mean, by
235
00:18:21,930 --> 00:18:26,070
using this one, we can end with this formula. So
236
00:18:26,070 --> 00:18:33,090
this formula depends on this x is y. standard
237
00:18:33,090 --> 00:18:36,170
deviations of X and Y. That means outlier will
238
00:18:36,170 --> 00:18:42,530
affect the correlation coefficient. So in case of
239
00:18:42,530 --> 00:18:45,670
outliers, R could be changed.
240
00:18:51,170 --> 00:18:55,530
That formula is called simple correlation
241
00:18:55,530 --> 00:18:58,790
coefficient. On the other hand, we have population
242
00:18:58,790 --> 00:19:02,200
correlation coefficient. If you remember last
243
00:19:02,200 --> 00:19:08,940
time, we used X bar as the sample mean and mu as
244
00:19:08,940 --> 00:19:14,460
population mean. Also, S square as sample variance
245
00:19:14,460 --> 00:19:18,740
and sigma square as population variance. Here, R
246
00:19:18,740 --> 00:19:24,360
is used as sample coefficient of correlation and
247
00:19:24,360 --> 00:19:29,420
rho, this Greek letter pronounced as rho. Rho is
248
00:19:29,420 --> 00:19:35,160
used for population coefficient of correlation.
249
00:19:37,640 --> 00:19:42,040
There are some features of R or Rho. The first one
250
00:19:42,040 --> 00:19:47,960
is unity-free. R or Rho is unity-free. That means
251
00:19:47,960 --> 00:19:54,900
if X represents...
252
00:19:54,900 --> 00:19:58,960
And let's assume that the correlation between X
253
00:19:58,960 --> 00:20:02,040
and Y equals 0.75.
254
00:20:04,680 --> 00:20:07,260
Now, in this case, there is no unity. You cannot
255
00:20:07,260 --> 00:20:13,480
say 0.75 years or 0.75 kilograms. It's unity-free.
256
00:20:13,940 --> 00:20:17,840
There is no unit for the correlation coefficient,
257
00:20:18,020 --> 00:20:21,120
the same as Cv. If you remember Cv, the
258
00:20:21,120 --> 00:20:24,320
coefficient of correlation, also this one is unity
259
00:20:24,320 --> 00:20:30,500
-free. The second feature of R ranges between
260
00:20:30,500 --> 00:20:36,740
minus one and plus one. As I mentioned, R lies
261
00:20:36,740 --> 00:20:42,340
between minus one and plus one. Now, by using the
262
00:20:42,340 --> 00:20:48,100
value of R, you can determine two things. Number
263
00:20:48,100 --> 00:20:53,360
one, we can determine the direction. and strength
264
00:20:53,360 --> 00:20:56,940
by using the sign you can determine if there
265
00:20:56,940 --> 00:21:03,980
exists positive or negative so sign of R determine
266
00:21:03,980 --> 00:21:08,040
negative or positive relationship the direction
267
00:21:08,040 --> 00:21:17,840
the absolute value of R I mean absolute of R I
268
00:21:17,840 --> 00:21:21,980
mean ignore the sign So the absolute value of R
269
00:21:21,980 --> 00:21:24,100
determines the strength.
270
00:21:27,700 --> 00:21:30,760
So by using the sine of R, you can determine the
271
00:21:30,760 --> 00:21:35,680
direction, either positive or negative. By using
272
00:21:35,680 --> 00:21:37,740
the absolute value, you can determine the
273
00:21:37,740 --> 00:21:43,500
strength. We can split the strength into two
274
00:21:43,500 --> 00:21:52,810
parts, either strong, moderate, or weak. So weak,
275
00:21:53,770 --> 00:21:59,130
moderate, and strong by using the absolute value
276
00:21:59,130 --> 00:22:03,870
of R. The closer to minus one, if R is close to
277
00:22:03,870 --> 00:22:07,010
minus one, the stronger the negative relationship
278
00:22:07,010 --> 00:22:09,430
between X and Y. For example, imagine
279
00:22:22,670 --> 00:22:26,130
And as we mentioned, R ranges between minus 1 and
280
00:22:26,130 --> 00:22:26,630
plus 1.
281
00:22:30,070 --> 00:22:35,710
So if R is close to minus 1, it's a strong
282
00:22:35,710 --> 00:22:41,250
relationship. Strong linked relationship. The
283
00:22:41,250 --> 00:22:45,190
closer to 1, the stronger the positive
284
00:22:45,190 --> 00:22:49,230
relationship. I mean, if R is close. Strong
285
00:22:49,230 --> 00:22:54,480
positive. So strong in either direction, either to
286
00:22:54,480 --> 00:22:57,640
the left side or to the right side. Strong
287
00:22:57,640 --> 00:23:00,280
negative. On the other hand, there exists strong
288
00:23:00,280 --> 00:23:05,940
negative relationship. Positive. Positive. If R is
289
00:23:05,940 --> 00:23:10,640
close to zero, weak. Here we can say there exists
290
00:23:10,640 --> 00:23:15,940
weak relationship between X and Y.
291
00:23:19,260 --> 00:23:25,480
If R is close to 0.5 or
292
00:23:25,480 --> 00:23:32,320
minus 0.5, you can say there exists positive
293
00:23:32,320 --> 00:23:38,840
-moderate or negative-moderate relationship. So
294
00:23:38,840 --> 00:23:42,200
you can split or you can divide the strength of
295
00:23:42,200 --> 00:23:44,540
the relationship between X and Y into three parts.
296
00:23:45,860 --> 00:23:50,700
Strong, close to minus one of Plus one, weak,
297
00:23:51,060 --> 00:23:59,580
close to zero, moderate, close to 0.5. 0.5 is
298
00:23:59,580 --> 00:24:04,580
halfway between 0 and 1, and minus 0.5 is also
299
00:24:04,580 --> 00:24:09,040
halfway between minus 1 and 0. Now for example,
300
00:24:09,920 --> 00:24:15,580
what's about if R equals minus 0.5? Suppose R1 is
301
00:24:15,580 --> 00:24:16,500
minus 0.5.
302
00:24:20,180 --> 00:24:27,400
strong negative or equal minus point eight strong
303
00:24:27,400 --> 00:24:33,540
negative which is more strong nine nine because
304
00:24:33,540 --> 00:24:39,670
this value is close closer to minus one than Minus
305
00:24:39,670 --> 00:24:44,070
0.8. Even this value is greater than minus 0.9,
306
00:24:44,530 --> 00:24:50,870
but minus 0.9 is close to minus 1, more closer to
307
00:24:50,870 --> 00:24:56,910
minus 1 than minus 0.8. On the other hand, if R
308
00:24:56,910 --> 00:25:01,190
equals 0.75, that means there exists positive
309
00:25:01,190 --> 00:25:06,970
relationship. If R equals 0.85, also there exists
310
00:25:06,970 --> 00:25:13,540
positive. But R2 is stronger than R1, because 0.85
311
00:25:13,540 --> 00:25:20,980
is closer to plus 1 than 0.7. So we can say that
312
00:25:20,980 --> 00:25:23,960
there exists strong relationship between X and Y,
313
00:25:24,020 --> 00:25:27,260
and this relationship is positive. So again, by
314
00:25:27,260 --> 00:25:32,530
using the sign, you can tell the direction. The
315
00:25:32,530 --> 00:25:35,910
absolute value can tell the strength of the
316
00:25:35,910 --> 00:25:39,870
relationship between X and Y. So there are five
317
00:25:39,870 --> 00:25:44,150
features of R, unity-free. Ranges between minus
318
00:25:44,150 --> 00:25:47,750
one and plus one. Closer to minus one, it means
319
00:25:47,750 --> 00:25:51,950
stronger negative. Closer to plus one, stronger
320
00:25:51,950 --> 00:25:56,410
positive. Close to zero, it means there is no
321
00:25:56,410 --> 00:26:00,790
relationship. Or the weaker, the relationship
322
00:26:00,790 --> 00:26:13,240
between X and Y. By using scatter plots, we
323
00:26:13,240 --> 00:26:18,160
can construct a scatter plot by plotting the Y
324
00:26:18,160 --> 00:26:24,060
values versus the X values. Y in the vertical axis
325
00:26:24,060 --> 00:26:28,400
and X in the horizontal axis. If you look
326
00:26:28,400 --> 00:26:34,500
carefully at graph number one and three, We see
327
00:26:34,500 --> 00:26:42,540
that all the points lie on the straight line,
328
00:26:44,060 --> 00:26:48,880
either this way or the other way. If all the
329
00:26:48,880 --> 00:26:52,320
points lie on the straight line, it means they
330
00:26:52,320 --> 00:26:56,970
exist perfectly. not even strong it's perfect
331
00:26:56,970 --> 00:27:02,710
relationship either negative or positive so this
332
00:27:02,710 --> 00:27:07,530
one perfect negative negative
333
00:27:07,530 --> 00:27:14,090
because x increases y goes down decline so if x is
334
00:27:14,090 --> 00:27:19,590
for example five maybe y is supposed to twenty if
335
00:27:19,590 --> 00:27:25,510
x increased to seven maybe y is fifteen So if X
336
00:27:25,510 --> 00:27:29,290
increases, in this case, Y declines or decreases,
337
00:27:29,850 --> 00:27:34,290
it means there exists negative relationship. On
338
00:27:34,290 --> 00:27:40,970
the other hand, the left corner here, positive
339
00:27:40,970 --> 00:27:44,710
relationship, because X increases, Y also goes up.
340
00:27:45,970 --> 00:27:48,990
And perfect, because all the points lie on the
341
00:27:48,990 --> 00:27:52,110
straight line. So it's perfect, positive, perfect,
342
00:27:52,250 --> 00:27:57,350
negative relationship. So it's straightforward to
343
00:27:57,350 --> 00:27:59,550
determine if it's perfect by using scatterplot.
344
00:28:02,230 --> 00:28:04,950
Also, by scatterplot, you can tell the direction
345
00:28:04,950 --> 00:28:09,270
of the relationship. For the second scatterplot,
346
00:28:09,630 --> 00:28:12,270
it seems to be that there exists negative
347
00:28:12,270 --> 00:28:13,730
relationship between X and Y.
348
00:28:16,850 --> 00:28:21,030
In this one, also there exists a relationship
349
00:28:24,730 --> 00:28:32,170
positive which one is strong more strong this
350
00:28:32,170 --> 00:28:37,110
one is stronger because the points are close to
351
00:28:37,110 --> 00:28:40,710
the straight line much more than the other scatter
352
00:28:40,710 --> 00:28:43,410
plot so you can say there exists negative
353
00:28:43,410 --> 00:28:45,810
relationship but that one is stronger than the
354
00:28:45,810 --> 00:28:49,550
other one this one is positive but the points are
355
00:28:49,550 --> 00:28:55,400
scattered around the straight line so you can tell
356
00:28:55,400 --> 00:29:00,000
the direction and sometimes sometimes not all the
357
00:29:00,000 --> 00:29:04,640
time you can tell the strength sometimes it's very
358
00:29:04,640 --> 00:29:07,960
clear that the relation is strong if the points
359
00:29:07,960 --> 00:29:11,480
are very close straight line that means the
360
00:29:11,480 --> 00:29:15,940
relation is strong now the other one the last one
361
00:29:15,940 --> 00:29:23,850
here As X increases, Y stays at the same value.
362
00:29:23,970 --> 00:29:29,450
For example, if Y is 20 and X is 1. X is 1, Y is
363
00:29:29,450 --> 00:29:33,870
20. X increases to 2, for example. Y is still 20.
364
00:29:34,650 --> 00:29:37,230
So that means there is no relationship between X
365
00:29:37,230 --> 00:29:41,830
and Y. It's a constant. Y equals a constant value.
366
00:29:42,690 --> 00:29:50,490
Whatever X is, Y will have constant value. So that
367
00:29:50,490 --> 00:29:54,790
means there is no relationship between X and Y.
368
00:29:56,490 --> 00:30:01,850
Let's see how can we compute the correlation
369
00:30:01,850 --> 00:30:07,530
between two variables. For example, suppose we
370
00:30:07,530 --> 00:30:12,150
have data for father's height and son's height.
371
00:30:13,370 --> 00:30:16,510
And we are interested to see if father's height
372
00:30:16,510 --> 00:30:21,730
affects his son's height. So we have data for 10
373
00:30:21,730 --> 00:30:28,610
observations here. Father number one, his height
374
00:30:28,610 --> 00:30:38,570
is 64 inches. And you know that inch equals 2
375
00:30:38,570 --> 00:30:39,230
.5.
376
00:30:43,520 --> 00:30:52,920
So X is 64, Sun's height is 65. X is 68, Sun's
377
00:30:52,920 --> 00:30:58,820
height is 67 and so on. Sometimes, if the dataset
378
00:30:58,820 --> 00:31:02,600
is small enough, as in this example, we have just
379
00:31:02,600 --> 00:31:08,640
10 observations, you can tell the direction. I
380
00:31:08,640 --> 00:31:12,060
mean, you can say, yes, for this specific example,
381
00:31:12,580 --> 00:31:15,280
there exists positive relationship between x and
382
00:31:15,280 --> 00:31:20,820
y. But if the data set is large, it's very hard to
383
00:31:20,820 --> 00:31:22,620
figure out if the relation is positive or
384
00:31:22,620 --> 00:31:26,400
negative. So we have to find or to compute the
385
00:31:26,400 --> 00:31:29,700
coefficient of correlation in order to see there
386
00:31:29,700 --> 00:31:32,940
exists positive, negative, strong, weak, or
387
00:31:32,940 --> 00:31:37,820
moderate. but again you can tell from this simple
388
00:31:37,820 --> 00:31:40,280
example yes there is a positive relationship
389
00:31:40,280 --> 00:31:44,660
because just if you pick random numbers here for
390
00:31:44,660 --> 00:31:49,240
example 64 father's height his son's height 65 if
391
00:31:49,240 --> 00:31:54,600
we move up here to 70 for father's height his
392
00:31:54,600 --> 00:32:00,160
son's height is going to be 72 so as father
393
00:32:00,160 --> 00:32:05,020
heights increases Also, son's height increases.
394
00:32:06,320 --> 00:32:11,700
For example, 77, father's height. His son's height
395
00:32:11,700 --> 00:32:15,160
is 76. So that means there exists positive
396
00:32:15,160 --> 00:32:19,740
relationship. Make sense? But again, for large
397
00:32:19,740 --> 00:32:20,780
data, you cannot tell that.
398
00:32:31,710 --> 00:32:36,090
If, again, by using this data, small data, you can
399
00:32:36,090 --> 00:32:40,730
determine just the length, the strength, I'm
400
00:32:40,730 --> 00:32:43,490
sorry, the strength of a relationship or the
401
00:32:43,490 --> 00:32:47,590
direction of the relationship. Just pick any
402
00:32:47,590 --> 00:32:51,030
number at random. For example, if we pick this
403
00:32:51,030 --> 00:32:51,290
number.
404
00:32:55,050 --> 00:33:00,180
Father's height is 68, his son's height is 70. Now
405
00:33:00,180 --> 00:33:02,180
suppose we pick another number that is greater
406
00:33:02,180 --> 00:33:05,840
than 68, then let's see what will happen. For
407
00:33:05,840 --> 00:33:11,060
father's height 70, his son's height increases up
408
00:33:11,060 --> 00:33:17,160
to 72. Similarly, 72 father's height, his son's
409
00:33:17,160 --> 00:33:22,060
height 75. So that means X increases, Y also
410
00:33:22,060 --> 00:33:25,740
increases. So that means there exists both of
411
00:33:25,740 --> 00:33:32,570
them. For sure it is hard to tell this direction
412
00:33:32,570 --> 00:33:36,130
if the data is large. Because maybe you will find
413
00:33:36,130 --> 00:33:40,250
as X increases for one point, Y maybe decreases
414
00:33:40,250 --> 00:33:43,610
for that point. So it depends on the data you
415
00:33:43,610 --> 00:33:49,010
have. Anyway, let's see how can we compute R. I
416
00:33:49,010 --> 00:33:53,770
will use Excel to show how can we do these
417
00:33:53,770 --> 00:33:54,550
calculations.
418
00:34:02,110 --> 00:34:06,530
The screen is clear. But give me the data of X and
419
00:34:06,530 --> 00:34:06,750
Y.
420
00:34:10,710 --> 00:34:14,310
X is 64. 68.
421
00:34:18,910 --> 00:34:26,830
68. 78. There is one 68. 78. 74.
422
00:34:31,120 --> 00:34:37,600
Seventy-four. Seventy-five. Seventy-six.
423
00:34:38,360 --> 00:34:42,240
Seventy-seven. Seventy-five. So that's the values
424
00:34:42,240 --> 00:34:49,440
of X, Y values. Seventy. Seventy-five. Seventy
425
00:34:49,440 --> 00:34:49,800
-seven.
426
00:35:17,230 --> 00:35:23,730
So first we have to compute it. x times y so
427
00:35:23,730 --> 00:35:28,270
that's as x times
428
00:35:28,270 --> 00:35:38,230
the value of y so 46 times 65 equals 4160 x
429
00:35:38,230 --> 00:35:46,050
squared so this value squared for y squared 65
430
00:35:48,660 --> 00:35:53,700
Square and we have to do this one for the rest of
431
00:35:53,700 --> 00:36:03,160
the data So
432
00:36:03,160 --> 00:36:07,600
that's the sum of XY sum X squared and Y squared
433
00:36:07,600 --> 00:36:13,480
now the summation So
434
00:36:13,480 --> 00:36:17,180
that's the sum of X and Y
435
00:36:20,380 --> 00:36:27,040
We have to compute the mean of x and y. So that is
436
00:36:27,040 --> 00:36:31,380
this sum divided by n, where n is 10 in this case.
437
00:36:34,600 --> 00:36:36,100
So this is the first step.
438
00:36:41,820 --> 00:36:48,900
Let's see how can we compute R. R, we have sum of
439
00:36:48,900 --> 00:37:00,780
x, y. minus n is 10 times x bar times y bar. This
440
00:37:00,780 --> 00:37:03,100
is the first quantity. The other one is square
441
00:37:03,100 --> 00:37:08,580
root of sum
442
00:37:08,580 --> 00:37:15,420
x squared minus n x bar squared.
443
00:37:18,830 --> 00:37:24,770
times some y squared minus n times y bar squared.
444
00:37:28,930 --> 00:37:34,090
And we have to find the square root of this value.
445
00:37:34,210 --> 00:37:40,810
So square root, that will give this result. So now
446
00:37:40,810 --> 00:37:46,990
R equals this value divided by
447
00:37:49,670 --> 00:37:54,890
155 and round always to two decimal places will
448
00:37:54,890 --> 00:38:05,590
give 87 so r is 87 so first step we have x and y
449
00:38:05,590 --> 00:38:12,470
compute xy x squared y squared sum of these all of
450
00:38:12,470 --> 00:38:18,100
these then x bar y bar values are given Then just
451
00:38:18,100 --> 00:38:20,820
use the formula you have, we'll get R to be at
452
00:38:20,820 --> 00:38:31,540
seven. So in this case, if we just go back to
453
00:38:31,540 --> 00:38:33,400
the slide we have here.
454
00:38:36,440 --> 00:38:41,380
As we mentioned, father's height is the
455
00:38:41,380 --> 00:38:45,640
explanatory variable. Son's height is the response
456
00:38:45,640 --> 00:38:46,060
variable.
457
00:38:49,190 --> 00:38:52,810
And that simple calculation gives summation of xi,
458
00:38:54,050 --> 00:38:57,810
summation of yi, summation x squared, y squared,
459
00:38:57,970 --> 00:39:02,690
and some xy. And finally, we'll get that result,
460
00:39:02,850 --> 00:39:07,850
87%. Now, the sign is positive. That means there
461
00:39:07,850 --> 00:39:13,960
exists positive. And 0.87 is close to 1. That
462
00:39:13,960 --> 00:39:17,320
means there exists strong positive relationship
463
00:39:17,320 --> 00:39:22,480
between father's and son's height. I think the
464
00:39:22,480 --> 00:39:25,060
calculation is straightforward.
465
00:39:27,280 --> 00:39:33,280
Now, for this example, the data are given in
466
00:39:33,280 --> 00:39:37,460
inches. I mean father's and son's height in inch.
467
00:39:38,730 --> 00:39:41,050
Suppose we want to convert from inch to
468
00:39:41,050 --> 00:39:44,750
centimeter, so we have to multiply by 2. Do you
469
00:39:44,750 --> 00:39:52,050
think in this case, R will change? So if we add or
470
00:39:52,050 --> 00:39:59,910
multiply or divide, R will not change? I mean, if
471
00:39:59,910 --> 00:40:06,880
we have X values, And we divide or multiply X, I
472
00:40:06,880 --> 00:40:09,460
mean each value of X, by a number, by a fixed
473
00:40:09,460 --> 00:40:12,600
value. For example, suppose here we multiplied
474
00:40:12,600 --> 00:40:19,460
each value by 2.5 for X. Also multiply Y by the
475
00:40:19,460 --> 00:40:24,520
same value, 2.5. Y will be the same. In addition
476
00:40:24,520 --> 00:40:28,920
to that, if we multiply X by 2.5, for example, and
477
00:40:28,920 --> 00:40:34,960
Y by 5, also R will not change. But you have to be
478
00:40:34,960 --> 00:40:39,400
careful. We multiply each value of x by the same
479
00:40:39,400 --> 00:40:45,700
number. And each value of y by the same number,
480
00:40:45,820 --> 00:40:49,640
that number may be different from x. So I mean
481
00:40:49,640 --> 00:40:56,540
multiply x by 2.5 and y by minus 1 or plus 2 or
482
00:40:56,540 --> 00:41:01,000
whatever you have. But if it's negative, then
483
00:41:01,000 --> 00:41:05,640
we'll get negative answer. I mean if Y is
484
00:41:05,640 --> 00:41:08,060
positive, for example, and we multiply each value
485
00:41:08,060 --> 00:41:13,000
Y by minus one, that will give negative sign. But
486
00:41:13,000 --> 00:41:17,640
here I meant if we multiply this value by positive
487
00:41:17,640 --> 00:41:21,320
sign, plus two, plus three, and let's see how can
488
00:41:21,320 --> 00:41:22,540
we do that by Excel.
489
00:41:26,320 --> 00:41:31,480
Now this is the data we have. I just make copy.
490
00:41:37,730 --> 00:41:45,190
I will multiply each value X by 2.5. And I will do
491
00:41:45,190 --> 00:41:49,590
the same for Y
492
00:41:49,590 --> 00:41:57,190
value. I will replace this data by the new one.
493
00:41:58,070 --> 00:42:00,410
For sure the calculations will, the computations
494
00:42:00,410 --> 00:42:09,740
here will change, but R will stay the same. So
495
00:42:09,740 --> 00:42:14,620
here we multiply each x by 2.5 and the same for y.
496
00:42:15,540 --> 00:42:19,400
The calculations here are different. We have
497
00:42:19,400 --> 00:42:22,960
different sum, different sum of x, sum of y and so
498
00:42:22,960 --> 00:42:31,040
on, but are the same. Let's see if we multiply
499
00:42:31,040 --> 00:42:38,880
just x by 2.5 and y the same.
500
00:42:41,840 --> 00:42:49,360
So we multiplied x by 2.5 and we keep it make
501
00:42:49,360 --> 00:42:57,840
sense? Now let's see how outliers will affect the
502
00:42:57,840 --> 00:43:03,260
value of R. Let's say if we change one point in
503
00:43:03,260 --> 00:43:08,480
the data set support. I just changed 64.
504
00:43:13,750 --> 00:43:24,350
for example if just by typo and just enter 6 so it
505
00:43:24,350 --> 00:43:33,510
was 87 it becomes 0.7 so there is a big difference
506
00:43:33,510 --> 00:43:38,670
between 0.87 and 0.7 and just we change one value
507
00:43:38,670 --> 00:43:45,920
now suppose the other one is zero 82. The other is
508
00:43:45,920 --> 00:43:48,260
2, for example. 1.
509
00:43:53,380 --> 00:43:59,200
I just changed half of the data. Now R was 87, it
510
00:43:59,200 --> 00:44:02,920
becomes 59. That means these outliers, these
511
00:44:02,920 --> 00:44:06,180
values for sure are outliers and they fit the
512
00:44:06,180 --> 00:44:07,060
correlation coefficient.
513
00:44:11,110 --> 00:44:14,970
Now let's see if we just change this 1 to be 200.
514
00:44:15,870 --> 00:44:20,430
It will go from 50 to up to 63. That means any
515
00:44:20,430 --> 00:44:26,010
changes in x or y values will change the y. But if
516
00:44:26,010 --> 00:44:30,070
we add or multiply all the values by a constant, r
517
00:44:30,070 --> 00:44:31,170
will stay the same.
518
00:44:35,250 --> 00:44:43,590
Any questions? That's the end of chapter 3. I will
519
00:44:43,590 --> 00:44:48,990
move quickly to the practice problems we have. And
520
00:44:48,990 --> 00:44:55,270
we posted the practice in the course website.