Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I want to write this equation in this way down but I have been unsuccessful. How can I improve this codes in order to get the equation below?

\[ DeltaC{t} = \left\{ \begin{array}{ll} 
-1.40- 0.588w_{t-1} - 0.5351\DeltaC_{t-1}+ 0.169\DeltaBC_{t-1} & \mbox{ if $w_{t-1}<- 0.62$} \\
-1.40 - 0.588w_{t-1} - 0.5351\DeltaC_{t-1} + 0.169\DeltaBC_{t-1} & \mbox{$w_{t-1}>0.62$}
\end{array}
\right. \]

enter image description here

share|improve this question
    
What exactly is this for? (Also, you only have one column for the array; remove an l.) –  Sean Allred Jan 13 at 0:56
    
It is a regression. My goal is to write the equation in the same form that the second one below without number in parenthesis. I want to write the equation without those in parentesis. Please just consider the first one and tell me how it is working!. –  ntamjo achille Jan 13 at 1:09
2  
Unfortunately, you haven't provided a definition for \DeltaC or \DeltaBC in your post; please expand it into a minimal working example (MWE) so someone can tell you what's actually going wrong. –  Sean Allred Jan 13 at 1:11
add comment

2 Answers

I think you want cases from amsmath. Also, instead of \mbox, it is better to use \text.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[ 
  DeltaC{t} = \begin{cases}
    -1.40- 0.588w_{t-1} - 0.5351\Delta_{t-1}+ 0.169\Delta_{t-1} & \text{if $w_{t-1}<- 0.62$} \\
    -1.40 - 0.588w_{t-1} - 0.5351\Delta_{t-1} + 0.169\Delta_{t-1} & \text{$w_{t-1}>0.62$}
  \end{cases}
\]
\end{document}

Since your equation is too long, I have split it in to two lines and added some space adjustments and fine tuning by Enrico. (Thanks to egreg).

\documentclass{article}
\usepackage{amsmath}

\newcommand{\DeltaC}[1]{%
  \Delta\pi^{\textnormal{Services}}_{#1}%
}
\newcommand{\DeltaBC}[1]{%
  \Delta\pi^{\textnormal{Goods}}_{#1}%
}


\begin{document}

\[
\DeltaC{t} = \begin{cases}
  -0.03_{(0.08)} - 0.08_{(0.05)} + 0.09_{(0.18)} \DeltaC{t-1} \\
    \qquad{} + 0.12_{(0.03)}\DeltaBC{t-1} + u_{2t}, & \text{if $w_{t-1}<-0.62$,} \\[2ex]
  0.38_{(0.15)} - 0.12_{(0.04)} + 0.40_{(0.07)} \DeltaC{t-1} \\
    \qquad{} + 0.18_{(0.06)}\DeltaBC{t-1} + u_{2t}, & \text{if $ w_{t-1} > 2.2$,}
  \end{cases}
\]
\end{document}

enter image description here

share|improve this answer
    
your response was very helpful,particularly the first option(with cases), to write this equation. Thanks –  ntamjo achille Jan 16 at 14:26
    
@ntamjoachille Glad that was useful. You can also accept answers and upvote them if they are useful :) –  Harish Kumar Jan 16 at 14:58
    
where can i upvote? –  ntamjo achille Jan 16 at 15:01
add comment

Your equation actually only has one column (but it has two rows). But in this case, it would be better to use the cases environment from amsmath.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
\Delta\pi_t^\text{Services} =
\begin{cases}
  -0.03_{0.08} - 0.08_{0.05} + 0.09_{0.18} \Delta\pi_{t-1}^\text{Services} + 0.12_{0.03} \Delta\pi_{t-1}^\text{Goods} + u_{2t} & w_{t-1} \leq 2.2 \\
   0.38_{0.15} - 0.12_{0.04} + 0.40_{0.07} \Delta\pi_{t-1}^\text{Services} + 0.18_{0.06} \Delta\pi_{t-1}^\text{Goods} + u_{2t} & w_{t-1} > 2.2
\end{cases}
\]
\end{document}
share|improve this answer
    
@Harish [ DeltaCanada_{t} = \begin{cases} -1.40(0.02) - 0.58(1.5e-8)w_{t-1} - 0.53(0.14)\DeltaCanada_{t-1}+ 0.169(0.03)\DeltaBritishColumbia_{t-1} & \text{ if $w_{t-1} \leq 0.62$} \\ -0.73(0.76) - 0.15(0.17)w_{t-1} - 0.99(2.5e-7)\DeltaCanada_{t-1} + 0.24(0.13) \DeltaBritishColumbia_{t-1} & \text{$w_{t-1}>0.62$} \end{cases} \ ] –  ntamjo achille Jan 13 at 16:41
    
@ntamjoachille What? –  Sean Allred Jan 13 at 17:10
    
I have tried to write it in a clearer way. You can see it in this link:tex.stackexchange.com/questions/153871/… –  ntamjo achille Jan 13 at 17:13
    
@ntamjoachille It is certainly not clear to anyone who doesn't know the topic of your work. Please do not post duplicate questions like this; if the answers here don't actually answer your original question, say so here — not in a new post. –  Sean Allred Jan 13 at 18:53
    
i have combined all your suggestions on my latex codes and now it is working. –  ntamjo achille Jan 15 at 0:05
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.