To typeset properly, I believe the TeX code also requires a backslash in
front of the first instance of "beta" (the intercept). Otherwise the
word "beta" will be covered with a hat. These details are what many
users unfamiliar with TeX or LaTeX find challenging.
Quite so. If I had put the code into a LaTeX document, that would
have been clear, as would the solution. The 'rules' are quite simple
-- if you want Greek letters or mathematical symbols (sum, forall,
partial, exists, infty, int(egral), frac(tion)) you prefix them with
the \ character. If you want subscripts, you use _. If you want
superscripts, you use ^.
In most GUI front ends for LaTeX (TeXShop is excellent for Mac OS X;
WinEDT likewise for Windows), there is a palette from which you can
choose Greek letters, math symbols, and various structures (such as
auto-numbered lists). Automatic section and subsection numbering,
equation numbering, and cross-references within the text are also
very useful features for a document of any size.