Chapter 3 Mathematical Notation

This is a guide for how to make math symbols in RMarkdown.

3.1 Making Greek Letters

To make a Greek letter in Markdown, you need to move into the white space in your document (where you type normal text). You can create Greek letters by putting this in the white space:

  • Example: $\beta$, $\gamma$, $\epsilon$

You will notice that this is the name of the letter you want with a \ before it. You need a $ at the beginning and the end.

If you want a subscript, like \(\beta_1\), you use $\beta_1$.

If you want a subscript that is multiple letters (like \(R^2_{adj}\)), you use $R^2_{adj}$. In other words, you wrap { } around whatever you want in the subscript.

3.2 Make an Equation

You put a $ at the beginning of the equation and $ at the end.

  • Example: $Y = \beta_0 + \beta_1X + \epsilon$.

If you want the equation on its own line, use two $ at the beginning and end.

  • Example: $$Y = \beta_0 + \beta_1X + \epsilon$$.

3.3 Make a Fraction

You use the command \frac{ }{ }.

Whatever you put in the first { } is in the numerator, and in the second { } is in the denominator,

  • Example: Typing $\frac{1}{2}$ makes one-half
  • Example: Typing $log \left( \frac{ \pi_i }{ 1- \pi_i} \right)$ makes \(log \left( \frac{ \pi_i }{ 1- \pi_i} \right)\)

3.4 Writing a Distribution

To make the ~ symbol in a distribution, use \sim.

  • Example: Typing $Y_i \sim N( \mu, \sigma)$ makes \(Y_i \sim N( \mu, \sigma)\).