Skip to content

Commit

Permalink
Make edits to italics and notation
Browse files Browse the repository at this point in the history
  • Loading branch information
bradduthie committed Jul 25, 2024
1 parent 9828f1b commit b8c1e91
Show file tree
Hide file tree
Showing 41 changed files with 360 additions and 347 deletions.
2 changes: 1 addition & 1 deletion 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<meta name="author" content="A. Bradley Duthie" />


<meta name="date" content="2024-07-18" />
<meta name="date" content="2024-07-25" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion Chapter_1.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<meta name="author" content="A. Bradley Duthie" />


<meta name="date" content="2024-07-18" />
<meta name="date" content="2024-07-25" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion Chapter_10.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<meta name="author" content="A. Bradley Duthie" />


<meta name="date" content="2024-07-18" />
<meta name="date" content="2024-07-25" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion Chapter_11.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<meta name="author" content="A. Bradley Duthie" />


<meta name="date" content="2024-07-18" />
<meta name="date" content="2024-07-25" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
36 changes: 18 additions & 18 deletions Chapter_12.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Chapter_13.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<meta name="author" content="A. Bradley Duthie" />


<meta name="date" content="2024-07-18" />
<meta name="date" content="2024-07-25" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
2 changes: 1 addition & 1 deletion Chapter_14.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<meta name="author" content="A. Bradley Duthie" />


<meta name="date" content="2024-07-18" />
<meta name="date" content="2024-07-25" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
10 changes: 5 additions & 5 deletions Chapter_15.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<meta name="author" content="A. Bradley Duthie" />


<meta name="date" content="2024-07-18" />
<meta name="date" content="2024-07-25" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down Expand Up @@ -502,9 +502,9 @@ <h1><span class="header-section-number">Chapter 15</span> Introduction to probab
<h2><span class="header-section-number">15.1</span> Instructive example<a href="Chapter_15.html#instructive-example" class="anchor-section" aria-label="Anchor link to header"></a></h2>
<p>Probability focuses on the outcomes of trials, such as the <strong>outcome</strong> (heads or tails) of the <strong>trial</strong> of a coin flip.
The probability of a specific outcome is the relative number of times it is expected to happen given a large number of trials,</p>
<p><span class="math display">\[P(outcome) = \frac{Number\:of\:times\:outcome\:occurs}{Total\:number\:of\:trials}.\]</span></p>
<p><span class="math display">\[P(outcome) = \frac{\mathrm{Number\:of\:times\:outcome\:occurs}}{\mathrm{Total\:number\:of\:trials}}.\]</span></p>
<p>For the outcome of a flipped coin landing on heads,</p>
<p><span class="math display">\[P(heads) = \frac{Flips\:landing\:on\:heads}{Total\:number\:of\:flips}.\]</span></p>
<p><span class="math display">\[P(heads) = \frac{\mathrm{Flips\:landing\:on\:heads}}{\mathrm{Total\:number\:of\:flips}}.\]</span></p>
<p>As the total number of flips becomes very large, the number of flips that land on heads should get closer and closer to half the total, <span class="math inline">\(1/2\)</span> or <span class="math inline">\(0.5\)</span> (more on this later).
The above equations use the notation <span class="math inline">\(P(E)\)</span> to define the probability (<span class="math inline">\(P\)</span>) of some event (<span class="math inline">\(E\)</span>) happening.
Note that the number of times an outcome occurs cannot be less than 0, so <span class="math inline">\(P(E) \geq 0\)</span> must always be true.
Expand Down Expand Up @@ -592,14 +592,14 @@ <h2><span class="header-section-number">15.3</span> Sampling with and without re
<p>Figure 15.3 shows 10 playing cards: 5 hearts and 5 spades.
If we shuffle these cards thoroughly and randomly select 1 card, what is the probability of selecting a heart?
This is simply,</p>
<p><span class="math display">\[P(heart) = \frac{5\:hearts}{10\:total\:cards} = 0.5.\]</span></p>
<p><span class="math display">\[P(heart) = \frac{5\:\mathrm{hearts}}{10\mathrm{\:total\:cards}} = 0.5.\]</span></p>
<p>What is the probability of randomly selecting 2 hearts?
This depends if we are sampling with or without replacement.
If we sample 1 card, then put it back into the deck before sampling the second card, then the probability of sampling a heart does not change (in both samples, we have 5 hearts and 10 cards).
Hence, the probability of sampling 2 hearts with replacement is <span class="math inline">\(P(heart) \times P(heart) = 0.5 \times 0.5 = 0.25\)</span>.
If we do not put the first card back into the deck before sampling again, then we have changed the total number of cards.
After sampling the first heart, we have one fewer heart in the deck and one fewer card, so the new probability for sampling a heart becomes,</p>
<p><span class="math display">\[P(heart) = \frac{4\:hearts}{9\:total\:cards} = 0.444.\]</span></p>
<p><span class="math display">\[P(heart) = \frac{4\:\mathrm{hearts}}{9\:\mathrm{total\:cards}} = 0.444.\]</span></p>
<p>Since the probability has changed after the first heart is sampled, we need to use this adjusted probability when sampling without replacement.
In this case, the probability of sampling two hearts is <span class="math inline">\(0.5 \times 0.444 = 0.222\)</span>.
This is a bit lower than the probability of sampling with replacement because we have decreased the number of hearts that can be sampled.
Expand Down
2 changes: 1 addition & 1 deletion Chapter_16.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<meta name="author" content="A. Bradley Duthie" />


<meta name="date" content="2024-07-18" />
<meta name="date" content="2024-07-25" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
8 changes: 4 additions & 4 deletions Chapter_17.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<meta name="author" content="A. Bradley Duthie" />


<meta name="date" content="2024-07-18" />
<meta name="date" content="2024-07-25" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down Expand Up @@ -509,7 +509,7 @@ <h2><span class="header-section-number">17.1</span> Probabilities from a dataset
<p>Suppose that we want to estimate the probability that a new Power Up! game player will be an Android user.
To estimate this probability, we can use the proportion of players in the dataset who are Android users.
To get this proportion, we need to divide the number of Android users by the total number of players,</p>
<p><span class="math display">\[P(Android) = \frac{Number\:of\:Android\:users}{Number\:of\:players}.\]</span></p>
<p><span class="math display">\[P(Android) = \frac{\mathrm{Number\:of\:Android\:users}}{\mathrm{Number\:of\:players}}.\]</span></p>
<p>In jamovi, you could figure this out the long way by counting up the number of rows with ‘Android’ in the second column, then dividing by the total number of rows.
But there is an easier way, which is faster and less prone to human error than manually tallying up items.
To do this, go to the ‘Analyses’ tab in jamovi and navigate to ‘Exploration’, then ‘Descriptives’.
Expand Down Expand Up @@ -567,7 +567,7 @@ <h2><span class="header-section-number">17.1</span> Probabilities from a dataset
<p>We can use these estimated probabilities of small, medium, and large dam size selection to predict what will happen in future games.
Suppose that a new player decides to play the game.
What is the probability that this player chooses a small <strong>or</strong> a large dam?</p>
<p><span class="math inline">\(P(small\:or\:large) =\)</span> __________________________</p>
<p><span class="math inline">\(P(small\:\mathrm{or}\:large) =\)</span> __________________________</p>
<p>Now suppose that 3 new players arrive and decide to play the game.
What is the probability that all 3 of these new players choose a large dam?</p>
<p><span class="math inline">\(P(3\:large) =\)</span> __________________________</p>
Expand Down Expand Up @@ -597,7 +597,7 @@ <h2><span class="header-section-number">17.1</span> Probabilities from a dataset
</div>
<p>To get the proportion of Android users who choose to build a large dam, we just need to divide the number of Android users who chose the large dam size by the total number of Android users (i.e., sum of the first column in the Frequencies table; Figure 17.2).
Note that the vertical bar, <span class="math inline">\(|\)</span>, in the equation below just means ‘given’ (or, rather, ‘conditional up’, so the number of players that chose a large dam <em>given</em> that they are Android users),</p>
<p><span class="math display">\[P(Large | Android) = \frac{Number\:of\:Android\:users\:choosing\:large\:dam}{Number\:of\:Android\:users}.\]</span></p>
<p><span class="math display">\[P(Large | Android) = \frac{\mathrm{Number\:of\:Android\:users\:choosing\:large\:dam}}{\mathrm{Number\:of\:Android\:users}}.\]</span></p>
<p>Now, recreate the table in Figure 17.2 and estimate the probability that an Android user will choose to build a large dam,</p>
<p><span class="math inline">\(P(Large | Android) =\)</span> __________________________</p>
<p>Is <span class="math inline">\(P(Large | Android)\)</span> much different from the probability that <em>any</em> player chooses a large dam, as calculated in Table 17.1? Do you think that the difference is significant?</p>
Expand Down
8 changes: 4 additions & 4 deletions Chapter_18.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<meta name="author" content="A. Bradley Duthie" />


<meta name="date" content="2024-07-18" />
<meta name="date" content="2024-07-25" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down Expand Up @@ -518,14 +518,14 @@ <h2><span class="header-section-number">18.1</span> Normal distribution CIs<a hr
<p>Remember from the Central Limit Theorem in <a href="Chapter_16.html#Chapter_16">Chapter 16</a> that as our sample size <span class="math inline">\(N\)</span> increases, the distribution of our sample mean <span class="math inline">\(\bar{x}\)</span> will start looking more and more like a normal distribution.
Also from <a href="Chapter_16.html#Chapter_16">Chapter 16</a>, we know that we can calculate the probability associated with any interval of values in a normal distribution.
For example, we saw that about 68.2% of the probability density of a normal distribution is contained within one standard deviation of the mean.
We can use this knowledge from <a href="Chapter_16.html#Chapter_16">Chapter 16</a> to set confidence intervals for any percentage of values around the sample mean (<span class="math inline">\(\bar{x}\)</span>) using a standard error (SE) and z-score (z).
We can use this knowledge from <a href="Chapter_16.html#Chapter_16">Chapter 16</a> to set confidence intervals for any percentage of values around the sample mean (<span class="math inline">\(\bar{x}\)</span>) using a standard error (SE) and z-score (<span class="math inline">\(z\)</span>).
Confidence intervals include two numbers.
The <strong>lower confidence interval</strong> (LCI) is below the mean, and the <strong>upper confidence interval</strong> (UCI) is above the mean.
Here is how they are calculated,</p>
<p><span class="math display">\[LCI = \bar{x} - (z \times SE),\]</span></p>
<p><span class="math display">\[UCI = \bar{x} + (z \times SE).\]</span></p>
<p>Note that the equations are the same, except that for the LCI, we are subtracting <span class="math inline">\(z \times SE\)</span>, and for the UCI we are adding it.
The specific value of z determines the confidence interval that we are calculating.
The specific value of <span class="math inline">\(z\)</span> determines the confidence interval that we are calculating.
For example, about 95% of the probability density of a standard normal distribution lies between <span class="math inline">\(z = -1.96\)</span> and <span class="math inline">\(z = 1.96\)</span> (Figure 18.2).
Hence, if we use <span class="math inline">\(z = 1.96\)</span> to calculate LCI and UCI, we would be getting 95% confidence intervals around our mean (an interactive application<a href="#fn26" class="footnote-ref" id="fnref26"><sup>26</sup></a> helps visualise the relationship between probability intervals and z-scores more generally).</p>
<div class="figure"><span style="display:block;" id="fig:unnamed-chunk-77"></span>
Expand Down Expand Up @@ -576,7 +576,7 @@ <h2><span class="header-section-number">18.2</span> Binomial distribution CIs<a
One common method relies on a normal approximation, that is, approximating the discrete counts of the binomial distribution using the continuous normal distribution.
For example, we can note that the variance of <span class="math inline">\(p\)</span> for a binomial distribution is <span class="math inline">\(\sigma^{2} = p\left(1 - p\right)\)</span> <span class="citation">(<a href="#ref-Box1978" role="doc-biblioref">Box et al., 1978</a>; <a href="#ref-Sokal1995" role="doc-biblioref">Sokal &amp; Rohlf, 1995</a>)</span>.<a href="#fn31" class="footnote-ref" id="fnref31"><sup>31</sup></a>
This means that the standard deviation of <span class="math inline">\(p\)</span> is <span class="math inline">\(\sigma = \sqrt{p\left(1 - p\right)}\)</span>, and <span class="math inline">\(p\)</span> has a standard error,</p>
<p><span class="math display">\[SE(p) = \sqrt{\frac{p\left(1 - p\right)}{N}}.\]</span></p>
<p><span class="math display">\[\mathrm{SE}(p) = \sqrt{\frac{p\left(1 - p\right)}{N}}.\]</span></p>
<p>We could then use this standard error in the same equation from earlier for calculating CIs.
For example, if we wanted to calculate the lower 95% CI for <span class="math inline">\(\hat{p} = 0.55\)</span>,</p>
<p><span class="math display">\[LCI_{95\%} = 0.55 - 1.96 \sqrt{\frac{0.55\left(1 - 0.55\right)}{40}} = 0.396\]</span></p>
Expand Down
4 changes: 2 additions & 2 deletions Chapter_19.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<meta name="author" content="A. Bradley Duthie" />


