I'm trying to write something like:
I'm not sure how to get the equations to stack with y hat on one side.
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityI'm trying to write something like:
I'm not sure how to get the equations to stack with y hat on one side.
I found a solution to this using cases
:
\documentclass{article} % or some other suitable document class
\usepackage{amsmath} % for 'cases' environment
\begin{document}
\[
\hat{y} = \begin{cases}
1 & \text{ if } \sigma (\beta_0 + \beta_1 x) > \frac{1}{2} \\
0 & \text{ if } \sigma (\beta_0 + \beta_1 x) \leq \frac{1}{2}
\end{cases}
\]
\end{document}
amsmath
package -- to make your code fragment minimally compilable. Feel free to revert.