generating and graphing a binomial probability distribution using excel

advertisement
GENERATING AND GRAPHING A BINOMIAL PROBABILITY
DISTRIBUTION USING EXCEL
Suppose you wish to generate the probability distribution for a binomial random variable
for which there are 5 trials (n = 5) and the probability of success is .3 (
). Do the
following:
1.
Input the possible values for X in the spreadsheet:
2.
Move to the cell next to X = 0 (cell B2 in this example) and click the "fx" icon
above the spreadsheet.
3.
In the "Or select a category" section of the dialog box, choose "Statistical" then
choose "BINOMDIST" in the "Select a function:" section of the dialog box and
click "OK." The following will appear:
4.
Fill in the dialog box appropriately, i.e., I'll set "Number_s" to "a2" since X=0 is
in cell a2, Trials are "5" in this example, and the Probability_s is .3 per the
information given at the beginning. I type in the word "false" in the Cumulative
box (since if I typed in "true" Excel would give the cumulative distribution
function rather than the probability distribution function). Click "OK" when
finished.
5.
Excel returns the P(X=0). Place your cursor on the lower right hand corner of cell
B2 and do a "drag and fill" for the rest of the probabilities.
6.
In order to obtain cumulative probabilities
and the cumulative
probability distribution, begin by moving to cell C2, click the "fx" icon, select
binom.dist, and fill in the dialog box as before. This time, however, indicate
“true” in the cumulative box. Then place your cursor on the lower right hand
corner of cell C2 and do a "drag and fill" for the rest of the cumulative
probabilities.
Now, to graph the probability distribution, do the following:
1.
2.
3.
4.
5.
6.
Click on the Insert tab and choose Column from among the Chart options. Click
on the first 2-D column chart.
Click Select Data from the Data options, then mark the cells of the P(X=x)
column and remain in this dialog box.
Now click Edit in the Horizontal (category) Axis Labels and mark cells a2:a5 in
order to state the possible values of X on the horizontal axis.
Click Ok of the Select Data Source dialog box.
Edit chart title, X axis title, Y axis title, and value labels to taste and click next.
Click finish
Having correctly followed these steps, you should get a graph that looks like this—
Download