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 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1
00:00:15,580 --> 00:00:19,700
In general, the regression equation is given by

2
00:00:19,700 --> 00:00:26,460
this equation. Y represents the dependent variable

3
00:00:26,460 --> 00:00:30,680
for each observation I. Beta 0 is called

4
00:00:30,680 --> 00:00:35,280
population Y intercept. Beta 1 is the population

5
00:00:35,280 --> 00:00:39,400
stop coefficient. Xi is the independent variable

6
00:00:39,400 --> 00:00:44,040
for each observation, I. Epsilon I is the random

7
00:00:44,040 --> 00:00:48,420
error theorem. Beta 0 plus beta 1 X is called

8
00:00:48,420 --> 00:00:53,410
linear component. While Y and I are random error

9
00:00:53,410 --> 00:00:57,130
components. So, the regression equation mainly has

10
00:00:57,130 --> 00:01:01,970
two components. One is linear and the other is

11
00:01:01,970 --> 00:01:05,830
random. In general, the expected value for this

12
00:01:05,830 --> 00:01:08,810
error term is zero. So, for the predicted

13
00:01:08,810 --> 00:01:12,410
equation, later we will see that Y hat equals B

14
00:01:12,410 --> 00:01:15,930
zero plus B one X.this term will be ignored

15
00:01:15,930 --> 00:01:19,770
because the expected value for the epsilon equals

16
00:01:19,770 --> 00:01:20,850
zero.

17
00:01:36,460 --> 00:01:43,580
So again linear component B0 plus B1 X I and the

18
00:01:43,580 --> 00:01:46,860
random component is the epsilon term.

19
00:01:48,880 --> 00:01:53,560
So if we have X and Y axis, this segment is called

20
00:01:53,560 --> 00:01:57,620
Y intercept which is B0. The change in y divided

21
00:01:57,620 --> 00:02:01,480
by change in x is called the slope. Epsilon i is

22
00:02:01,480 --> 00:02:04,480
the difference between the observed value of y

23
00:02:04,480 --> 00:02:10,400
minus the expected value or the predicted value.

24
00:02:10,800 --> 00:02:14,200
The observed is the actual value. So actual minus

25
00:02:14,200 --> 00:02:17,480
predicted, the difference between these two values

26
00:02:17,480 --> 00:02:20,800
is called the epsilon. So epsilon i is the

27
00:02:20,800 --> 00:02:24,460
difference between the observed value of y for x,

28
00:02:25,220 --> 00:02:28,820
minus the predicted or the estimated value of Y

29
00:02:28,820 --> 00:02:33,360
for XR. So this difference actually is called the

30
00:02:33,360 --> 00:02:36,920
error tier. So the error is just observed minus

31
00:02:36,920 --> 00:02:38,240
predicted.

32
00:02:40,980 --> 00:02:44,540
The estimated regression equation is given by Y

33
00:02:44,540 --> 00:02:50,210
hat equals V0 plus V1X. as i mentioned before the

34
00:02:50,210 --> 00:02:53,450
epsilon term is cancelled because the expected

35
00:02:53,450 --> 00:02:57,590
value for the epsilon equals zero here we have y

36
00:02:57,590 --> 00:03:00,790
hat instead of y because this one is called the

37
00:03:00,790 --> 00:03:05,670
estimated or the predicted value for y for the

38
00:03:05,670 --> 00:03:09,670
observation i for example b zero is the estimated

39
00:03:09,670 --> 00:03:12,590
of the regression intercept or is called y

40
00:03:12,590 --> 00:03:18,030
intercept b one the estimate of the regression of

41
00:03:18,030 --> 00:03:21,930
the slope so this is the estimated slope b1 xi

42
00:03:21,930 --> 00:03:26,270
again is the independent variable so x1 It means

43
00:03:26,270 --> 00:03:28,630
the value of the independent variable for

44
00:03:28,630 --> 00:03:31,350
observation number one. Now this equation is

45
00:03:31,350 --> 00:03:34,530
called linear regression equation or regression

46
00:03:34,530 --> 00:03:37,230
model. It's a straight line because here we are

47
00:03:37,230 --> 00:03:41,170
assuming that the relationship between x and y is

48
00:03:41,170 --> 00:03:43,490
linear. It could be non-linear, but we are

49
00:03:43,490 --> 00:03:48,760
focusing here in just linear regression. Now, the

50
00:03:48,760 --> 00:03:52,000
values for B0 and B1 are given by these equations,

51
00:03:52,920 --> 00:03:56,480
B1 equals RSY divided by SX. So, in order to

52
00:03:56,480 --> 00:04:01,040
determine the values of B0 and B1, we have to know

53
00:04:01,040 --> 00:04:07,760
first the value of R, the correlation coefficient.

54
00:04:16,640 --> 00:04:24,980
Sx and Sy, standard deviations of x and y, as well

55
00:04:24,980 --> 00:04:29,880
as the means of x and y.

56
00:04:32,920 --> 00:04:39,500
B1 equals R times Sy divided by Sx. B0 is just y

57
00:04:39,500 --> 00:04:43,600
bar minus b1 x bar, where Sx and Sy are the

58
00:04:43,600 --> 00:04:48,350
standard deviations of x and y. So this, how can

59
00:04:48,350 --> 00:04:53,190
we compute the values of B0 and B1? Now the

60
00:04:53,190 --> 00:04:59,350
question is, what's our interpretation about B0

61
00:04:59,350 --> 00:05:05,030
and B1? And B0, as we mentioned before, is the Y

62
00:05:05,030 --> 00:05:10,510
or the estimated mean value of Y when the value X

63
00:05:10,510 --> 00:05:10,910
is 0.

64
00:05:17,420 --> 00:05:22,860
So if X is 0, then Y hat equals B0. That means B0

65
00:05:22,860 --> 00:05:26,420
is the estimated mean value of Y when the value of

66
00:05:26,420 --> 00:05:32,280
X equals 0. B1, which is called the estimated

67
00:05:32,280 --> 00:05:36,880
change in the mean value of Y as a result of one

68
00:05:36,880 --> 00:05:42,360
unit change in X. That means the sign of B1,

69
00:05:48,180 --> 00:05:55,180
the direction of the relationship between X and Y.

70
00:06:03,020 --> 00:06:09,060
So the sine of B1 tells us the exact direction. It

71
00:06:09,060 --> 00:06:12,300
could be positive if the sine of B1 is positive or

72
00:06:12,300 --> 00:06:17,040
negative. on the other side. So that's the meaning

73
00:06:17,040 --> 00:06:22,040
of B0 and B1. Now first thing we have to do in

74
00:06:22,040 --> 00:06:23,980
order to determine if there exists linear

75
00:06:23,980 --> 00:06:26,800
relationship between X and Y, we have to draw

76
00:06:26,800 --> 00:06:30,620
scatter plot, Y versus X. In this specific

77
00:06:30,620 --> 00:06:34,740
example, X is the square feet, size of the house

78
00:06:34,740 --> 00:06:38,760
is measured by square feet, and house selling

79
00:06:38,760 --> 00:06:43,220
price in thousand dollars. So we have to draw Y

80
00:06:43,220 --> 00:06:47,420
versus X. So house price versus size of the house.

81
00:06:48,140 --> 00:06:50,740
Now by looking carefully at this scatter plot,

82
00:06:51,340 --> 00:06:54,200
even if it's a small sample size, but you can see

83
00:06:54,200 --> 00:06:57,160
that there exists positive relationship between

84
00:06:57,160 --> 00:07:02,640
house price and size of the house. The points

85
00:07:03,750 --> 00:07:06,170
Maybe they are close little bit to the straight

86
00:07:06,170 --> 00:07:08,370
line, it means there exists maybe strong

87
00:07:08,370 --> 00:07:11,350
relationship between X and Y. But you can tell the

88
00:07:11,350 --> 00:07:15,910
exact strength of the relationship by using the

89
00:07:15,910 --> 00:07:19,270
value of R. But here we can tell that there exists

90
00:07:19,270 --> 00:07:22,290
positive relationship and that relation could be

91
00:07:22,290 --> 00:07:23,250
strong.

92
00:07:25,730 --> 00:07:31,350
Now simple calculations will give B1 and B0.

93
00:07:32,210 --> 00:07:37,510
Suppose we know the values of R, Sy, and Sx. R, if

94
00:07:37,510 --> 00:07:41,550
you remember last time, R was 0.762. It's moderate

95
00:07:41,550 --> 00:07:46,390
relationship between X and Y. Sy and Sx, 60

96
00:07:46,390 --> 00:07:52,350
divided by 4 is 117. That will give 0.109. So B0,

97
00:07:53,250 --> 00:07:59,430
in this case, 0.10977, B1.

98
00:08:02,960 --> 00:08:08,720
B0 equals Y bar minus B1 X bar. B1 is computed in

99
00:08:08,720 --> 00:08:12,680
the previous step, so plug that value here. In

100
00:08:12,680 --> 00:08:15,440
addition, we know the values of X bar and Y bar.

101
00:08:15,980 --> 00:08:19,320
Simple calculation will give the value of B0,

102
00:08:19,400 --> 00:08:25,340
which is about 98.25. After computing the values

103
00:08:25,340 --> 00:08:30,600
of B0 and B1, we can state the regression equation

104
00:08:30,600 --> 00:08:34,360
by house price, the estimated value of house

105
00:08:34,360 --> 00:08:39,960
price. Hat in this equation means the estimated or

106
00:08:39,960 --> 00:08:43,860
the predicted value of the house price. Equals b0

107
00:08:43,860 --> 00:08:49,980
which is 98 plus b1 which is 0.10977 times square

108
00:08:49,980 --> 00:08:54,420
feet. Now here, by using this equation, we can

109
00:08:54,420 --> 00:08:58,280
tell number one. The direction of the relationship

110
00:08:58,280 --> 00:09:03,620
between x and y, how surprised and its size. Since

111
00:09:03,620 --> 00:09:05,900
the sign is positive, it means there exists

112
00:09:05,900 --> 00:09:09,000
positive associations or relationship between

113
00:09:09,000 --> 00:09:12,420
these two variables, number one. Number two, we

114
00:09:12,420 --> 00:09:17,060
can interpret carefully the meaning of the

115
00:09:17,060 --> 00:09:21,340
intercept. Now, as we mentioned before, y hat

116
00:09:21,340 --> 00:09:25,600
equals b zero only if x equals zero. Now there is

117
00:09:25,600 --> 00:09:28,900
no sense about square feet of zero because we

118
00:09:28,900 --> 00:09:32,960
don't have a size of a house to be zero. But the

119
00:09:32,960 --> 00:09:37,880
slope here is 0.109, it has sense because as the

120
00:09:37,880 --> 00:09:41,450
size of the house increased by one unit. it's

121
00:09:41,450 --> 00:09:46,290
selling price increased by this amount 0.109 but

122
00:09:46,290 --> 00:09:48,990
here you have to be careful to multiply this value

123
00:09:48,990 --> 00:09:52,610
by a thousand because the data is given in

124
00:09:52,610 --> 00:09:56,830
thousand dollars for Y so here as the size of the

125
00:09:56,830 --> 00:10:00,590
house increased by one unit by one feet one square

126
00:10:00,590 --> 00:10:05,310
feet it's selling price increases by this amount 0

127
00:10:05,310 --> 00:10:10,110
.10977 should be multiplied by a thousand so

128
00:10:10,110 --> 00:10:18,560
around $109.77. So that means extra one square

129
00:10:18,560 --> 00:10:24,040
feet for the size of the house, it cost you around

130
00:10:24,040 --> 00:10:30,960
$100 or $110. So that's the meaning of B1 and the

131
00:10:30,960 --> 00:10:35,060
sign actually of the slope. In addition to that,

132
00:10:35,140 --> 00:10:39,340
we can make some predictions about house price for

133
00:10:39,340 --> 00:10:42,900
any given value of the size of the house. That

134
00:10:42,900 --> 00:10:46,940
means if you know that the house size equals 2,000

135
00:10:46,940 --> 00:10:50,580
square feet. So just plug this value here and

136
00:10:50,580 --> 00:10:54,100
simple calculation will give the predicted value

137
00:10:54,100 --> 00:10:58,230
of the ceiling price of a house. That's the whole

138
00:10:58,230 --> 00:11:03,950
story for the simple linear regression. In other

139
00:11:03,950 --> 00:11:08,030
words, we have this equation, so the

140
00:11:08,030 --> 00:11:12,690
interpretation of B0 again. B0 is the estimated

141
00:11:12,690 --> 00:11:16,110
mean value of Y when the value of X is 0. That

142
00:11:16,110 --> 00:11:20,700
means if X is 0, in this range of the observed X

143
00:11:20,700 --> 00:11:24,540
-values. That's the meaning of the B0. But again,

144
00:11:24,820 --> 00:11:27,700
because a house cannot have a square footage of

145
00:11:27,700 --> 00:11:31,680
zero, so B0 has no practical application.

146
00:11:34,740 --> 00:11:38,760
On the other hand, the interpretation for B1, B1

147
00:11:38,760 --> 00:11:43,920
equals 0.10977, that means B1 again estimates the

148
00:11:43,920 --> 00:11:46,880
change in the mean value of Y as a result of one

149
00:11:46,880 --> 00:11:51,160
unit increase in X. In other words, since B1

150
00:11:51,160 --> 00:11:55,680
equals 0.10977, that tells us that the mean value

151
00:11:55,680 --> 00:12:02,030
of a house Increases by this amount, multiplied by

152
00:12:02,030 --> 00:12:05,730
1,000 on average for each additional one square

153
00:12:05,730 --> 00:12:09,690
foot of size. So that's the exact interpretation

154
00:12:09,690 --> 00:12:14,630
about P0 and P1. For the prediction, as I

155
00:12:14,630 --> 00:12:18,430
mentioned, since we have this equation, and our

156
00:12:18,430 --> 00:12:21,530
goal is to predict the price for a house with 2

157
00:12:21,530 --> 00:12:25,450
,000 square feet, just plug this value here.

158
00:12:26,450 --> 00:12:31,130
Multiply this value by 0.1098, then add the result

159
00:12:31,130 --> 00:12:37,750
to 98.25 will give 317.85. This value should be

160
00:12:37,750 --> 00:12:41,590
multiplied by 1000, so the predicted price for a

161
00:12:41,590 --> 00:12:49,050
house with 2000 square feet is around 317,850

162
00:12:49,050 --> 00:12:54,910
dollars. That's for making the prediction for

163
00:12:54,910 --> 00:13:02,050
selling a price. The last section in chapter 12

164
00:13:02,050 --> 00:13:07,550
talks about coefficient of determination R

165
00:13:07,550 --> 00:13:11,550
squared. The definition for the coefficient of

166
00:13:11,550 --> 00:13:16,190
determination is the portion of the total

167
00:13:16,190 --> 00:13:19,330
variation in the dependent variable that is

168
00:13:19,330 --> 00:13:21,730
explained by the variation in the independent

169
00:13:21,730 --> 00:13:25,130
variable. Since we have two variables X and Y.

170
00:13:29,510 --> 00:13:34,490
And the question is, what's the portion of the

171
00:13:34,490 --> 00:13:39,530
total variation that can be explained by X? So the

172
00:13:39,530 --> 00:13:42,030
question is, what's the portion of the total

173
00:13:42,030 --> 00:13:46,070
variation in Y that is explained already by the

174
00:13:46,070 --> 00:13:54,450
variation in X? For example, suppose R² is 90%, 0

175
00:13:54,450 --> 00:13:59,770
.90. That means 90% in the variation of the

176
00:13:59,770 --> 00:14:05,700
selling price is explained by its size. That means

177
00:14:05,700 --> 00:14:12,580
the size of the house contributes about 90% to

178
00:14:12,580 --> 00:14:17,700
explain the variability of the selling price. So

179
00:14:17,700 --> 00:14:20,460
we would like to have R squared to be large

180
00:14:20,460 --> 00:14:26,620
enough. Now, R squared for simple regression only

181
00:14:26,620 --> 00:14:30,200
is given by this equation, correlation between X

182
00:14:30,200 --> 00:14:31,100
and Y squared.

183
00:14:34,090 --> 00:14:36,510
So if we have the correlation between X and Y and

184
00:14:36,510 --> 00:14:40,070
then you just square this value, that will give

185
00:14:40,070 --> 00:14:42,370
the correlation or the coefficient of

186
00:14:42,370 --> 00:14:45,730
determination. So simply, determination

187
00:14:45,730 --> 00:14:49,510
coefficient is just the square of the correlation

188
00:14:49,510 --> 00:14:54,430
between X and Y. We know that R ranges between

