Code Monkey home page Code Monkey logo

appliedstats's People

Contributors

chadyuu avatar coatless avatar cxzhang4 avatar daviddalpiaz avatar davidunger avatar djoldman avatar dkrovi2 avatar dmcquillan314 avatar eloiserosen avatar eveomett avatar greenfacts avatar ivanvc avatar jeffgerlach avatar jinfengxiao avatar junkim327 avatar ksezgin80 avatar kyleholgate avatar langholz avatar linuxdream avatar luke199629 avatar mohamed-180 avatar nbalepur avatar ossamasijbesma avatar purecod3 avatar pvsdileep avatar rayfix avatar sidpssp avatar tdcnguyen avatar tonymuu avatar willtsai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

appliedstats's Issues

Switch over to GH Actions runner

Some steps to be taken:

  1. Disabling .travis.yaml by deleting it
  2. Remove deployment/ folder
  3. Add .github/workflows/bookdown.yaml

Notes:

  • We'll use a slightly modified bookdown action to avoid reliance on Netlify.
  • The main website will remain "active", but until the runner builds will not automatically update.
  • It may be advantageous in non-peak hours to rebuild the gh-pages branch as it contains old artifacts.

Correct a typo

On 8.7 "We modify our notation slightly to make it clear that the the predicted value is a function of", there is double words "the", I tested on IE and Chrome, both displayed double "the".

build leave behind a data/example-data.csv file

When you perform a clean build from index.Rmd the file data/example-data.csv shows up as an untracked file.

I would expect things to be clean after a book build.

It looks like there is a very similar and possibly unused file called data/example_data.csv The only difference is between an underbar and a minus.

RStudio “cheatsheets” in section 6.5 redirects to "Page Not Found"

If you click on the hyperlink RStudio “cheatsheets”in section 6.5, it redirects to an old page which is not present anymore.

The old page URL is:
https://www.rstudio.com/wp-content/uploads/2016/01/rstudio-IDE-cheatsheet.pdf

However, Rstudio seems to have updated this cheatsheet to a new URL, which is as follows:
https://www.rstudio.com/wp-content/uploads/2019/01/Cheatsheets_2019.pdf

This can be easily updated in the r-resources.Rmd file.

applied_statistics.rds

The file applied_statistics.rds shows up with version control status when you do a build. Should this file be git ignored?

RGL Embedded Least Squares / ANOVA Plot

Interactive vs. stagnate plots requires use of rgl

To use with rmarkdown, might need to enable hook_webgl()? Need fallback for pdf version. (JS Error)

open3d()
x = rnorm(100)
y = rnorm(100)
z = 0.2*x - 0.3*y + rnorm(100, sd = 0.3)
fit = lm(z ~ x + y)
plot3d(x, y, z, type = "s", col = "red", size = 1)
coefs = coef(fit)
a = coefs["x"]
b = coefs["y"]
c = -1
d = coefs["(Intercept)"]
planes3d(a, b, c, d, alpha = 0.5)

Better version in car::scatter3d:

http://www.inside-r.org/packages/cran/car/docs/identify3d

See:

http://www.ats.ucla.edu/stat/r/dae/intreg.htm

For anova plot

Table text content

Text content in all tables not center aligned, but header displays are.
Screen Shot 2019-05-15 at 7 20 01 PM

Purl

Seemingly random permissions error when creating .R file. (Quits at random line.)

What should be done for "TODO: coercion" in chapter3

TODO: coercion seems to be left unresolved.

- TODO: coercion

However, I think there is an explanation for coercion as follows.

```{r}
sum(x > 3)
as.numeric(x > 3)
```
Here we see that using the `sum()` function on a vector of logical `TRUE` and `FALSE` values that is the result of `x > 3` results in a numeric result. `R` is first automatically coercing the logical to numeric where `TRUE` is `1` and `FALSE` is `0`. This coercion from logical to numeric happens for most mathematical operations.

Should we delete the TODO line or fix something more?

