Skip to content

Commit

Permalink
updating rendered website
Browse files Browse the repository at this point in the history
  • Loading branch information
lrjohnson0 committed Jul 11, 2024
1 parent 8f3afc7 commit c64b772
Show file tree
Hide file tree
Showing 33 changed files with 1,699 additions and 102 deletions.
4 changes: 2 additions & 2 deletions docs/Stats_review.html
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ <h1>Random Variables (RVs)</h1>
<li>discrete (numbers of items or successes)</li>
<li>continuous (heights, times, weights)</li>
</ul>
<p>We usually use capital letters – e.g.&nbsp;<span class="math inline">X</span>, <span class="math inline">Y</span>, sometimes with bold or with subscripts – to denote the RVs. In contrast we use lower case letters, e.g.&nbsp;<span class="math inline">x</span>, <span class="math inline">y</span>, <span class="math inline">k</span>, to denote the values that the RV takes. For instance, lets say that the heights of the woman at Virginia Tech are the RV, <span class="math inline">X</span>, and <span class="math inline">X</span> has a normal distribution with mean 62 inches and variance 6<span class="math inline">^2</span>, i.e., <span class="math inline">X \sim \mathrm{N}(62,6^2)</span> distribution. Say we then observe the heights of 3 individuals drawn from this distribution – we would write this as: <span class="math inline">x=(</span> 63.5, 66.3, 62.1 <span class="math inline">)</span>.</p>
<p>We usually use capital letters – e.g.&nbsp;<span class="math inline">X</span>, <span class="math inline">Y</span>, sometimes with bold or with subscripts – to denote the RVs. In contrast we use lower case letters, e.g.&nbsp;<span class="math inline">x</span>, <span class="math inline">y</span>, <span class="math inline">k</span>, to denote the values that the RV takes. For instance, lets say that the heights of the woman at Virginia Tech are the RV, <span class="math inline">X</span>, and <span class="math inline">X</span> has a normal distribution with mean 62 inches and variance 6<span class="math inline">^2</span>, i.e., <span class="math inline">X \sim \mathrm{N}(62,6^2)</span> distribution. Say we then observe the heights of 3 individuals drawn from this distribution – we would write this as: <span class="math inline">x=(</span> 58.8, 62.1, 64.2 <span class="math inline">)</span>.</p>
<p><br> <br> </p>
</section>
<section id="probability-distributions" class="level1">
Expand Down Expand Up @@ -564,7 +564,7 @@ <h1>Probability Distributions in <code>R</code></h1>
<div class="cell">
<div class="sourceCode cell-code" id="cb3"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="fu">rnorm</span>(<span class="dv">3</span>, <span class="at">mean=</span><span class="dv">0</span>, <span class="at">sd=</span><span class="dv">1</span>) <span class="do">## random draws</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
<div class="cell-output cell-output-stdout">
<pre><code>[1] -0.2085685 0.1056252 1.8288412</code></pre>
<pre><code>[1] 0.02318727 0.28406256 0.56712882</code></pre>
</div>
</div>
<div class="cell">
Expand Down
Binary file modified docs/Stats_review_files/figure-html/unnamed-chunk-7-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/Stats_review_files/figure-html/unnamed-chunk-8-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/Stats_review_files/figure-html/unnamed-chunk-9-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 11 additions & 11 deletions docs/VB_RegDiagTrans.html
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ <h2>SLR model assumptions</h2>
</section>
<section id="example-model-violations" class="slide level2">
<h2>Example model violations</h2>
<p><span style="color: red;">Anscombe’s quartet</span> comprises four datasets that have similar statistical properties ...</p>
<p><span style="color: red;">Anscombe’s quartet</span> comprises four datasets that have similar statistical properties </p>
<table>
<thead>
<tr class="header">
Expand Down Expand Up @@ -505,7 +505,7 @@ <h2>Example model violations</h2>
</section>
<section class="slide level2">

<p>...but vary considerably when graphed:</p>
<p>but vary considerably when graphed:</p>

<img data-src="VB_RegDiagTrans_files/figure-revealjs/unnamed-chunk-2-1.png" class="quarto-figure quarto-figure-center r-stretch" width="672"></section>
<section class="slide level2">
Expand All @@ -519,7 +519,7 @@ <h2>Example model violations</h2>
<img data-src="VB_RegDiagTrans_files/figure-revealjs/unnamed-chunk-5-1.png" class="quarto-figure quarto-figure-center r-stretch" width="672"></section>
<section class="slide level2">

<p>The regression lines and <span class="math inline">\(R^2\)</span> values are the same...<br>
<p>The regression lines and <span class="math inline">\(R^2\)</span> values are the same<br>
</p>
<table>
<thead>
Expand Down Expand Up @@ -560,7 +560,7 @@ <h2>Example model violations</h2>
</section>
<section class="slide level2">

<p>...but the residuals, <span class="math inline">\(e\)</span>, <strong><em>(plotted vs.&nbsp;<span class="math inline">\(\hat{Y~}\)</span>)</em></strong> look totally different.</p>
<p>but the residuals, <span class="math inline">\(e\)</span>, <strong><em>(plotted vs.</em></strong> <span class="math inline">\(\hat{Y~}\)</span>) look totally different.</p>

<img data-src="VB_RegDiagTrans_files/figure-revealjs/unnamed-chunk-6-1.png" class="quarto-figure quarto-figure-center r-stretch" width="672"></section>
<section class="slide level2">
Expand Down Expand Up @@ -628,7 +628,7 @@ <h2>Understanding Leverage</h2>
</ul>
<p>Here is a nice online (interactive) illustration of leverage:</p>
<center>
<a href="https://omaymas.shinyapps.io/Influence_Analysis/">https://omaymas.shinyapps.io/Influence_Analysis/</a>
<a href="https://omaymas.shinyapps.io/Influence_Analysis/" class="uri">https://omaymas.shinyapps.io/Influence_Analysis/</a>
</center>
<p><br></p>
<p><span style="color: red;">Outliers do more damage if they have high leverage!</span></p>
Expand All @@ -647,7 +647,7 @@ <h2>Standardized residuals</h2>
</section>
<section class="slide level2">

<p>About estimating <span class="math inline">\(s\)</span> under sketchy SLR assumptions ...</p>
<p>About estimating <span class="math inline">\(s\)</span> under sketchy SLR assumptions </p>
<p>We want to see whether any particular <span class="math inline">\(e_i\)</span> is “too big”, but we don’t want a single outlier to make <span class="math inline">\(s\)</span> artificially large.</p>
<p><br></p>
<div class="columns">
Expand Down Expand Up @@ -715,7 +715,7 @@ <h2>How to deal with outliers</h2>
<section id="outliers-leverage-and-residuals" class="slide level2">
<h2>Outliers, leverage, and residuals</h2>
<p><span style="color: red;">Warning:</span> <span style="color: dodgerblue;">Unfortunately, outliers with high leverage are hard to catch through</span> <span class="math inline">\(\color{dodgerblue}{r_i}\)</span> <span style="color: dodgerblue;">(since the line is pulled towards them)</span>.</p>
<p>Means get distracted by outliers...<br>
<p>Means get distracted by outliers<br>
</p>
<center>
<img data-src="graphics/distracted_mean_meme.jpg" style="height:4in">
Expand Down Expand Up @@ -870,7 +870,7 @@ <h2>Solution 1: Variance stabilizing transformations</h2>
<p><span style="color: dodgerblue;">We have a multiplicative model now!</span></p>
</div>
<p><br></p>
<p>Note: <strong>you <span style="color: red;">CANNOT</span> compare <span class="math inline">\(R^2\)</span> values for regressions corresponding to different transformations of the response.</strong></p>
<p>Note: <strong>you <span style="color: red;">CANNOT</span> compare</strong> <span class="math inline">\(R^2\)</span> values for regressions corresponding to different transformations of the response.</p>
<ul>
<li><p><span class="math inline">\(Y\)</span> and <span class="math inline">\(f(Y)\)</span> may not be on the same scale,</p></li>
<li><p>therefore <span class="math inline">\(\text{var}(Y)\)</span> and <span class="math inline">\(\text{var}(f(Y))\)</span> may not be either.</p></li>
Expand Down Expand Up @@ -912,7 +912,7 @@ <h2>Testing for nonlinearity</h2>
<p>To see if you need more nonlinearity, try the regression which includes the next polynomial term, and see if it is significant.</p>
<p>For example, to see if you need a <span style="color: dodgerblue;">quadratic term</span>,</p>
<ul>
<li><p>fit the model then run the regression <span class="math inline">\(\mathbb{E}[Y] = \beta_0 + \beta_1 X + \beta_2 X^2\)</span>.</p></li>
<li><p>fit the model then run the regression <span class="math inline">\(\mathbb{E}[Y] = \beta_0 + \beta_1 X + \beta_2 X^2\)</span>.</p></li>
<li><p><span style="color: red;">If your test implies</span> <span class="math inline">\(\color{dodgerblue}{\beta_2 \neq 0}\)</span>, <span style="color: red;">you need</span> <span class="math inline">\(\color{dodgerblue}{X^2}\)</span> in your model.</p></li>
</ul>
<p>Note: <span class="math inline">\(p\)</span>-values are calculated “given the other <span class="math inline">\(\beta\)</span>’s are nonzero”; i.e., conditional on <span class="math inline">\(X\)</span> being in the model.</p>
Expand Down Expand Up @@ -953,7 +953,7 @@ <h2>The log-log model</h2>
<p>In practice, this is often used in conjunction with a <span class="math inline">\(\log(Y)\)</span> response transformation. The log-log model is <span class="math display">\[
\color{red}{\log(Y) = \beta_0 + \beta_1 \log(X) + \varepsilon}.
\]</span></p>
<p>It is super useful, and has some special properties ...</p>
<p>It is super useful, and has some special properties </p>
</section>
<section class="slide level2">

Expand Down Expand Up @@ -1012,7 +1012,7 @@ <h2>Elasticity and the log-log model</h2>
</section>
<section class="slide level2">

<p><strong><em>Summary: <span style="color: red;">Plots of residuals v.s.</span> <span class="math inline">\(\color{red}X\)</span> <span style="color: red;">or</span> <span class="math inline">\(\color{red}{\hat{Y~}}\)</span> <span style="color: red;">are most important for diagnosing problems</span>.</em></strong></p>
<p><strong><em>Summary: <span style="color: red;">Plots of residuals v.s.</span></em></strong> <span class="math inline">\(\color{red}X\)</span> <span style="color: red;">or</span> <span class="math inline">\(\color{red}{\hat{Y~}}\)</span> <span style="color: red;">are most important for diagnosing problems</span>.</p>
<ul>
<li><p>Log transform is your top tool (log(<span class="math inline">\(X\)</span>), log(<span class="math inline">\(Y\)</span>), or both).</p></li>
<li><p>Add polynomial terms (e.g.&nbsp;<span class="math inline">\(X^2\)</span>) to get nonlinear mean patterns.</p>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/VB_RegDiagTrans_files/figure-revealjs/unnamed-chunk-20-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit c64b772

Please sign in to comment.