189
00:14:54,430 --> 00:14:55,670
minus 1 and plus 1.

190
00:14:59,150 --> 00:15:05,590
So R squared should be ranges between 0 and 1,

191
00:15:06,050 --> 00:15:09,830
because minus sign will be cancelled since we are

192
00:15:09,830 --> 00:15:12,770
squaring these values, so r squared is always

193
00:15:12,770 --> 00:15:17,690
between 0 and 1. So again, r squared is used to

194
00:15:17,690 --> 00:15:22,430
explain the portion of the total variability in

195
00:15:22,430 --> 00:15:24,950
the dependent variable that is already explained

196
00:15:24,950 --> 00:15:31,310
by the variability in x. For example, Sometimes R

197
00:15:31,310 --> 00:15:36,590
squared is one. R squared is one only happens if R

198
00:15:36,590 --> 00:15:41,190
is one or negative one. So if there exists perfect

199
00:15:41,190 --> 00:15:45,490
relationship either negative or positive, I mean

200
00:15:45,490 --> 00:15:49,890
if R is plus one or negative one, then R squared

201
00:15:49,890 --> 00:15:55,130
is one. That means perfect linear relationship

202
00:15:55,130 --> 00:16:01,020
between Y and X. Now the value. of 1 for R squared

203
00:16:01,020 --> 00:16:07,040
means that 100% of the variation Y is explained by

204
00:16:07,040 --> 00:16:11,460
variation X. And that's really never happened in

205
00:16:11,460 --> 00:16:15,720
real life. Because R equals 1 or plus 1 or

206
00:16:15,720 --> 00:16:21,140
negative 1 cannot be happened in real life. So R

207
00:16:21,140 --> 00:16:25,180
squared always ranges between 0 and 1, never

208
00:16:25,180 --> 00:16:29,500
equals 1, because if R squared is 1, that means

209
00:16:29,500 --> 00:16:33,440
all the variation in Y is explained by the

210
00:16:33,440 --> 00:16:38,220
variation in X. But for sure there is an error,

211
00:16:38,820 --> 00:16:41,700
and that error may be due to some variables that

212
00:16:41,700 --> 00:16:45,540
are not included in the regression model. Maybe

213
00:16:45,540 --> 00:16:50,870
there is Random error in the selection, maybe the

214
00:16:50,870 --> 00:16:53,210
sample size is not large enough in order to

215
00:16:53,210 --> 00:16:55,770
determine the total variation in the dependent

216
00:16:55,770 --> 00:16:58,990
variable. So it makes sense that R squared will be

217
00:16:58,990 --> 00:17:04,450
less than 100. So generally speaking, R squared

218
00:17:04,450 --> 00:17:09,870
always between 0 and 1. Weaker linear relationship

219
00:17:09,870 --> 00:17:15,690
between X and Y, it means R squared is not 1. So

220
00:17:15,690 --> 00:17:20,070
R², since it lies between 0 and 1, it means sum,

221
00:17:21,070 --> 00:17:24,830
but not all the variation of Y is explained by the

222
00:17:24,830 --> 00:17:28,410
variation X. Because as mentioned before, if R

223
00:17:28,410 --> 00:17:32,510
squared is 90%, it means some, not all, the

224
00:17:32,510 --> 00:17:35,830
variation Y is explained by the variation X. And

225
00:17:35,830 --> 00:17:38,590
the remaining percent in this case, which is 10%,

226
00:17:38,590 --> 00:17:42,790
this one due to, as I mentioned, maybe there

227
00:17:42,790 --> 00:17:46,490
exists some other variables that affect the

228
00:17:46,490 --> 00:17:52,020
selling price besides its size, maybe location. of

229
00:17:52,020 --> 00:17:57,900
the house affects its selling price. So R squared

230
00:17:57,900 --> 00:18:02,640
is always between 0 and 1, it's always positive. R

231
00:18:02,640 --> 00:18:07,180
squared equals 0, that only happens if there is no

232
00:18:07,180 --> 00:18:12,620
linear relationship between Y and X. Since R is 0,

233
00:18:13,060 --> 00:18:17,240
then R squared equals 0. That means the value of Y

234
00:18:17,240 --> 00:18:20,870
does not depend on X. Because here, as X

