1

I'm trying to write something like:

equation picture

I'm not sure how to get the equations to stack with y hat on one side.

3
  • Welcome to TeX.SE. Please clarify your objective. Are you looking to typeset just the material in black, or are you also looking to typeset the underbrace and the label "prob."?
    – Mico
    May 6 at 2:01
  • @Mico thanks for the welcome! I was just trying to get the equation, not the bracket with prob underneath. I'm mainly wondering how to achieve the big bracket next to the equals sign. Sorry for any confusion!
    – Adi Tolia
    May 6 at 2:05
  • Why not read some documentation such as lshort first?@AdiTolia
    – Stephen
    May 6 at 2:33

1 Answer 1

2

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}
2
  • 1
    I've added instructions -- such as entering and exiting math mode, and loading the amsmath package -- to make your code fragment minimally compilable. Feel free to revert.
    – Mico
    May 6 at 4:44
  • @Celdor updated code to add the \\.
    – Adi Tolia
    May 7 at 0:13

Not the answer you're looking for? Browse other questions tagged .