Professional Documents
Culture Documents
SPSS Binomial-Simulation
SPSS Binomial-Simulation
This guide shows how to approximate a binomial distribution by selecting many samples of
size n from a 0,1 distribution. For each sample, the number of successes, k, is counted.
Then a distribution is created showing how often k occurs. That is an approximation of the
the binomial distribution. Approximations like this are called Monte Carlo simulations. We
empirically estimate how likely each value of k is, by picking many different samples, and
seeing what proportion of the time k occurs in the sample. We’re creating one empirical
estimate of the probability for each possible value of k.
K
400
300
200
100
Frequency
0 N = 1000.00
0.0 1.0 2.0 3.0 4.0 5.0 6.0
K
EXAMPLE 2: Also n=6, p= .5 Note that the frequencies are not identical!
K
400
300
200
100
Frequency
0 N = 1000.00
0.0 1.0 2.0 3.0 4.0 5.0 6.0
K
HOW THE DATA SET ABOVE WAS CREATED
INPUT PROGRAM .
LOOP #I = 1 TO 1000 .
DO REPEAT X = R1 TO R6 .
COMPUTE X = RV.BERNOULLI(.5) .
END REPEAT .
COMPUTE K = SUM(R1 TO R6) .
END CASE .
END LOOP .
END FILE .
END INPUT PROGRAM .
EXECUTE .
FREQUENCIES VARIABLES = k
/HISTOGRAM = NORMAL .
EXECUTE .
EXPLANATION OF RESULTS
After running this, the Data window will contain 1000 samples, one in each row. Each
sample will have 6 scores and a value of k. k will be the sample sum, or count.