# How to write y i = β 0 + β 1 x i + β 2 x 2 i + e i in Latex code? [duplicate]

I'm a beginner of using R and Latex. Just wonder how to write yi = β0 + β1xi + β2x2i + ei by using Latex?

\documentclass{article}
$y_i = \beta_0 + \beta_1 x_i + \beta_2 x_i^2 + e_i$

• Thank you so much, but the console board showed Error: unexpected '$' in "$" – Louis Jan 17 at 4:03