1 00:00:01,080 --> 00:00:02,370 [Instructor] Now I wanted to show you 2 00:00:02,370 --> 00:00:07,370 how to do the Breusch-Pagan, 3 00:00:07,830 --> 00:00:12,720 and the white tests for heteroscedasticity. 4 00:00:12,720 --> 00:00:15,840 We're gonna test a model to see 5 00:00:15,840 --> 00:00:19,320 if it is heteroscedastic or homoscedastic. 6 00:00:20,670 --> 00:00:25,380 The first thing that we do is to run the regular model. 7 00:00:25,380 --> 00:00:29,153 It's, again, using the sleep model, 8 00:00:33,030 --> 00:00:36,240 and we're gonna regress sleep on total work, educ, 9 00:00:36,240 --> 00:00:40,173 age, age squared, young kid, and male like we did before. 10 00:00:41,580 --> 00:00:46,580 I'm gonna analyze, oh, I think I have to go back 11 00:00:46,650 --> 00:00:48,970 and unsplit the file. 12 00:00:52,590 --> 00:00:53,790 Okay, good. 13 00:00:53,790 --> 00:00:55,263 This is what we want. 14 00:00:56,790 --> 00:01:00,660 Do it to all groups. 15 00:01:00,660 --> 00:01:05,010 We're gonna just do a linear regression 16 00:01:05,010 --> 00:01:07,533 with sleep as our dependent. 17 00:01:12,630 --> 00:01:15,153 And then our independents are total work, 18 00:01:21,990 --> 00:01:22,823 educ, 19 00:01:25,530 --> 00:01:26,493 age, 20 00:01:27,990 --> 00:01:29,373 age squared, 21 00:01:31,050 --> 00:01:31,953 and male. 22 00:01:34,980 --> 00:01:37,080 And I just wanna make sure that those are the right ones, 23 00:01:37,080 --> 00:01:41,733 total work, educ, age, age squared, and male. 24 00:01:43,110 --> 00:01:45,450 Let's go back here and make sure that's right. 25 00:01:45,450 --> 00:01:49,230 Total work, educ, age, age squared, oh, and young kid. 26 00:01:49,230 --> 00:01:51,303 Don't forget about young kid. 27 00:01:52,530 --> 00:01:53,400 It's there. 28 00:01:53,400 --> 00:01:55,710 We put that over there. 29 00:01:55,710 --> 00:01:59,550 Now, we've run this before, but what we wanna do now, 30 00:01:59,550 --> 00:02:02,703 this is where we wanna save things. 31 00:02:04,470 --> 00:02:09,470 We wanna save both of our, the Y hats and the U hats 32 00:02:11,460 --> 00:02:16,460 because when we do the BP test, 33 00:02:17,400 --> 00:02:20,880 it's on the squared residuals, 34 00:02:20,880 --> 00:02:23,340 and when we do the white test, 35 00:02:23,340 --> 00:02:27,330 it's on the Y hat and the Y hat squared. 36 00:02:27,330 --> 00:02:31,260 Let's run this. 37 00:02:31,260 --> 00:02:33,303 Say okay, boom. 38 00:02:34,320 --> 00:02:39,320 And we see that we have over here two new variables. 39 00:02:43,290 --> 00:02:46,740 This is Y hat and U hat. 40 00:02:46,740 --> 00:02:48,930 I'm gonna go to variable view 41 00:02:48,930 --> 00:02:53,857 and I'm gonna rename them so we remember what they are. 42 00:02:54,870 --> 00:02:58,443 This is Y hat and this is U hat. 43 00:03:02,730 --> 00:03:06,570 And we're gonna wanna then square them both. 44 00:03:06,570 --> 00:03:11,520 We do that by going to transform, compute, 45 00:03:11,520 --> 00:03:14,950 and we're gonna call it U hat squared 46 00:03:19,440 --> 00:03:22,220 as our name, and it is simply... 47 00:03:26,640 --> 00:03:28,410 no, that's wrong. 48 00:03:28,410 --> 00:03:29,440 We actually want 49 00:03:32,130 --> 00:03:36,900 U hat times U hat 50 00:03:36,900 --> 00:03:40,743 so it's taking the U hats and squaring them. 51 00:03:44,220 --> 00:03:48,720 And we should see now that there is a new variable 52 00:03:48,720 --> 00:03:53,250 that is called U hat squared. 53 00:03:53,250 --> 00:03:55,680 We're gonna do the same thing 54 00:03:55,680 --> 00:03:59,790 and square the Y hats for the white test. 55 00:03:59,790 --> 00:04:04,790 Now, we're gonna reset this and we're gonna go to, 56 00:04:05,910 --> 00:04:08,913 we're gonna call it Y hat squared. 57 00:04:14,250 --> 00:04:18,550 Make this a function of Y hat times Y hat 58 00:04:20,550 --> 00:04:21,693 and say okay. 59 00:04:24,270 --> 00:04:29,270 For the BP test, we regress U hat squared 60 00:04:30,360 --> 00:04:35,130 on the regressors from the original model. 61 00:04:35,130 --> 00:04:38,740 We analyze with a regression 62 00:04:39,690 --> 00:04:44,690 and we just take out sleep now and we put in U hat squared. 63 00:04:46,140 --> 00:04:48,691 Now what this is saying is 64 00:04:48,691 --> 00:04:53,691 once we get the residuals and square them, 65 00:04:54,960 --> 00:04:59,960 do these regressors still have an effect on that? 66 00:05:00,330 --> 00:05:05,330 What we want is we want our null hypothesis to be true, 67 00:05:05,910 --> 00:05:09,480 that these are all equal to zero 68 00:05:09,480 --> 00:05:12,480 both individually and jointly. 69 00:05:12,480 --> 00:05:16,470 If that is true, we have homoscedasticity 70 00:05:16,470 --> 00:05:19,560 and that's a good thing and we don't have to deal with it. 71 00:05:19,560 --> 00:05:23,100 If we cannot reject our null, 72 00:05:23,100 --> 00:05:25,980 then we do have heteroscedasticity 73 00:05:25,980 --> 00:05:28,020 and we need to deal with it 74 00:05:28,020 --> 00:05:30,570 as we learned with to do inference 75 00:05:30,570 --> 00:05:33,660 and to get a more efficient model. 76 00:05:33,660 --> 00:05:35,820 Let's see what this says. 77 00:05:35,820 --> 00:05:36,653 Boom. 78 00:05:38,310 --> 00:05:42,150 We do see just barely these are significant. 79 00:05:42,150 --> 00:05:44,670 It's kind of a borderline case. 80 00:05:44,670 --> 00:05:48,180 It looks like it's not a very severe case. 81 00:05:48,180 --> 00:05:50,970 And for things like weighted least squares 82 00:05:50,970 --> 00:05:55,320 that we might wanna see, what is the culprit of that? 83 00:05:55,320 --> 00:06:00,320 And the only one that is significant is educ. 84 00:06:00,900 --> 00:06:03,510 Again, this is kind of a borderline case. 85 00:06:03,510 --> 00:06:07,710 It's a significant, the .08, so it wouldn't be 86 00:06:07,710 --> 00:06:12,710 at a P less than .05, but it is less than .1. 87 00:06:15,840 --> 00:06:19,170 It might be good to sort of do it both ways, 88 00:06:19,170 --> 00:06:21,600 compute the standard errors 89 00:06:21,600 --> 00:06:24,303 or weighted least squares or FGLS. 90 00:06:25,590 --> 00:06:28,980 And let's do the other test to see 91 00:06:28,980 --> 00:06:31,350 if that gives us anything else. 92 00:06:31,350 --> 00:06:35,790 Now, we're gonna do a linear regression 93 00:06:35,790 --> 00:06:40,790 and instead of regressing it on the regressors, 94 00:06:42,870 --> 00:06:46,503 we're gonna do it on Y hat squared, 95 00:06:49,050 --> 00:06:50,253 on Y hat, 96 00:06:54,330 --> 00:06:56,910 and Y hat squared. 97 00:06:56,910 --> 00:06:59,850 Then let's turn off, it keeps saving 'em 98 00:06:59,850 --> 00:07:04,110 because we didn't tell it not to. 99 00:07:04,110 --> 00:07:09,110 And again, we want this to be not significant. 100 00:07:09,300 --> 00:07:12,660 We want all our betas to be jointly zero. 101 00:07:12,660 --> 00:07:17,660 And we look and we find that they are. 102 00:07:18,870 --> 00:07:22,140 The whole thing is not significant. 103 00:07:22,140 --> 00:07:26,730 And so again, these are, so again, 104 00:07:26,730 --> 00:07:29,250 this is kind of a borderline case, 105 00:07:29,250 --> 00:07:34,250 but that shows you how to do the the Breusch-Pagan test 106 00:07:36,030 --> 00:07:40,140 and the second version of the white test 107 00:07:40,140 --> 00:07:41,793 for heteroscedasticity.