Skip to content

Commit

Permalink
update 1.4.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Lakens committed Feb 21, 2024
1 parent cc5a614 commit 92832c3
Show file tree
Hide file tree
Showing 51 changed files with 64 additions and 64 deletions.
Binary file modified 01-pvalue_files/figure-pdf/fig-fig131-1.pdf
Binary file not shown.
Binary file modified 01-pvalue_files/figure-pdf/fig-fig132-1.pdf
Binary file not shown.
Binary file modified 01-pvalue_files/figure-pdf/fig-fig134-1.pdf
Binary file not shown.
Binary file modified 01-pvalue_files/figure-pdf/fig-fig135-1.pdf
Binary file not shown.
Binary file modified 01-pvalue_files/figure-pdf/fig-fig136-1.pdf
Binary file not shown.
Binary file modified 01-pvalue_files/figure-pdf/fig-fig137-1.pdf
Binary file not shown.
Binary file modified 01-pvalue_files/figure-pdf/fig-fig138-1.pdf
Binary file not shown.
Binary file modified 01-pvalue_files/figure-pdf/fig-paradox-1.pdf
Binary file not shown.
Binary file modified 01-pvalue_files/figure-pdf/fig-pdft-1.pdf
Binary file not shown.
Binary file modified 01-pvalue_files/figure-pdf/fig-tdist-1.pdf
Binary file not shown.
Binary file modified 01-pvalue_files/figure-pdf/q1-1.pdf
Binary file not shown.
Binary file modified 01-pvalue_files/figure-pdf/unnamed-chunk-3-1.pdf
Binary file not shown.
Binary file modified 02-errorcontrol_files/figure-pdf/fig-minerror-1.pdf
Binary file not shown.
Binary file modified 02-errorcontrol_files/figure-pdf/justifyalpha1-1.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified 08-samplesizejustification_files/figure-pdf/fig-plot-1-1.pdf
Binary file not shown.
Binary file modified 08-samplesizejustification_files/figure-pdf/fig-plot-4-1.pdf
Binary file not shown.
Binary file modified 08-samplesizejustification_files/figure-pdf/fig-power-2-1.pdf
Binary file not shown.
Binary file modified 08-samplesizejustification_files/figure-pdf/fig-power-3-1.pdf
Binary file not shown.
Binary file not shown.
Binary file modified 09-equivalencetest_files/figure-pdf/fig-ciequivalence1-1.pdf
Binary file not shown.
Binary file modified 09-equivalencetest_files/figure-pdf/fig-ciequivalence2-1.pdf
Binary file not shown.
Binary file modified 09-equivalencetest_files/figure-pdf/fig-intervaltest-1.pdf
Binary file not shown.
Binary file modified 09-equivalencetest_files/figure-pdf/fig-tdistequivalence-1.pdf
Binary file not shown.
Binary file modified 09-equivalencetest_files/figure-pdf/fig-tmet-1.pdf
Binary file not shown.
Binary file modified 10-sequential_files/figure-pdf/fig-boundplot1-1.pdf
Binary file not shown.
Binary file modified 10-sequential_files/figure-pdf/fig-comparison-1.pdf
Binary file not shown.
Binary file modified 10-sequential_files/figure-pdf/fig-fourspendingfunctions-1.pdf
Binary file not shown.
Binary file modified 10-sequential_files/figure-pdf/fig-futility1-1.pdf
Binary file not shown.
Binary file modified 10-sequential_files/figure-pdf/fig-futility2-1.pdf
Binary file not shown.
Binary file modified 10-sequential_files/figure-pdf/fig-futilityq13-1.pdf
Binary file not shown.
Binary file modified 10-sequential_files/figure-pdf/fig-powerseq-1.pdf
Binary file not shown.
Binary file modified 10-sequential_files/figure-pdf/fig-powerseq2-1.pdf
Binary file not shown.
Binary file modified 12-bias_files/figure-pdf/fig-carterbias-1.pdf
Binary file not shown.
Binary file modified 12-bias_files/figure-pdf/fig-funnel1-1.pdf
Binary file not shown.
Binary file modified 12-bias_files/figure-pdf/fig-funnel2-1.pdf
Binary file not shown.
Binary file modified 12-bias_files/figure-pdf/fig-petpeese-1.pdf
Binary file not shown.
Binary file modified 12-bias_files/figure-pdf/fig-petpeeseq4-1.pdf
Binary file not shown.
Binary file modified 12-bias_files/figure-pdf/fig-trimfill1-1.pdf
Binary file not shown.
Binary file modified 12-bias_files/figure-pdf/fig-twoforestplot-1.pdf
Binary file not shown.
Binary file modified 12-bias_files/figure-pdf/metasimq2-1.pdf
Binary file not shown.
32 changes: 16 additions & 16 deletions docs/03-likelihoods.html

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions docs/04-bayes.html
Original file line number Diff line number Diff line change
Expand Up @@ -541,14 +541,14 @@ <h1 class="title"><span id="sec-bayes" class="quarto-section-identifier"><span c
<div class="webex-check webex-box">
<p><strong>Q1</strong>: The true believer had a prior of Beta(1,0.5). After observing 10 heads out of 20 coin flips, what is the posterior distribution, given that <span class="math inline">\(\alpha\)</span> = <span class="math inline">\(\alpha\)</span> + x and <span class="math inline">\(\beta\)</span> = <span class="math inline">\(\beta\)</span> + n – x?</p>
<div class="cell" data-layout-align="center">
<div id="radio_REQQPPFBNP" class="webex-radiogroup">
<label><input type="radio" autocomplete="off" name="radio_REQQPPFBNP" value=""><span>Beta(10, 10)</span></label><label><input type="radio" autocomplete="off" name="radio_REQQPPFBNP" value="answer"><span>Beta(11, 10.5)</span></label><label><input type="radio" autocomplete="off" name="radio_REQQPPFBNP" value=""><span>Beta(10, 20)</span></label><label><input type="radio" autocomplete="off" name="radio_REQQPPFBNP" value=""><span>Beta(11, 20.5)</span></label>
<div id="radio_KSGGHYJACX" class="webex-radiogroup">
<label><input type="radio" autocomplete="off" name="radio_KSGGHYJACX" value=""><span>Beta(10, 10)</span></label><label><input type="radio" autocomplete="off" name="radio_KSGGHYJACX" value="answer"><span>Beta(11, 10.5)</span></label><label><input type="radio" autocomplete="off" name="radio_KSGGHYJACX" value=""><span>Beta(10, 20)</span></label><label><input type="radio" autocomplete="off" name="radio_KSGGHYJACX" value=""><span>Beta(11, 20.5)</span></label>
</div>
</div>
<p><strong>Q2</strong>: The extreme skeptic had a prior of Beta(100,100). After observing 50 heads out of 100 coin flips, what is the posterior distribution, given that <span class="math inline">\(\alpha\)</span> = <span class="math inline">\(\alpha\)</span> + x and <span class="math inline">\(\beta\)</span> = <span class="math inline">\(\beta\)</span> + n – x?</p>
<div class="cell" data-layout-align="center">
<div id="radio_REZYUBNRIL" class="webex-radiogroup">
<label><input type="radio" autocomplete="off" name="radio_REZYUBNRIL" value=""><span>Beta(50, 50)</span></label><label><input type="radio" autocomplete="off" name="radio_REZYUBNRIL" value=""><span>Beta(51, 51)</span></label><label><input type="radio" autocomplete="off" name="radio_REZYUBNRIL" value="answer"><span>Beta(150, 150)</span></label><label><input type="radio" autocomplete="off" name="radio_REZYUBNRIL" value=""><span>Beta(11, 20.5)</span></label>
<div id="radio_VPJSKOVMDN" class="webex-radiogroup">
<label><input type="radio" autocomplete="off" name="radio_VPJSKOVMDN" value=""><span>Beta(50, 50)</span></label><label><input type="radio" autocomplete="off" name="radio_VPJSKOVMDN" value=""><span>Beta(51, 51)</span></label><label><input type="radio" autocomplete="off" name="radio_VPJSKOVMDN" value="answer"><span>Beta(150, 150)</span></label><label><input type="radio" autocomplete="off" name="radio_VPJSKOVMDN" value=""><span>Beta(11, 20.5)</span></label>
</div>
</div>
<p>Copy the R script below into R. This script requires 5 input parameters (identical to the Bayes Factor calculator website used above). These are the hypothesis you want to examine (e.g., when evaluating whether a coin is fair, <em>p</em> = 0.5), the total number of trials (e.g., 20 flips), the number of successes (e.g., 10 heads), and the <span class="math inline">\(\alpha\)</span> and <span class="math inline">\(\beta\)</span> values for the Beta distribution for the prior (e.g., <span class="math inline">\(\alpha\)</span> = 1 and <span class="math inline">\(\beta\)</span> = 1 for a uniform prior). Run the script. It will calculate the Bayes Factor, and plot the prior (grey), likelihood (dashed blue), and posterior (black).</p>
Expand Down Expand Up @@ -588,14 +588,14 @@ <h1 class="title"><span id="sec-bayes" class="quarto-section-identifier"><span c
<p>We see that for the newborn baby, <em>p</em> = 0.5 has become more probable, but so has <em>p</em> = 0.4.</p>
<p><strong>Q3</strong>: Change the hypothesis in the first line from 0.5 to 0.675, and run the script. If you were testing the idea that this coin returns 67.5% heads, which statement is true?</p>
<div class="cell" data-layout-align="center">
<div id="radio_ISSHSSKTPR" class="webex-radiogroup">
<label><input type="radio" autocomplete="off" name="radio_ISSHSSKTPR" value=""><span>Your belief in this hypothesis, given the data, would have decreased.</span></label><label><input type="radio" autocomplete="off" name="radio_ISSHSSKTPR" value="answer"><span>Your belief in this hypothesis, given the data, would have stayed the same.</span></label><label><input type="radio" autocomplete="off" name="radio_ISSHSSKTPR" value=""><span>Your belief in this hypothesis, given the data, would have increased.</span></label>
<div id="radio_ADKUPNVAIA" class="webex-radiogroup">
<label><input type="radio" autocomplete="off" name="radio_ADKUPNVAIA" value=""><span>Your belief in this hypothesis, given the data, would have decreased.</span></label><label><input type="radio" autocomplete="off" name="radio_ADKUPNVAIA" value="answer"><span>Your belief in this hypothesis, given the data, would have stayed the same.</span></label><label><input type="radio" autocomplete="off" name="radio_ADKUPNVAIA" value=""><span>Your belief in this hypothesis, given the data, would have increased.</span></label>
</div>
</div>
<p><strong>Q4</strong>: Change the hypothesis in the first line back to 0.5. Let’s look at the increase in the belief of the hypothesis <em>p</em> = 0.5 for the extreme skeptic after 10 heads out of 20 coin flips. Change the <span class="math inline">\(\alpha\)</span> for the prior in line 4 to 100 and the <span class="math inline">\(\beta\)</span> for the prior in line 5 to 100. Run the script. Compare the figure from R to the increase in belief for the newborn baby. Which statement is true?</p>
<div class="cell" data-layout-align="center">
<div id="radio_SWEGDEGKMB" class="webex-radiogroup">
<label><input type="radio" autocomplete="off" name="radio_SWEGDEGKMB" value="answer"><span>The belief in the hypothesis that <em>p</em> = 0.5, given the data, has <strong>increased</strong> for the extreme skeptic, but <strong>not</strong> as much as it has for the newborn.</span></label><label><input type="radio" autocomplete="off" name="radio_SWEGDEGKMB" value=""><span>The belief in the hypothesis that <em>p</em> = 0.5, given the data, has <strong>increased</strong> for the extreme skeptic, <strong>exactly as much</strong> as it has for the newborn.</span></label><label><input type="radio" autocomplete="off" name="radio_SWEGDEGKMB" value=""><span>The belief in the hypothesis that <em>p</em> = 0.5, given the data, has <strong>increased</strong> for the extreme skeptic, and <strong>much more</strong> than it has for the newborn.</span></label><label><input type="radio" autocomplete="off" name="radio_SWEGDEGKMB" value=""><span>The belief in the hypothesis that <em>p</em> = 0.5, given the data, has <strong>decreased</strong> for the extreme skeptic.</span></label>
<div id="radio_BZZPDABOLW" class="webex-radiogroup">
<label><input type="radio" autocomplete="off" name="radio_BZZPDABOLW" value="answer"><span>The belief in the hypothesis that <em>p</em> = 0.5, given the data, has <strong>increased</strong> for the extreme skeptic, but <strong>not</strong> as much as it has for the newborn.</span></label><label><input type="radio" autocomplete="off" name="radio_BZZPDABOLW" value=""><span>The belief in the hypothesis that <em>p</em> = 0.5, given the data, has <strong>increased</strong> for the extreme skeptic, <strong>exactly as much</strong> as it has for the newborn.</span></label><label><input type="radio" autocomplete="off" name="radio_BZZPDABOLW" value=""><span>The belief in the hypothesis that <em>p</em> = 0.5, given the data, has <strong>increased</strong> for the extreme skeptic, and <strong>much more</strong> than it has for the newborn.</span></label><label><input type="radio" autocomplete="off" name="radio_BZZPDABOLW" value=""><span>The belief in the hypothesis that <em>p</em> = 0.5, given the data, has <strong>decreased</strong> for the extreme skeptic.</span></label>
</div>
</div>
<p>Copy the R script below and run it. The script will plot the mean for the posterior when 10 heads out of 20 coin flips are observed, given a uniform prior (as in <a href="#fig-bayes8">Figure&nbsp;<span>4.6</span></a>). The script will also use the ‘binom’ package to calculate the posterior mean, credible interval, and highest density interval is an alternative to the credible interval.</p>
Expand Down Expand Up @@ -697,8 +697,8 @@ <h1 class="title"><span id="sec-bayes" class="quarto-section-identifier"><span c
<p>The posterior mean is identical to the Frequentist mean, but this is only the case when the mean of the prior equals the mean of the likelihood.</p>
<p><strong>Q5</strong>: Assume the outcome of 20 coin flips had been 18 heads. Change x to 18 in line 2 and run the script. Remember that the mean of the prior Beta(1,1) distribution is <span class="math inline">\(\alpha\)</span> / (<span class="math inline">\(\alpha\)</span> + <span class="math inline">\(\beta\)</span>), or 1/(1+1) = 0.5. The Frequentist mean is simply x/n, or 18/20=0.9. Which statement is true?</p>
<div class="cell" data-layout-align="center">
<div id="radio_VUWHELNRPN" class="webex-radiogroup">
<label><input type="radio" autocomplete="off" name="radio_VUWHELNRPN" value="answer"><span>The frequentist mean is <strong>higher</strong> than the mean of the posterior, because by combining the prior with the data, the mean of the posterior is <strong>closer</strong> to the mean of the prior distribution.</span></label><label><input type="radio" autocomplete="off" name="radio_VUWHELNRPN" value=""><span>The frequentist mean is <strong>lower</strong> than the mean of the posterior, because by combining the prior with the data, the mean of the posterior is <strong>closer</strong> to the mean of the prior distribution.</span></label><label><input type="radio" autocomplete="off" name="radio_VUWHELNRPN" value="answer"><span>The frequentist mean is <strong>higher</strong> than the mean of the posterior, because by combining the prior with the data, the mean of the posterior is <strong>further from</strong> the mean of the prior distribution.</span></label><label><input type="radio" autocomplete="off" name="radio_VUWHELNRPN" value=""><span>The frequentist mean is <strong>lower</strong> than the mean of the posterior, because by combining the prior with the data, the mean of the posterior is <strong>further from</strong> the mean of the prior distribution.</span></label>
<div id="radio_TUGCWOPMMU" class="webex-radiogroup">
<label><input type="radio" autocomplete="off" name="radio_TUGCWOPMMU" value="answer"><span>The frequentist mean is <strong>higher</strong> than the mean of the posterior, because by combining the prior with the data, the mean of the posterior is <strong>closer</strong> to the mean of the prior distribution.</span></label><label><input type="radio" autocomplete="off" name="radio_TUGCWOPMMU" value=""><span>The frequentist mean is <strong>lower</strong> than the mean of the posterior, because by combining the prior with the data, the mean of the posterior is <strong>closer</strong> to the mean of the prior distribution.</span></label><label><input type="radio" autocomplete="off" name="radio_TUGCWOPMMU" value="answer"><span>The frequentist mean is <strong>higher</strong> than the mean of the posterior, because by combining the prior with the data, the mean of the posterior is <strong>further from</strong> the mean of the prior distribution.</span></label><label><input type="radio" autocomplete="off" name="radio_TUGCWOPMMU" value=""><span>The frequentist mean is <strong>lower</strong> than the mean of the posterior, because by combining the prior with the data, the mean of the posterior is <strong>further from</strong> the mean of the prior distribution.</span></label>
</div>
</div>
<p><strong>Q6</strong>: What is, today, your best estimate of the probability that the sun will rise tomorrow? Assume you were born with an uniform Beta(1,1) prior. The sun can either rise, or not. Assume you have seen the sun rise every day since you were born, which means there has been a continuous string of successes for every day you have been alive. It is OK to estimate the days you have been alive by just multiplying your age by 365 days. What is your best estimate of the probability that the sun will rise tomorrow?</p>
Expand Down
Loading

0 comments on commit 92832c3

Please sign in to comment.