Skip to content

Instantly share code, notes, and snippets.

@fbchow
Created September 9, 2017 00:28
Show Gist options
  • Save fbchow/82fefbd8cede5e34790906dde10651ae to your computer and use it in GitHub Desktop.
Save fbchow/82fefbd8cede5e34790906dde10651ae to your computer and use it in GitHub Desktop.
Collecting the bits & bytes from https://rstudio-pubs-static.s3.amazonaws.com/18858_0c289c260a574ea08c0f10b944abc883.html
stats notation:
“We fit a linear model with terms for age, sex” versus \( Y_i = \alpha + \beta_a A_i + \beta_s S_i + \epsilon_i \)
concise:
“We estimated the intercept to be 3.3” versus \( \hat{\alpha}=3.3 \).
#How to write math on a separate line
Sometimes you have several equations you would like to line up.
The way that you do that is
with a double dollar sign \\[ and the align command.
For example if you write Then you get the following text after running _knit2html_ or _slidify_ on your document. \] \begin{aligned} y &= \beta_0 + \beta_1 + x_1 + \epsilon\ x &= \gamma z \ z &\sim N(0,1) \end{aligned} $$
Common symbols
Subscripts to get \( a_{b} \) write: $a_{b}$
Superscripts write \( a^{b} \) write: $a^{b}$
Greek letters like \( \alpha, \beta, \ldots \) write: $\alpha, \beta, \ldots$
Sums like \( \sum_{n=1}^N \) write: $\sum_{n=1}^N$
Multiplication like \( \times \) write: $\times$
Products like \( \prod_{n=1}^N \) write: $\prod_{n=1}^N$
Inequalities like \( <, \leq, \geq \) write: $<, \leq, \geq$
Distributed like \( \sim \) write: $\sim$
Hats like \( \widehat{\alpha} \) write: $\widehat{\alpha}$
Averages like \( \bar{x} \) write: $\bar{x}$
Fractions like \( \frac{a}{b} \) write: $\frac{a}{b}$
Big parentheses like \( \left(\frac{a}{b}\right) \) write: $\left(\frac{a}{b}\right)$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment