0

My regression equation is not done yet, but the look of it is a but odd. Can someone help me with the spacing?

\documentclass[twocolumn]{article}


\usepackage{booktabs, makecell, tabularx}
\renewcommand\theadfont{\normalsize}
\renewcommand\theadgape{}
\setcellgapes{2pt}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}
\usepackage{caption}
\usepackage{textcomp}
\usepackage{graphicx}
\raggedbottom
\usepackage{amsmath,geometry}
\usepackage{rotating}
\usepackage{booktabs, makecell}
\usepackage[referable]{threeparttablex}
\usepackage{siunitx}
\usepackage[skip=1ex]{caption}
\usepackage{upquote}
\usepackage{balance}
\usepackage[lite]{mtpro2} % Times Roman math font

\begin{document}

OLS Regression is used to estimate the following equations:

${\textrm{CEO Salary}}={\beta}_0 +{\beta}_1 return$ +${\beta}_2 bonus$+${\beta}_2 stock awards$+${\beta}_2 option awards$+
\par${\beta}_2 other compensation$

\end{document}

enter image description here

@DavidCarlisle this is resulting in errors: what am I doing wrong?

{\textrm{CEO Salary}}={\beta}_0 +{\beta}_1 \mathrm{return} +{\beta}_2 \mathrm{bonus}+{\beta}_3 \mathrm{stock awards}+{\beta}_4 \mathrm{option awards}+
\par${\beta}_5 \mathrm{other compensation}+{\beta}_6 \mathrm{age}+{\beta}_7 \mathrm{age sq}+{\beta}_8 \mathrm{male}+{\beta}_9 \mathrm{industry}+{\beta}_10 Volume$
texmex
  • 349
  • never use math italic for multi letter words it is designed to make adjacent letters look like a product of variables. use \mathrm{return} etc and don't do $ +$ which is forcing the + not to be part of the math expression, – David Carlisle May 02 '18 at 15:57
  • How do I go past single digits for the betas? So like "Beta 10" is coming out as "Beta (sub 1) 0 – texmex May 02 '18 at 16:19
  • the syntax for a subscript is _{1234567} if you know what you are doing you can sometimes omit the braces without it going wrong but it is a bad idea to do that, even when it works. – David Carlisle May 02 '18 at 16:25
  • @texmex this should be a different question but it's a simple one so I answer here and in a more general way. When you want to group more than one character/variable/digit you should encapsulate them in brackets (i.e. between { and }). – gvgramazio May 02 '18 at 16:27
  • @texmex Since it seems to me that you are new to LaTeX, please take a look at how to write math in LaTeX on Wikipedia. – gvgramazio May 02 '18 at 16:30

1 Answers1

1

Are you looking for something like this?

\documentclass[twocolumn]{article}


\usepackage{booktabs, makecell, tabularx}
\renewcommand\theadfont{\normalsize}
\renewcommand\theadgape{}
\setcellgapes{2pt}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}
\usepackage{caption}
\usepackage{textcomp}
\usepackage{graphicx}
\raggedbottom
\usepackage{amsmath,geometry}
\usepackage{rotating}
\usepackage{booktabs, makecell}
\usepackage[referable]{threeparttablex}
\usepackage{siunitx}
\usepackage[skip=1ex]{caption}
\usepackage{upquote}
\usepackage{balance}
\usepackage[lite]{mtpro2} % Times Roman math font

\begin{document}

OLS Regression is used to estimate the following equations:
$\text{CEO Salary} = 
  \beta_0 + 
  \beta_1\,\text{return} + 
  \beta_2\,\text{bonus} + 
  \beta_2\,\text{stock awards} + 
  \beta_2\,\text{option awards} +
  \beta_2\,\text{other compensation} $
\end{document}

example_image

Some explanation: In you example you typed multiple inline math, in my example there is only one. If you want to type some text just use \text. I used \, for two reasons:

  • in my opinion is good to have a space (but not too much of it) between the variable and the word(s)
  • \, is non-breakable, i.e. a new line cannot separate a variable from the word next to it.

Further infos: As David Carlisle pointed out in a comment, you can also use \mathrm. However \mathrm and \text are semantically different even if they can - but not in any case - have the same result. You should use \mathrm when you have math variables that you don't want to display in mathmode (i.e. italic) and you should use \text when you have... text. For further differences please look at this question.

gvgramazio
  • 2,660