00:01
Moving on with computer exercise number nine, we will go into use the data set called country murders to answer this question.
00:08
We use this data cell also in chapter one of the questions.
00:12
And the first time we're going to do is hit describe to see what we're dealing with here.
00:18
As you can see, we're going to have a lot of observations.
00:22
Too many.
00:22
And indeed, we're going to drop some of them.
00:25
We can see here that some of the variables we're going to use are executions, the number of execution.
00:30
In every county and the number of murders.
00:33
But now, here's the deal.
00:35
We have data, full data, from 1980 to 1996.
00:42
The question says to use only data for 1996.
00:45
So one thing we could do is just in every command, include restrictions such as if the year is equal to 996.
00:53
But because we want to make our life easier and not harder, we're going to say drop everything, if year, is not equal to 996, right? okay, before i hit, enter, look at that.
01:09
I have thousands of data many years, okay? but once i hit enter, 35 ,152 observations deleted.
01:20
Now the new dataset will be just 2 ,197 variables.
01:25
And as you can see, the only year remaining is 996.
01:29
Okay, part a says how many countries had zero murders in 1996 and how many counties had at least one execution.
01:40
What is the largest number of executions? okay, very easy questions.
01:44
We're going to do a count if murders equal to zero.
01:53
151 counties had zero murders in 1996.
01:58
Now how many counties had at least one execution? at least one means that we're going to do count if executions were greater equal.
02:09
To 1.
02:12
31 counties is the answer.
02:15
What is the largest number of executions? well, i'm going to just summarize the execution variable.
02:23
I'm going to look at the maximum.
02:24
Maximum is 3.
02:27
Okay? minimum is 0 and the overwhelming majority of counties had zero executions and we can we can see that from the mean that is extremely close to 0.
02:36
Just a few observation other than zero basically.
02:40
In part b, we need to estimate the equations, murders equals b .0 plus b2 1 executions plus a disturbance term, and report the results in the usual way.
02:50
Very easy.
02:51
Regress, murders, and executions, hit enter.
02:59
All right.
03:00
Here we can see we have the correct number of observations.
03:03
The joint f test, its critical value, it's very high.
03:09
And so the iron line p value is practically zero.
03:13
Means that the model is better in explaining murders than just a intercept model with no variables.
03:20
However, the o square is not that highs around 4 .4 % of variation in murders is explained by the variation in executions.
03:31
Not high at all.
03:33
Here we can see that our constant terms is highly significant is 5 .45.
03:38
And our slope coefficient is 58 .55.
03:42
That's a huge.
03:43
Number.
03:44
Okay.
03:46
Why am i saying it's huge? because in part three, we need to interpret the slope coefficient reported and see if it suggests a deterrent effect of capital punishment.
04:00
Well, this coefficient right here, since we're dealing with a log log model right here, i almost forgot to show you the output.
04:12
Since we're dealing with the log log model, the interpretation is if there's one more execution in a county, this is associated with 55 .55 more murders.
04:30
Isn't that crazy? i guess the analysis was hoping to suggest that executions actually deter crime, but our simple, bivariate digression says that if there's one more execution in a county, this is associated with 59 more murders in the county.
04:50
So one thing we see is that this is a positive number, this low coefficient, whereas i guess the original idea was that it was supposed to be negative, right? if capital punishment is more strict, then we have less murders, but here indeed we have more, right? so the estimated equation does not suggest a deterrent effect of capital punishment.
05:12
Now go back to state -up and part four.
05:17
Asks, what is the smallest number of murders that can be predicted by the equation? what is the residual for a county with zero executions and zero murders? all right.
05:27
So for the smallest number that can be predicted, we're going to hit you're going to replace execution with zero.
05:33
And this is, of course, our constant term.
05:36
So our model implies that there are no counties with less than 5 .45 murders.
05:42
Of course, that's false.
05:44
We know that many counties have zero murders.
05:47
In fact, 151, whatever we found, around half.
05:52
And again, in the residual, the residuals for accounted with zero execution and zero murders.
05:59
Again, we put zero here.
06:03
And the residual will be fitted minus the actual one.
06:09
So again, it will be zero...