5

Noob here. I'm trying to put together a multiline multivariate regression equation in Latex and am having some issues.

$ {Unit.Sales_t} = \alpha + \beta_{1} Date_{t} + \beta_{2}  Cable.TV_{t} + \beta_{3}  Int.Display_{t} + \beta_{4}  Local.Radio_{t} + \beta_{5}  Magazines_{t} + \beta_{6}  Network.TV_{t} + \beta_{7}  Spot.TV_{t} + \epsilon$

I'm trying to match the regression parameters so that it's not one long set of new lines. It should be something along the following lines.

Unit.Sales = A + B1 Date +
                 B2 Cable.TV +
                 B3 Int.Display +
....

Or some variation of the above type so that each predictor is on a separate line.

1
  • Welcome to TeX.SE. You can either use aligned if you want to start in the paragraph, but better to make it display mode and use align*. Commented Dec 18, 2014 at 18:58

2 Answers 2

5

If you want the equations to be in display mode (i.e, set on their own line you can achieve your desired results with the align* environment:

enter image description here

Notes:

  • The mathtools package loads the amsmath and provides some fixes.

Code:

\documentclass{article}
\usepackage{mathtools}

\begin{document}
\begin{align*}
\mathrm{Unit.Sales}_{t} = \alpha 
    &+ \beta_{1}  \mathrm{Date}_{t} \\
    &+ \beta_{2}  \mathrm{Cable.TV}_{t}    \\
    &+ \beta_{3}  \mathrm{Int.Display}_{t} \\
    &+ \beta_{4}  \mathrm{Local.Radio}_{t} \\
    &+ \beta_{5}  \mathrm{Magazines}_{t}   \\
    &+ \beta_{6}  \mathrm{Network.TV}_{t}  \\
    &+ \beta_{7}  \mathrm{Spot.TV}_{t} + \epsilon
\end{align*}
\end{document}
2
  • The \epsilon term should have a subscript t as well, right?
    – Mico
    Commented Dec 18, 2014 at 19:57
  • @Mico: Don't know so will defer that to the OP (it isn't in the MWE provided in the question). Commented Dec 18, 2014 at 21:40
1

Or the aligned one:

 \documentclass{article}
    \usepackage{mathtools}

    \begin{document}
\[
    \begin{aligned}
    \mathrm{Unit.Sales}_{t} = \alpha 
        &+ \beta_{1}  \mathrm{Date}_{t} \\
        &+ \beta_{2}  \mathrm{Cable.TV}_{t}    \\
        &+ \beta_{3}  \mathrm{Int.Display}_{t} \\
        &+ \beta_{4}  \mathrm{Local.Radio}_{t} \\
        &+ \beta_{5}  \mathrm{Magazines}_{t}   \\
        &+ \beta_{6}  \mathrm{Network.TV}_{t}  \\
        &+ \beta_{7}  \mathrm{Spot.TV}_{t} + \epsilon
    \end{aligned}
\]
    \end{document}

Sometimes it works better.

2
  • It should be \mathrm{Unit.Sales}_{t}. This is not the same as Peter's, because one can give a global equation number. Also split could be used, perhaps even better.
    – egreg
    Commented Dec 18, 2014 at 23:21
  • You're right, I'll edit.
    – Davide
    Commented Dec 19, 2014 at 1:13

You must log in to answer this question.

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