LaTeX equation conversion hiccups under epub

Looks like some equations do not use valid latex for epub.

I think \bf needs to be switched to \boldsymbol{}. Not a show-stopper.

list of equation issues
[WARNING] Could not convert TeX math '
  (\alpha \beta)_{1j} + (\alpha \beta)_{2j} + (\alpha \beta)_{3j} = 0 \\
  (\alpha \beta)_{i1} + (\alpha \beta)_{i2} + (\alpha \beta)_{i3} + (\alpha \beta)_{i4} = 0
  ', rendering as TeX:
  (\alpha \beta)_{1j} + (\alpha \beta)_{2j
  ^
  unexpected "("
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  Y \mid {\bf X} = {\bf x} \sim N(\beta_0 + \beta_1x_1 + \ldots + \beta_{p - 1}x_{p - 1}, \ \sigma^2)
  ', rendering as TeX:
  
              ^
  unexpected "X"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\eta({\bf x})', rendering as TeX:
  \eta({\bf x})
            ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\eta({\bf x}) = \beta_0 + \beta_1 x_1 + \beta_2 x_2 + \ldots  + \beta_{p - 1} x_{p - 1}', rendering as TeX:
  \eta({\bf x}) = \beta_0 + \beta_1 x_1 + 
            ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\eta({\bf x})', rendering as TeX:
  \eta({\bf x})
            ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\text{E}[Y \mid {\bf X} = {\bf x}]', rendering as TeX:
  ext{E}[Y \mid {\bf X} = {\bf x}]
                     ^
  unexpected "X"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  \eta({\bf x}) = g\left(\text{E}[Y \mid {\bf X} = {\bf x}]\right).
  ', rendering as TeX:
  
            ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math 'Y \mid {\bf X} = {\bf x}', rendering as TeX:
  Y \mid {\bf X} = {\bf x}
              ^
  unexpected "X"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math 'N(\mu({\bf x}), \sigma^2)', rendering as TeX:
  N(\mu({\bf x}), \sigma^2)
             ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\text{Pois}(\lambda({\bf x}))', rendering as TeX:
  Pois}(\lambda({\bf x}))
                     ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\text{Bern}(p({\bf x}))', rendering as TeX:
  \text{Bern}(p({\bf x}))
                     ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\text{E}[Y \mid {\bf X} = {\bf x}]', rendering as TeX:
  ext{E}[Y \mid {\bf X} = {\bf x}]
                     ^
  unexpected "X"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\mu({\bf x})', rendering as TeX:
  \mu({\bf x})
           ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\lambda({\bf x})', rendering as TeX:
  \lambda({\bf x})
               ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math 'p({\bf x})', rendering as TeX:
  p({\bf x})
         ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\eta({\bf x}) = \mu({\bf x})', rendering as TeX:
  \eta({\bf x}) = \mu({\bf x})
            ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\eta({\bf x}) = \log(\lambda({\bf x}))', rendering as TeX:
  \eta({\bf x}) = \log(\lambda({\bf x}))
            ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\eta({\bf x}) = \log \left(\frac{p({\bf x})}{1 - p({\bf x})} \right)', rendering as TeX:
  \eta({\bf x}) = \log \left(\frac{p({\bf 
            ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\mu({\bf x}) = \eta({\bf x})', rendering as TeX:
  \mu({\bf x}) = \eta({\bf x})
           ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\lambda({\bf x}) = e^{\eta({\bf x})}', rendering as TeX:
  \lambda({\bf x}) = e^{\eta({\bf x})}
               ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math 'p({\bf x}) = \frac{e^{\eta({\bf x})}}{1 + e^{\eta({\bf x})}} = \frac{1}{1 + e^{-\eta({\bf x})}}', rendering as TeX:
  p({\bf x}) = \frac{e^{\eta({\bf x})}}{1 
         ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\eta({\bf x})', rendering as TeX:
  \eta({\bf x})
            ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  \eta({\bf x}) = g\left(\text{E}[Y \mid {\bf X} = {\bf x}]\right).
  ', rendering as TeX:
  
            ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  \text{E}[Y \mid {\bf X} = {\bf x}] = g^{-1}(\eta({\bf x})).
  ', rendering as TeX:
  
                     ^
  unexpected "X"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  p({\bf x}) = P[Y = 1 \mid {\bf X} = {\bf x}]
  ', rendering as TeX:
  
         ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  P[Y = 0 \mid {\bf X} = {\bf x}] + P[Y = 1 \mid {\bf X} = {\bf x}] = 1
  ', rendering as TeX:
  
                    ^
  unexpected "X"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  P[Y = 0 \mid {\bf X} = {\bf x}] = 1 - p({\bf x})
  ', rendering as TeX:
  
                    ^
  unexpected "X"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  \log\left(\frac{p({\bf x})}{1 - p({\bf x})}\right) = \beta_0 + \beta_1 x_1 + \ldots  + \beta_{p - 1} x_{p - 1}
  ', rendering as TeX:
  
                     ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  \frac{p({\bf x})}{1 - p({\bf x})} = \frac{P[Y = 1 \mid {\bf X} = {\bf x}]}{P[Y = 0 \mid {\bf X} = {\bf x}]}
  ', rendering as TeX:
  
               ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math 'p({\bf x})', rendering as TeX:
  p({\bf x})
         ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  Y \mid {\bf X} = {\bf x} \sim N(\beta_0 + \beta_1x_1 + \ldots + \beta_qx_q, \ \sigma^2).
  ', rendering as TeX:
  
              ^
  unexpected "X"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math 'p({\bf x})', rendering as TeX:
  p({\bf x})
         ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  \log\left(\frac{p({\bf x})}{1 - p({\bf x})}\right) = \beta_0 + \beta_1 x_1 + \ldots  + \beta_{q} x_{q}
  ', rendering as TeX:
  
                     ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math 'p({\bf x})', rendering as TeX:
  p({\bf x})
         ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  p({\bf x}) = P[Y = 1 \mid {\bf X} = {\bf x}] = \frac{e^{\beta_0 + \beta_1 x_{1} + \cdots + \beta_{p-1} x_{(p-1)}}}{1 + e^{\beta_0 + \beta_1 x_{1} + \cdots + \beta_{p-1} x_{(p-1)}}}
  ', rendering as TeX:
  
         ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  \log\left(\frac{p({\bf x_i})}{1 - p({\bf x_i)})}\right) = \beta_0 + \beta_1 x_{i1} + \cdots + \beta_{p-1} x_{i(p-1)}
  ', rendering as TeX:
  
                     ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math 'P[Y_i = 1 \mid {\bf X_i} = {\bf x_i}]', rendering as TeX:
  [Y_i = 1 \mid {\bf X_i} = {\bf x_i}]
                     ^
  unexpected "X"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  p({\bf x_i}) = P[Y_i = 1 \mid {\bf X_i} = {\bf x_i}] = \frac{e^{\beta_0 + \beta_1 x_{i1} + \cdots + \beta_{p-1} x_{i(p-1)}}}{1 + e^{\beta_0 + \beta_1 x_{i1} + \cdots + \beta_{p-1} x_{i(p-1)}}}
  ', rendering as TeX:
  
         ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  1 - p({\bf x_i}) = P[Y_i = 0 \mid {\bf X} = {\bf x_i}] = \frac{1}{1 + e^{\beta_0 + \beta_1 x_{i1} + \cdots + \beta_{p-1} x_{i(p-1)}}}
  ', rendering as TeX:
  
             ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  L(\boldsymbol{{\beta}}) = \prod_{i = 1}^{n} P[Y_i = y_i \mid {\bf X_i} = {\bf x_i}]
  ', rendering as TeX:
  
                     ^
  unexpected "X"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  L(\boldsymbol{{\beta}}) = \prod_{i = 1}^{n} p({\bf x_i})^{y_i} (1 - p({\bf x_i}))^{(1 - y_i)}
  ', rendering as TeX:
  
                     ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  L(\boldsymbol{{\beta}}) = \prod_{i : y_i = 1}^{n} p({\bf x_i}) \prod_{j : y_j = 0}^{n} (1 - p({\bf x_j}))
  ', rendering as TeX:
  
                     ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  {\bf x_i}^{\top} \boldsymbol{{\beta}^*} > 0 \implies y_i = 1
  ', rendering as TeX:
  
       ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  {\bf x_i}^{\top} \boldsymbol{{\beta}^*} < 0 \implies y_i = 0
  ', rendering as TeX:
  
       ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\text{E}[Y \mid {\bf X} = {\bf x}]', rendering as TeX:
  ext{E}[Y \mid {\bf X} = {\bf x}]
                     ^
  unexpected "X"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\text{E}[Y \mid {\bf X} = {\bf x}] = P[Y = 1 \mid {\bf X} = {\bf x}]', rendering as TeX:
  ext{E}[Y \mid {\bf X} = {\bf x}] = P[Y =
                     ^
  unexpected "X"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  \begin{aligned}
  \text{E}[Y \mid {\bf X} = {\bf x}] &=  1 \cdot P[Y = 1 \mid {\bf X} = {\bf x}] + 0 \cdot P[Y = 0 \mid {\bf X} = {\bf x}] \\
                                    &= P[Y = 1 \mid {\bf X} = {\bf x}]
  \end{aligned}
  ', rendering as TeX:
  egin{aligned}
                     ^
  unexpected "X"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\text{E}[Y \mid {\bf X} = {\bf x}]', rendering as TeX:
  ext{E}[Y \mid {\bf X} = {\bf x}]
                     ^
  unexpected "X"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math 'P[Y = 1 \mid {\bf X} = {\bf x}]', rendering as TeX:
  P[Y = 1 \mid {\bf X} = {\bf x}]
                    ^
  unexpected "X"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  \log\left(\frac{p({\bf x})}{1 - p({\bf x})}\right) = -2 + 3 x
  ', rendering as TeX:
  
                     ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  \begin{aligned}
  Y_i \mid {\bf X_i} = {\bf x_i} &\sim \text{Bern}(p_i) \\
  p_i &= p({\bf x_i}) = \frac{1}{1 + e^{-\eta({\bf x_i})}} \\
  \eta({\bf x_i}) &= -2 + 3 x_i
  \end{aligned}
  ', rendering as TeX:
  \begin{aligned}
                ^
  unexpected "X"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\hat{\eta}({\bf x}) = \log\left(\frac{\hat{p}({\bf x})}{1 - \hat{p}({\bf x})}\right)', rendering as TeX:
  \hat{\eta}({\bf x}) = \log\left(\frac{\h
                  ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\hat{p}({\bf x}) = \frac{e^{\hat{\eta}({\bf x})}}{1 + e^{\hat{\eta}({\bf x})}} = \frac{1}{1 + e^{-\hat{\eta}({\bf x})}}', rendering as TeX:
  \hat{p}({\bf x}) = \frac{e^{\hat{\eta}({
               ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math 'P[Y = 1 \mid {\bf X} = {\bf x}]', rendering as TeX:
  P[Y = 1 \mid {\bf X} = {\bf x}]
                    ^
  unexpected "X"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\hat{\text{E}}[Y \mid {\bf X} = {\bf x}]', rendering as TeX:
  xt{E}}[Y \mid {\bf X} = {\bf x}]
                     ^
  unexpected "X"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math 'P[Y = 1 \mid {\bf X} = {\bf x}]', rendering as TeX:
  P[Y = 1 \mid {\bf X} = {\bf x}]
                    ^
  unexpected "X"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  \log\left(\frac{\hat{p}({\bf x})}{1 - \hat{p}({\bf x})}\right) = -2.3 + 3.7 x
  ', rendering as TeX:
  
                     ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\hat{p}({\bf x})', rendering as TeX:
  \hat{p}({\bf x})
               ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  \log\left(\frac{p({\bf x})}{1 - p({\bf x})}\right) = 1 + -4 x.
  ', rendering as TeX:
  
                     ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  \begin{aligned}
  Y_i \mid {\bf X_i} = {\bf x_i} &\sim \text{Bern}(p_i) \\
  p_i &= p({\bf x_i}) = \frac{1}{1 + e^{-\eta({\bf x_i})}} \\
  \eta({\bf x_i}) &= 1 + -4 x_i
  \end{aligned}
  ', rendering as TeX:
  \begin{aligned}
                ^
  unexpected "X"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\hat{p}({\bf x})', rendering as TeX:
  \hat{p}({\bf x})
               ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  \log\left(\frac{p({\bf x})}{1 - p({\bf x})}\right) = -1.5 + 0.5x + x^2.
  ', rendering as TeX:
  
                     ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  \begin{aligned}
  Y_i \mid {\bf X_i} = {\bf x_i} &\sim \text{Bern}(p_i) \\
  p_i &= p({\bf x_i}) = \frac{1}{1 + e^{-\eta({\bf x_i})}} \\
  \eta({\bf x_i}) &= -1.5 + 0.5x_i + x_i^2
  \end{aligned}
  ', rendering as TeX:
  \begin{aligned}
                ^
  unexpected "X"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  \eta({\bf x}) = \beta_0 + \beta_1 x_1 + \beta_2 x_2 + \ldots  + \beta_{p - 1} x_{p - 1}
  ', rendering as TeX:
  
            ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  \log\left(\frac{p({\bf x})}{1 - p({\bf x})}\right) = \beta_0 + \beta_1 x_1 + \ldots  + \beta_{p - 1} x_{p - 1}
  ', rendering as TeX:
  
                     ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  \log\left(\frac{p({\bf x_i})}{1 - p({\bf x_i})}\right) = \beta_0 + \beta_1 x_{i1} + \beta_2 x_{i2} + \cdots + \beta_{(p-1)} x_{i(p-1)} + \epsilon_i
  ', rendering as TeX:
  
                     ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  \log\left(\frac{p({\bf x_i})}{1 - p({\bf x_i})}\right) = \beta_0 + \beta_1 x_{i1} + \beta_2 x_{i2} + \cdots + \beta_{(q-1)} x_{i(q-1)} + \epsilon_i
  ', rendering as TeX:
  
                     ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  \frac{\hat{\eta}({\bf x}) - \eta({\bf x})}{\text{SE}[\hat{\eta}({\bf x})]} \overset{\text{approx}}{\sim} N(0, 1)
  ', rendering as TeX:
  
                     ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\eta({\bf x})', rendering as TeX:
  \eta({\bf x})
            ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  \hat{\eta}({\bf x}) \pm z_{\alpha/2} \cdot \text{SE}[\hat{\eta}({\bf x})]
  ', rendering as TeX:
  
                  ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math 'p({\bf x})', rendering as TeX:
  p({\bf x})
         ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math 'p({\bf x})', rendering as TeX:
  p({\bf x})
         ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  \left(\text{logit}^{-1}(\hat{\eta}({\bf x}) - z_{\alpha/2} \cdot \text{SE}[\hat{\eta}({\bf x})] ), \ \text{logit}^{-1}(\hat{\eta}({\bf x}) + z_{\alpha/2} \cdot \text{SE}[\hat{\eta}({\bf x})])\right)
  ', rendering as TeX:
  
                     ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\hat{\eta}({\bf x})', rendering as TeX:
  \hat{\eta}({\bf x})
                  ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\text{SE}[\hat{\eta}({\bf x})]', rendering as TeX:
  E}[\hat{\eta}({\bf x})]
                     ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\eta({\bf x})', rendering as TeX:
  \eta({\bf x})
            ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math 'p({\bf x})', rendering as TeX:
  p({\bf x})
         ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\eta({\bf x})', rendering as TeX:
  \eta({\bf x})
            ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math 'p({\bf x})', rendering as TeX:
  p({\bf x})
         ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\eta({\bf x})', rendering as TeX:
  \eta({\bf x})
            ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  \log\left(\frac{p({\bf x})}{1 - p({\bf x})}\right) = 
  \beta_0 +
  \beta_{1}x_{\texttt{alcohol}} +
  \beta_{2}x_{\texttt{ldl}} +
  \beta_{3}x_{\texttt{famhist}} +
  \beta_{4}x_{\texttt{typea}} +
  \beta_{5}x_{\texttt{age}} +
  \beta_{6}x_{\texttt{ldl}}x_{\texttt{famhist}} +
  \beta_{7}x_{\texttt{ldl}}^2
  ', rendering as TeX:
  
                     ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  p({\bf x}) = P[Y = 1 \mid {\bf X} = {\bf x}]
  ', rendering as TeX:
  
         ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  1 - p({\bf x}) = P[Y = 0 \mid {\bf X} = {\bf x}].
  ', rendering as TeX:
  
             ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  C^B({\bf x}) = \underset{k}{\mathrm{argmax}} \ P[Y = k \mid {\bf X = x}].
  ', rendering as TeX:
  
           ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  \hat{C}(\bf x) = 
  \begin{cases} 
        1 & p({\bf x}) > 0.5 \\
        0 & p({\bf x}) \leq 0.5 
  \end{cases}
  ', rendering as TeX:
  
              ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  \hat{C}({\bf x}) = \underset{k}{\mathrm{argmax}} \ \hat{P}[Y = k \mid {\bf X = x}].
  ', rendering as TeX:
  
               ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\hat{p}({\bf x}) = 1 - \hat{p}({\bf x})', rendering as TeX:
  \hat{p}({\bf x}) = 1 - \hat{p}({\bf x})
               ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  \hat{C}(\bf x) = 
  \begin{cases} 
        1 & \hat{p}({\bf x}) > 0.5 \\
        0 & \hat{p}({\bf x}) \leq 0.5 
  \end{cases}
  ', rendering as TeX:
  
              ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '\hat{p}({\bf x})', rendering as TeX:
  \hat{p}({\bf x})
               ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  \text{Misclass}(\hat{C}, \text{Data}) = \frac{1}{n}\sum_{i = 1}^{n}I(y_i \neq \hat{C}({\bf x_i}))
  ', rendering as TeX:
  
                     ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  I(y_i \neq \hat{C}({\bf x_i})) = 
  \begin{cases} 
    0 & y_i = \hat{C}({\bf x_i}) \\
    1 & y_i \neq \hat{C}({\bf x_i}) \\
  \end{cases}
  ', rendering as TeX:
  
                     ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  \eta({\bf x}) = 0 \iff p({\bf x}) = 0.5
  ', rendering as TeX:
  
            ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace
[WARNING] Could not convert TeX math '
  \hat{C}(\bf x) = 
  \begin{cases} 
        1 & \hat{p}({\bf x}) > c \\
        0 & \hat{p}({\bf x}) \leq c 
  \end{cases}
  ', rendering as TeX:
  
              ^
  unexpected "x"
  expecting "%", "\\label", "\\nonumber" or whitespace

Typos in Logistic chapter

I am reading through the chapter and found some typos/inconsistencies - sorry for not making a pull request (and thanks for making this great book available!)

When introducing the sigmoid function you have

\text{logit}^{-1}(\xi) = \frac{e^\xi}{1 + e^{\xi}} = \frac{1}{1 + e^{-\xi}}

it should be

\text{logit}^{-1}(\xi) = \frac{e^\xi}{1 + e^{\xi}} = \frac{1}{1 + e^{-\xi}}-1

I believe.

Some lines above you have

(Note, many more machine learning focused texts will use p as the number of parameters. This is an arbitrary choice, but you should be aware of it.)

but you are also using p as the number of parameters, so I was confused by the sentence.

Transparency

par(bg = NA)

Also, make plot text grey, to allow for dark and light backgrounds?

Digits

Fix rounding and scientific notation. Remove as much rounding as possible.

Conditioning

Consider notation that makes conditioning explicit.

ucidata

Instead of doing the download.files() and read.csv() route, how about just embedding the necessary data sets within an R package ala ucidata. From here, the information could downloaded via CRAN or a GH only release.

I think the only data you needed was: autompg?

In the future, these different packages or routines can be made into "virtual" or self-contained STAT 420 package that includes all the relevant material (c.f. msos)

Graphics needs to be systematized

It would be nice to come up with an indexing scheme for all graphics (figures, plots, tables, etc) so they can be easily and unambiguously referenced from either HTML or PDF text.
For example:
In 7.1.1, after the words"However, its variance remains constant for each xi", there is a following wording to reference a picture with a graph: "This is visually displayed in the image below". I see you guys have fixed it a bit, since I first noticed it, where the picture was actually above the wording, not below. However, still the picture is way down, not even on the same page, but on the next one. It would be better to have a numerical reference, not relative one.

5-19_view
6-16_view

Box-Cox

Extract lambda which maximizes.

Pre-run specific code chunks.

Doing a quick performance benchmark, I see two code chunks eating up a crazy amount of time (> 4 minutes of execution):

appliedstats/anova.Rmd

Lines 411 to 414 in cc73a82

```{r}
library(broom)
sim_anova = function(n = 10, mu_a = 0, mu_b = 0, mu_c = 0, mu_d = 0, sigma = 1, stat = TRUE) {

appliedstats/anova.Rmd

Lines 520 to 530 in cc73a82

```{r}
get_p_val = function() {
# create data for two groups, equal mean
y = rnorm(20, mean = 0, sd = 1)
g = c(rep("A", 10), rep("B", 10))
# p-value of t-test when null is true
glance(t.test(y ~ g, var.equal = TRUE))$p.value
}

Maybe save result and manually reload?

```{r sim-anova-function, echo = FALSE}
library(broom)

sim_anova = function(n = 10, mu_a = 0, mu_b = 0, mu_c = 0, mu_d = 0, sigma = 1, stat = TRUE) {
  
  # create data from one-way ANOVA model with four groups of equal size
  # response simulated from normal with group mean, shared variance
  # group variable indicates group A, B, C or D
  sim_data = data.frame(
    response = c(rnorm(n = n, mean = mu_a, sd = sigma),
                 rnorm(n = n, mean = mu_b, sd = sigma),
                 rnorm(n = n, mean = mu_c, sd = sigma),
                 rnorm(n = n, mean = mu_d, sd = sigma)),
    group = c(rep("A", times = n), rep("B", times = n), 
              rep("C", times = n), rep("D", times = n))
  )
  
  # obtain F-statistic and p-value for testing difference of means
  # use lm instead of aov for better result formatting with glance
  aov_results = lm(response ~ group, data = sim_data)
  f_stat = glance(aov_results)$statistic
  p_val  = glance(aov_results)$p.value
  
  # return f_stat if stat = TRUE, otherwise, p-value
  ifelse(stat, f_stat, p_val)
  
}
```

```{r sample-sim-anova-simulation, eval = FALSE}
f_stats = replicate(n = 5000, sim_anova(stat = TRUE))
```


```{r cache-simulation, eval = FALSE, echo = FALSE}
<<sample-sim-anova-simulation>>
saveRDS("cache/f_statistics_simulation.rds", version = 2)
```


```{r load-cached-fstats, echo = FALSE}
f_stats = readRDS("cache/f_statistics_simulation.rds")
```

```{r sim-anova-graphs}
hist(f_stats, breaks = 100, prob = TRUE, border = "dodgerblue", main = "Empirical Distribution of F")
curve(df(x, df1 = 4 - 1, df2 = 40 - 4), col = "darkorange", add = TRUE, lwd = 2)
```

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.