1 General Purpose
Monte Carlo methods allows you to
examine complex data more easily than advanced mathematics like
integrals and matrix algebra. It uses random numbers from your own
study rather than assumed Gaussian curves. Monte Carlo analyses of
continuous outcome data are reviewed in the Chap. 27. In this chapter we will review
Monte Carlo analyses for paired and unpaired binary data.
2 Schematic Overview of Type of Data File, Paired Data

3 Primary Scientific Question, Paired Data
For paired data McNemar tests is
adequate (Chap. 41). Does Monte Carlo analysis of the
same data provide better sensitivity of testing.
4 Data Example, Paired Data
In a study of 139 general practitioners
the primary scientific question was, is there a significant
difference between the numbers of practitioners who give lifestyle
advise in the periods before and after postgraduate
education.
Lifestyle advise-1
|
Lifestyle advise-2
|
Age
|
,00
|
,00
|
89,00
|
,00
|
,00
|
78,00
|
,00
|
,00
|
79,00
|
,00
|
,00
|
76,00
|
,00
|
,00
|
87,00
|
,00
|
,00
|
84,00
|
,00
|
,00
|
84,00
|
,00
|
,00
|
69,00
|
,00
|
,00
|
77,00
|
,00
|
,00
|
79,00
|
The first 10 physicians of the data
file is given above. The entire data file is in
extras.springer.com, and is entitled “chapter41pairedbinary”.
5 Analysis: Monte Carlo, Paired Data
For analysis the statistical model Two
Related Samples in the module Nonparametric Tests is
required.
Command:
-
Analyze....Nonparametric....Two Related Samples....Test Pairs....Pair 1....Variable 1: enter lifestyleadvise after....Variable 2: enter lifestytleadvise before....mark McNemar....click Exact....click Monte Carlo....set Confidence Intervals: 99 %....set Number of Samples: 10000....click Continue…click OK.
lifestyleadvise before &
lifestyleadvise after
Lifestyleadvise before
|
Lifestyleadvise after
|
|
---|---|---|
,00
|
1,00
|
|
,00
|
65
|
28
|
1,00
|
12
|
34
|
Test Statisticsa,b
Lifestyle after 1 year –
lifestyle
|
|||
---|---|---|---|
Z
|
−2,530c
|
||
Asymp. Sig. (2-tailed)
|
,011
|
||
Monte Carlo Sig. (2-tailed)
|
Sig.
|
,016
|
|
95 % Confidence Interval
|
Lower bound
|
,008
|
|
Upper bound
|
,024
|
||
Monte Carlo Sig. (1-tailed)
|
Sig.
|
,010
|
|
95 % Confidence Interval
|
Lower bound
|
,004
|
|
Upper bound
|
,016
|
The above table is in the output. The
two sided level of statistical significance is 0,016. This is
slightly smaller than the p-value produced by the nonparametric Mc
Nemar test (Chap. 41), p = 0,018, and, so, a slightly
better fit for the data was obtained by the Monte Carlo
method.
6 Schematic Overview of Type of Data File, Unpaired Data

7 Primary Scientific Question, Unpaired Data
For unpaired binary data Pearson
chi-square is adequate. Is Monte Carlo testing better sensitive for
the analysis of such data.
8 Data Example, Unpaired Data
In 55 patients the effect of the
hospital department on the risk of falling out of bed was assessed.
The entire data file is in “chapter35unpairedbinary”, and is in
extras.springer.com.
Fall out of bed
|
Department
|
1 = yes, 0 = no
|
0 = surgery, 1 = internal medicine
|
1,00
|
,00
|
1,00
|
,00
|
1,00
|
,00
|
1,00
|
,00
|
1,00
|
,00
|
1,00
|
,00
|
1,00
|
,00
|
1,00
|
,00
|
1,00
|
,00
|
1,00
|
,00
|
9 Data Analysis, Monte Carlo, Unpaired Data
For analysis the statistical model
Chi-square in the module Nonparametric Tests is required.
Command:
-
Analyze….Nonparametric tests….Chi-square….Test variable list: enter department and fall out of bed….click “Exact”….Click: Monte Carlo method….set Confidence Interval, e.g., 99 %, and set Numbers of Samples, e.g., 10 000….click Continue….OK.
Test statistics
Department
|
Fall out of bed
|
|||
---|---|---|---|---|
Chi-Square
|
4,091a
|
,455a
|
||
df
|
1
|
1
|
||
Asymp.Sig.
|
,043
|
,500
|
||
Monte Carlo Sig.
|
Sig.
|
,064b
|
,595b
|
|
99 % confidence interval
|
Lower bound
|
,057
|
,582
|
|
Upper bound
|
,070
|
,608
|
The Monte Carlo analysis provided a
larger p -value than did the Pearson chi-square test (Chap.
35) with p-values of respectively
0,064 and 0,021.
10 Conclusion
Monte Carlo methods allow you to
examine complex data more easily and more rapidly than advanced
mathematics like integrals and matrix algebra. It uses random
numbers from your own study. Often, but not always, better p-values
are produced.
11 Note
More background, theoretical, and
mathematical information of Monte Carlo methods for data analysis
is given in Statistics applied to clinical studies 5th edition,
Chap. 57, Springer Heidelberg Germany, 2012, from the same
authors.