Microsoft Excel worksheets are very well suited to perform the Bayesian analysis. In this video, learn how to implement your analysis of the Kahneman’s Cabs model.
- [Instructor] Microsoft Excel worksheets are very well suited to performing Bayesian analysis. In this movie, I will show you how to implement our analysis of the condiments cabs model. Just to give you a brief tour of the worksheet, I will need to know my base rate, and in this case that's the number of green cabs versus the number of blue cabs, as well of the accuracy of the witnesses who identify them. Everything else will be based on those two values. My sample file is the calculating workbook, and you can find it in the chapter six folder of the exercise files collection.
Let's look at the given circumstances for our case. I'll start by entering in my base rate, that is the number of green cabs in the city and that is 85% so in cell B3, which I already have formatted in percent style, I'll type 85 and enter. And the witness that was tested by the court is accurate 80% of the time. So, in cell B4, I'll type 80 and enter. Now we need to know the probability of a green cab appearing or the probability of blue.
So I'll click in cell B6 and the probability of a green cab is simply the base rate. So that is equal and then the cell is B3 and enter. The probability of blue is one minus the probability of green, that will make up for the rest of the 100% so in cell B7 I'll type equal then one minus B6 and enter and I get 15% and I can check that my work is correct because 85 plus 15 is 100, in this case 100%.
We can do the same thing for accuracy with probability correct or incorrect. So I'll move down to cell B9 and type equal B4, that's simply the accuracy. And then the probability that the witness is incorrect is 20% so that will be in cell B10 equal one minus B9 and tab and we get 20%. Now we can calculate the classification matrix which is when a cab is reported green and it's actually green and so on.
So I'll click in cell E4. In cell E4 I'll type an equal sign. In this case, the cab was actually green and the probability of the cab being green is in cell B6 so I'll type that reference and then we'll multiply that by the accuracy that is the probability that the witness accurately reported the cab's color. The probability they are correct is in cell B9 so we're multiplying B6 by B9 press enter and we get 68%.
If the cab is actually blue but reported as green we need to perform a different calculation. In cell E5 I'll type an equal sign and we are multiplying the probability of a blue cab which is in cell B7. Multiplying that by the probability that the witness is incorrect, and that is in cell B10. And press enter, and we get 3%. Now we need to calculate the other two cases where the cab was reported as blue.
In F4, the cab was reported as blue but it's actually green so I'll type in equal sign and the cab is actually green that will happen 85% of the time, that value's in B6. And we multiply it by the cab being reported as blue so it's incorrect, that value is in B10 and enter and we get 17%. Finally, if the cab is reported as blue and it's actually blue, type an equal sign in F5 and the base rate of the cab actually being blue is 15%, that's in B7, and we will multiply that by the accuracy, so in this case the witness was correct, reported blue and it was actually blue and that is in cell B9, press enter and we get 12%.
And now with the calculation matrix in place we can do some checks to make sure that our values represent the given circumstances. In cells E4 and F4 we see that the cabs are actually green 68 plus 17 percent, or 85% of the time and they're actually blue three plus 12 percent of the time or 15% so those are correct. The cabs are reported correctly 68% of the time when they're green and 12% of the time when they are blue so we have 80% which is our accuracy rate.
And inaccuracy is 3% plus 17% is 20 so that's correct as well. Now let's calculate the probabilities that the cab is actually blue when it's reported as blue. So in cell E8, I will type the following formula. Equal, we need to know the number of times that we have a correct report for blue, and that is in cell F5 it's blue and actually blue. And we need to divide that by the total number of reports of blue, and that is in the reported blue column so I'll type a left parenthesis and we'll add F4 plus F5 right parenthesis and tab and we get 41%.
Now we can do the same thing for the probability a cab is green, and when it's reported as green. So type in equal sign. The cab is reported as green when it's actually green 68% of the time, that's in cell E4. Type a forward slash to divide and then a left parenthesis. Now we need to add the total of all the reports of green and that is E4 plus E5 right parenthesis and enter and we get 96%. As you can see, the base rate of either 85% green cabs or 15% blue cabs makes a big difference in the overall accuracy of the reporting.
- Distinguish between the mean, median, and mode.
- Describe the relationship between variance and standard deviation.
- Identify a nondirectional hypothesis.
- Point out the difference between COVARIANCE.P and COVARIANCE.S.
- Explain correlation.
- Analyze Bayes’ rule.