Biostatistics Preparatory Course: Methods and Computing
Lecture 6 Simulations
Methods and Computing Harvard University Department of Biostatistics 1 / 15
Biostatistics Preparatory Course: Methods and Computing Lecture 6 - - PowerPoint PPT Presentation
Biostatistics Preparatory Course: Methods and Computing Lecture 6 Simulations Methods and Computing Harvard University Department of Biostatistics 1 / 15 Recap / Warm-up: Linear Regression In the group exercise 2, we were given the following
Methods and Computing Harvard University Department of Biostatistics 1 / 15
Methods and Computing Harvard University Department of Biostatistics 2 / 15
Methods and Computing Harvard University Department of Biostatistics 2 / 15
Methods and Computing Harvard University Department of Biostatistics 2 / 15
Methods and Computing Harvard University Department of Biostatistics 3 / 15
Methods and Computing Harvard University Department of Biostatistics 3 / 15
1 What is a simulation?
2 Why bother?
Methods and Computing Harvard University Department of Biostatistics 4 / 15
Methods and Computing Harvard University Department of Biostatistics 5 / 15
Methods and Computing Harvard University Department of Biostatistics 6 / 15
Methods and Computing Harvard University Department of Biostatistics 6 / 15
n where X is the observed number of successes
0.975
0.975
0.975
0.975
0.975
0.975
0.975
Methods and Computing Harvard University Department of Biostatistics 7 / 15
Methods and Computing Harvard University Department of Biostatistics 8 / 15
1
2
Methods and Computing Harvard University Department of Biostatistics 9 / 15
Methods and Computing Harvard University Department of Biostatistics 10 / 15
Methods and Computing Harvard University Department of Biostatistics 11 / 15
Methods and Computing Harvard University Department of Biostatistics 11 / 15
Methods and Computing Harvard University Department of Biostatistics 11 / 15
Methods and Computing Harvard University Department of Biostatistics 11 / 15
Methods and Computing Harvard University Department of Biostatistics 11 / 15
Methods and Computing Harvard University Department of Biostatistics 11 / 15
Methods and Computing Harvard University Department of Biostatistics 11 / 15
Methods and Computing Harvard University Department of Biostatistics 11 / 15
B
B
Methods and Computing Harvard University Department of Biostatistics 12 / 15
1 Setting parameter values:
2 Don’t make B too large to start (≈ 500) 3 Save all the estimates and not just the summary statistics 4 Set the seed 5 Document the code (i.e. comments) 6 Keep track of the versions of the code you use (i.e. use GitHub) 7 If you use Rmarkdown, use the cache=TRUE preamble
Methods and Computing Harvard University Department of Biostatistics 13 / 15
1 Only present what is interesting
2 Make the results easy for the reader to understand
Methods and Computing Harvard University Department of Biostatistics 14 / 15
1
2
3
Methods and Computing Harvard University Department of Biostatistics 15 / 15