P553 Statistics in Psychology, Prof. Kruschke

## Using SPSS to generate binomial and Poisson probability distributions.

Basic procedure:

1. In the SPSS spreadsheet, enter consecutive values of r from 0 to N, in a column. On the variable view sheet, name this column "r", set the decimals to zero.
2. On the menu bar, click Transform then Compute. Set the Target Variable to, say, "bp" (for binomial probability) and set the Numeric Expression to "PDF.BINOM(r,N,p)" where "r" is actually the letter "r" (which matches the variable name of the integers you entered in the previous step), "N" is the number N (not the letter), and "p" is the probability of success (not the letter). For example, if you entered digits 0 to 8 in the previous step, and you wanted the binomial distribution for probability success of 0.5, you would type "PDF.BINOM(r,8,.5)" in the Numeric Expression.
3. You can also get the cumulative binomial distribution in the exactly analogous way, using CDF.BINOM instead of PDF.BINOM. This is useful for determining tail probabilities. Be careful, though, to understand exactly what values are being accumulated!
4. If you want the cumulative tail probability from r (inclusive) to N, use
1 - CDF.BINOM( r-1 , N , p )
In that formula, the "r-1" inside the CDF gets the left side cumulative excluding r. Then the "1-CDF..." gets the complementary right-side cumulative value.
5. The analogous procedure applies to the Poisson distribution. Use the expressions PDF.POISSON(r,m) and CDF.POISSON(r,m), where "r" is the letter "r" matching the integer variable name used in the first step above, and "m" is the numerical value of the mean.