Skip to content

Commit

Permalink
update errata and site_libs
Browse files Browse the repository at this point in the history
  • Loading branch information
avehtari committed Feb 21, 2021
1 parent 5e8307b commit 53cf03c
Show file tree
Hide file tree
Showing 7 changed files with 231 additions and 375 deletions.
115 changes: 42 additions & 73 deletions R_visualizaton.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,29 @@
<script src="site_libs/bootstrap-3.3.5/js/bootstrap.min.js"></script>
<script src="site_libs/bootstrap-3.3.5/shim/html5shiv.min.js"></script>
<script src="site_libs/bootstrap-3.3.5/shim/respond.min.js"></script>
<style>h1 {font-size: 34px;}
h1.title {font-size: 38px;}
h2 {font-size: 30px;}
h3 {font-size: 24px;}
h4 {font-size: 18px;}
h5 {font-size: 16px;}
h6 {font-size: 12px;}
code {color: inherit; background-color: rgba(0, 0, 0, 0.04);}
pre:not([class]) { background-color: white }</style>
<script src="site_libs/navigation-1.1/tabsets.js"></script>
<link href="site_libs/highlightjs-9.12.0/default.css" rel="stylesheet" />
<script src="site_libs/highlightjs-9.12.0/highlight.js"></script>

<style type="text/css">code{white-space: pre;}</style>
<style type="text/css">
pre:not([class]) {
background-color: white;
}
</style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
</style>

<style type="text/css">code{white-space: pre;}</style>
<script type="text/javascript">
if (window.hljs) {
hljs.configure({languages: []});
Expand All @@ -42,32 +55,7 @@



<style type="text/css">
h1 {
font-size: 34px;
}
h1.title {
font-size: 38px;
}
h2 {
font-size: 30px;
}
h3 {
font-size: 24px;
}
h4 {
font-size: 18px;
}
h5 {
font-size: 16px;
}
h6 {
font-size: 12px;
}
.table th:not([align]) {
text-align: left;
}
</style>




Expand All @@ -78,10 +66,6 @@
margin-left: auto;
margin-right: auto;
}
code {
color: inherit;
background-color: rgba(0, 0, 0, 0.04);
}
img {
max-width:100%;
}
Expand All @@ -97,40 +81,13 @@
summary {
display: list-item;
}
pre code {
padding: 0;
}
</style>


<style type="text/css">
/* padding for bootstrap navbar */
body {
padding-top: 66px;
padding-bottom: 40px;
}
/* offset scroll position for anchor links (for fixed navbar) */
.section h1 {
padding-top: 71px;
margin-top: -71px;
}
.section h2 {
padding-top: 71px;
margin-top: -71px;
}
.section h3 {
padding-top: 71px;
margin-top: -71px;
}
.section h4 {
padding-top: 71px;
margin-top: -71px;
}
.section h5 {
padding-top: 71px;
margin-top: -71px;
}
.section h6 {
padding-top: 71px;
margin-top: -71px;
}
.dropdown-submenu {
position: relative;
}
Expand Down Expand Up @@ -158,7 +115,7 @@
margin-right: -10px;
}
.dropdown-submenu:hover>a:after {
border-left-color: #ffffff;
border-left-color: #adb5bd;
}
.dropdown-submenu.pull-left {
float: none;
Expand All @@ -170,7 +127,7 @@
}
</style>

<script>
<script type="text/javascript">
// manage active state of menu based on current page
$(document).ready(function () {
// active menu anchor
Expand All @@ -181,10 +138,23 @@
var menuAnchor = $('a[href="' + href + '"]');

// mark it active
menuAnchor.parent().addClass('active');
menuAnchor.tab('show');

// if it's got a parent navbar menu mark it active as well
menuAnchor.closest('li.dropdown').addClass('active');

// Navbar adjustments
var navHeight = $(".navbar").first().height() + 15;
var style = document.createElement('style');
var pt = "padding-top: " + navHeight + "px; ";
var mt = "margin-top: -" + navHeight + "px; ";
var css = "";
// offset scroll position for anchor links (for fixed navbar)
for (var i = 1; i <= 6; i++) {
css += ".section h" + i + "{ " + pt + mt + "}\n";
}
style.innerHTML = "body {" + pt + "padding-bottom: 40px; }\n" + css;
document.head.appendChild(style);
});
</script>

Expand All @@ -196,7 +166,6 @@
max-height: 500px;
min-height: 44px;
overflow-y: auto;
background: white;
border: 1px solid #ddd;
border-radius: 4px;
}
Expand Down Expand Up @@ -292,13 +261,13 @@
</div><!--/.container -->
</div><!--/.navbar -->

<div class="fluid-row" id="header">
<div id="header">



<h1 class="title toc-ignore">Regression and Other Stories - R and visualization</h1>
<h4 class="author">Andrew Gelman, Jennifer Hill, Aki Vehtari</h4>
<h4 class="date">Page updated: 2020-09-06</h4>
<h4 class="date">Page updated: 2021-02-11</h4>

</div>

Expand Down Expand Up @@ -335,7 +304,7 @@ <h2>R programming and visualization with R</h2>

// add bootstrap table styles to pandoc tables
function bootstrapStylePandocTables() {
$('tr.header').parent('thead').parent('table').addClass('table table-condensed');
$('tr.odd').parent('tbody').parent('table').addClass('table table-condensed');
}
$(document).ready(function () {
bootstrapStylePandocTables();
Expand All @@ -353,7 +322,7 @@ <h2>R programming and visualization with R</h2>

$(document).ready(function () {
$('.tabset-dropdown > .nav-tabs > li').click(function () {
$(this).parent().toggleClass('nav-tabs-open')
$(this).parent().toggleClass('nav-tabs-open');
});
});
</script>
Expand Down
6 changes: 5 additions & 1 deletion errata.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ If you notice an error that is not mentioned in the errata below, submit an issu
- p. 83, Fig 6.1 "y = 0.49 + 0.27 * x" $\rightarrow$ "y = 0.4 + 0.27 * x"
- p. 83, Fig 6.2 Estimate for $\sigma$ should be 0.49 (not 0.43)
- p. 84, "which returns the value R^2 = 0.10, meaning that the linear model accounts for only 9% of the variance". The "9%" should be "10%".
- p. 105, just before Maximum likelihood section "see Exercise 7.1" $\rightarrow$ "see Exercise 8.1" (thanks to Jacob Warren)
- p. 116, the correct code should have `y_linpred <- a + b*as.numeric(new)` and `y_pred <- a + b*as.numeric(new) + rnorm(n_sims, 0, sigma)` (thanks to Nathan Hoffmann)
- p. 128, "Do Exercise 3.8" $\rightarrow$ "Do Exercise 4.8" (thanks to Omri Har-Shemesh and Juliette Unwin)
- p. 131, "the average or expected difference in outcome $y_k$" $\rightarrow$ "... $y$" (thanks to Yoav Kessler)
Expand All @@ -45,12 +46,15 @@ If you notice an error that is not mentioned in the errata below, submit an issu
- p. 219, "The inverse logistic function is curved" $\rightarrow$ "The inverse logit function is curved" (thanks to VicentModesto)
- p. 241-242, in paragraphs starting "The steps go..." and "Figure 14.2...": $(4.0/4.1)x_1$ $\rightarrow$ $(4.4/4.1)x_1$ (thanks to Doug Davidson)
- p. 288, Chapter 15 Bibliographic note is missing the reference to the RiskyBehavior data: "The HIV risk data (RiskyBehavior) used in exercises comes fromcomes from El-Bassel et al (2003)." Full reference: El-Bassel, N., Witte, S. S., Gilbert, L., Wu, E., Chang, M., Hill, J., and Steinglass, P. (2003). The efficacy of a relationship-based HIV/STD prevention program for heterosexual couples. *American Journal of Public Health*, **93**, 963–969.
- p. 314, Following Equation (17.1) "... did not include enough Republicans." $\rightarrow$ "... included too many Democrats." (thanks to misterblister)
- p. 314, Following Equation (17.1) "... did not include enough Republicans." $\rightarrow$ "... included too many Democrats." (thanks to Mark Fisher)
- p. 316, Figure 17.2 the values in the column $N_j/N$ should be $0.16, 0.17, 0.19, 0.17, 0.16, 0.15$ as in the code on the same page. (thanks to Noah Silbert)
- p. 344, "...Figure 18.1 yields a naive estimated treatment effect of -12.5." $\rightarrow$ "...Figure 18.1 yields a naive estimated treatment effect of +12.5." (thanks to Michael McLaren)
- p. 345, "difference in means, $155-147.5$" $\rightarrow$ "difference in means, $147.5 - 155$" (thanks to Michael McLaren)
- p. 345, at the bottom "More to the point, the $y_i^0$'s are 140, 140, 150, and 170 in the *control* group and 150, 160, 160, and 170 in the *treatment* group." $\rightarrow$ "More to the point, the $y_i^0$'s are 140, 140, 150, and 170 in the *treatment* group and
150, 160, 160, and 170 in the *control* group." (thanks to Ravi Shroff)
- p. 371, "in Figure 19.4a" $\rightarrow$ "in Figure 19.4b" (thanks to Kenneth Tay)
- p. 385, equation number (20.1) should be for the second equation on the page $y_i = \beta^*_0 + \beta^*_1z_i + \epsilon^*_i$ (thanks to Matěj Grabovsky)
- p. 397, last line, in the standard error equation 1738 $\rightarrow$ 1820, 789 $\rightarrow$ 837, and 1.01 $\rightarrow$ 1.04 (thanks to Matěj Grabovsky)
- p. 435, equation 21.7: "$\beta_2 *\mbox{math pre-test}_i$" $\rightarrow$ "$\beta_3 *\mbox{math pre-test}_i$" (thanks to Zhengchen Cai)
- p. 447, "populations homogeneous in $w_i$" $\rightarrow$ "populations homogeneous in $x_i$" (thanks to Kenneth Tay)

Expand Down
Loading

0 comments on commit 53cf03c

Please sign in to comment.