235
00:18:20,870 --> 00:18:26,830
increases, Y stays nearly in the same position. It

236
00:18:26,830 --> 00:18:30,190
means as X increases, Y stays the same, constant.

237
00:18:31,010 --> 00:18:33,730
So that means there is no relationship or actually

238
00:18:33,730 --> 00:18:37,010
there is no linear relationship because it could

239
00:18:37,010 --> 00:18:40,710
be there exists non-linear relationship. But here

240
00:18:40,710 --> 00:18:44,980
we are. Just focusing on linear relationship

241
00:18:44,980 --> 00:18:50,020
between X and Y. So if R is zero, that means the

242
00:18:50,020 --> 00:18:52,400
value of Y does not depend on the value of X. So

243
00:18:52,400 --> 00:18:58,360
as X increases, Y is constant. Now for the

244
00:18:58,360 --> 00:19:03,620
previous example, R was 0.7621. To determine the

245
00:19:03,620 --> 00:19:06,760
coefficient of determination, One more time,

246
00:19:07,460 --> 00:19:11,760
square this value, that's only valid for simple

247
00:19:11,760 --> 00:19:14,980
linear regression. Otherwise, you cannot square

248
00:19:14,980 --> 00:19:17,580
the value of R in order to determine the

249
00:19:17,580 --> 00:19:20,820
coefficient of determination. So again, this is

250
00:19:20,820 --> 00:19:26,420
only true for

251
00:19:26,420 --> 00:19:29,980
simple linear regression.

252
00:19:35,460 --> 00:19:41,320
So R squared is 0.7621 squared will give 0.5808.

253
00:19:42,240 --> 00:19:46,120
Now, the meaning of this value, first you have to

254
00:19:46,120 --> 00:19:53,280
multiply this by 100. So 58.08% of the variation

255
00:19:53,280 --> 00:19:57,440
in house prices is explained by the variation in

256
00:19:57,440 --> 00:20:05,190
square feet. So 58, around 0.08% of the variation

257
00:20:05,190 --> 00:20:12,450
in size of the house, I'm sorry, in the price is

258
00:20:12,450 --> 00:20:16,510
explained by

259
00:20:16,510 --> 00:20:25,420
its size. So size by itself. Size only explains

260
00:20:25,420 --> 00:20:30,320
around 50-80% of the selling price of a house. Now

261
00:20:30,320 --> 00:20:35,000
the remaining percent which is around, this is the

262
00:20:35,000 --> 00:20:38,860
error, or the remaining percent, this one is due

263
00:20:38,860 --> 00:20:50,040
to other variables, other independent variables.

264
00:20:51,200 --> 00:20:53,820
That might affect the change of price.

265
00:21:04,840 --> 00:21:11,160
But since the size of the house explains 58%, that

266
00:21:11,160 --> 00:21:15,660
means it's a significant variable. Now, if we add

267
00:21:15,660 --> 00:21:19,250
more variables, to the regression equation for

268
00:21:19,250 --> 00:21:23,950
sure this value will be increased. So maybe 60 or

269
00:21:23,950 --> 00:21:28,510
65 or 67 and so on. But 60% or 50 is more enough

270
00:21:28,510 --> 00:21:31,870
sometimes. But R squared, as R squared increases,

271
00:21:32,090 --> 00:21:35,530
it means we have good fit of the model. That means

272
00:21:35,530 --> 00:21:41,230
the model is accurate to determine or to make some

273
00:21:41,230 --> 00:21:46,430
prediction. So that's for the coefficient of

274
00:21:46,430 --> 00:21:58,350
determination. Any question? So we covered simple

275
00:21:58,350 --> 00:22:01,790
linear regression model. We know now how can we

276
00:22:01,790 --> 00:22:06,390
compute the values of B0 and B1. We can state or

277
00:22:06,390 --> 00:22:10,550
write the regression equation, and we can do some

278
00:22:10,550 --> 00:22:14,370
interpretation about P0 and P1, making

279
00:22:14,370 --> 00:22:21,530
predictions, and make some comments about the

280
00:22:21,530 --> 00:22:27,390
coefficient of determination. That's all. So I'm

281
00:22:27,390 --> 00:22:31,910
going to stop now, and I will give some time to

282
00:22:31,910 --> 00:22:33,030
discuss some practice.