<meta name="date" content="2024-07-18" />
<meta name="date" content="2024-07-25" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down Expand Up @@ -509,7 +509,7 @@ <h1><span class="header-section-number">Chapter 19</span> The t-interval<a href=
Figure 19.1: Standard normal probability distribution showing 95% of probability density surrounding the mean (dark grey shading). On top of the standard normal distribution in dark grey, hatched lines show a t-distribution with 19 degrees of freedom. Hatched lines indicate 95% of the probability density of the t-distribution.
</p>
</div>
<p>Note that in Figure 19.1, a t-distribution with 19 degrees of freedom (df) is shown.
<p>Note that in Figure 19.1, a t-distribution with 19 degrees of freedom (<span class="math inline">\(df\)</span>) is shown.
The t-distribution is parameterised using df, and we lose a degree of freedom when calculating <span class="math inline">\(s^{2}\)</span> from a sample size of <span class="math inline">\(N = 20\)</span>, so <span class="math inline">\(df = 20 - 1 = 19\)</span> is the correct value (see <a href="Chapter_12.html#Chapter_12">Chapter 12</a> for explanation).
For calculating CIs, df will always be <span class="math inline">\(N - 1\)</span>, and this will be taken care of automatically in jamovi<a href="#fn36" class="footnote-ref" id="fnref36"><sup>36</sup></a> <span class="citation">(<a href="#ref-Jamovi2022" role="doc-biblioref">The jamovi project, 2024</a>)</span>.</p>
<p>Recall from <a href="Chapter_18.html#Chapter_18">Chapter 18</a> that our body mass measurements of 20 cats had a sample mean of <span class="math inline">\(\bar{x} = 4.1\)</span> kg and sample standard deviation of <span class="math inline">\(s = 0.6\)</span> kg. We calculated the lower 95% CI to be <span class="math inline">\(LCI_{95\%} = 3.837\)</span> and the upper 95% CI to be <span class="math inline">\(UCI_{95\%} = 4.363\)</span>. We can now repeat the calculation using the t-score 2.093 instead of the z-score 1.96.
Expand Down
2 changes: 1 addition & 1 deletion Chapter_2.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<meta name="author" content="A. Bradley Duthie" />


<meta name="date" content="2024-07-18" />
<meta name="date" content="2024-07-25" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down
Loading

0 comments on commit b8c1e91

Please sign in to comment.