You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dat %>% group_by(BB_strata) %>%
summarize(slope = cor(HR_per_game, R_per_game)*sd(R_per_game)/sd(HR_per_game))
The above 3 small part of code are used to plot 3 x 4 scatter plots (HR_per_game versus R_per_game) and to show the slope of change from the original.
i.e. before showing below in the online version.
... In this case, the slopes do not change much from the original:
Please add back these 3 small part of R code in the online version of the book. Also, the PDF file of the whole book may be affected by this small issue.
Please check the online version.
If I am correct, please help us to add back these small parts of code in the next update.
Thanks in advance.
Best regards,
Jimmy
The text was updated successfully, but these errors were encountered:
Dear Rafael,
In the section 19.2.1 'Understanding confounding through stratification' of the online web version of the book.
Three small part of R code may be missing as below.
dat <- Teams %>% filter(yearID %in% 1961:2001) %>%
mutate(BB_strata = round(BB/G,1),
HR_per_game = HR/G,
R_per_game = R/G) %>%
filter(BB_strata >= 2.8 & BB_strata <= 3.9)
dat %>%
ggplot(aes(HR_per_game, R_per_game)) +
geom_point(alpha = 0.5) +
geom_smooth(method = "lm") +
facet_wrap(~BB_strata)
dat %>% group_by(BB_strata) %>%
summarize(slope = cor(HR_per_game, R_per_game)*sd(R_per_game)/sd(HR_per_game))
The above 3 small part of code are used to plot 3 x 4 scatter plots (HR_per_game versus R_per_game) and to show the slope of change from the original.
i.e. before showing below in the online version.
... In this case, the slopes do not change much from the original:
#> # A tibble: 12 x 2
#> BB_strata slope
#>
#> 1 2.8 1.53
#> 2 2.9 1.57
#> 3 3 1.52
#> 4 3.1 1.49
#> 5 3.2 1.58
#> 6 3.3 1.56
#> # ... with 6 more rows
...
These 3 small part of code can be found in file 'linear-models.Rmd' at
https://github.com/rafalab/dsbook/blob/master/regression/linear-models.Rmd
Please add back these 3 small part of R code in the online version of the book. Also, the PDF file of the whole book may be affected by this small issue.
Please check the online version.
If I am correct, please help us to add back these small parts of code in the next update.
Thanks in advance.
Best regards,
Jimmy
The text was updated successfully, but these errors were encountered: