-1

I have trouble with my code :(

I heard that {cases} environment cannot be used in math mode,

so I changed $$ to \(\), but still getting various kind of errors.

\begin{frame}{ZIP regression models with covariates}
        \begin{itemize}
            \item Regression-type models can adjust for covariate effects and assess relationships between key predictors and the response
            \item Covariates enter ZIP regression model at both the Bernoulli zero-inflation and Poison count stages\\
            $\rar$ 2 sets of parameters corresponding to p and $\lambda$\\
            \(\begin{cases}
                \(\lambda\) : loglinear model \(\rar log(\frac{p}{1-p}) = \textbf{X_1\alpha} = \alpha_0 + \alpha_1X_{11} + \alpha_2X_{12} + \dots + \alpha_mX_{1m}\)\\
                p : logit model \(\rar log(\lambda) = \textbf{X_2\beta} = \beta_0 + \beta_1X_{21} + \beta_2X_{22} + \dots + \beta_lX_{2l}\)
                \end{cases}\)
           \vspace{0.2cm}
            \item \(\boldsymbol{X_1} = (1, X_{11}, X_{12}, \dots, X_{1m})\) : covariate vector included in the zero stage\\
           \(\boldsymbol{X_2} = (1, X_{21}, X_{22}, \dots, X_{2l})\) : covariate vector included in the Poisson stage
            \item \(\boldsymbol{\alpha} = (\alpha_0, \alpha_1, \dots, \alpha_m)^{T}, \boldsymbol{\beta} = (\beta_0, \beta_1, \dots, \beta_l)^{T}\)\\
          $\rar$ corresponding coefficient vectors
        \end{itemize}
    \end{frame}

I have no idea what is wrong... help me please!

1 Answers1

0

First of all, both $...$ and \(...\) is inline math.

With respect to your cases environment, the following works for me (as mentioned in the comments, the cases environment preserves math mode):

\documentclass{beamer}
\usepackage{amsmath}

\begin{document} \begin{frame}{hallo} \begin{itemize} \item Regression-type models can adjust for covariate effects and assess relationships between key predictors and the response \item Covariates enter ZIP regression model at both the Bernoulli zero-inflation and Poison count stages\ 2 sets of parameters corresponding to p and $\lambda$\ ( \begin{cases} \lambda\text{:} & \text{loglinear model ...} \ p\text{:} & \text{logit model ...} \end{cases} ) \end{itemize} \end{frame} \end{document}


However, after changing this, your code still didn't compile. I then replaced the `\textbf{X_1 \alpha}` with `\bm{X_1 \alpha}` (and included the bm package) which fixed it. Your complete, compiling, example then becomes:
\documentclass{beamer}
\usepackage{amsmath}
\usepackage{bm}

\newcommand{\rar}{\alpha}

\begin{document} \begin{frame}{hallo} \begin{itemize} \item Regression-type models can adjust for covariate effects and assess relationships between key predictors and the response \item Covariates enter ZIP regression model at both the Bernoulli zero-inflation and Poison count stages\ $\rar$ 2 sets of parameters corresponding to p and $\lambda$\ ( \begin{cases} \lambda\text{:} & \text{loglinear model } \rar \log(\frac{p}{1-p}) = \bm{X_1\alpha} = \alpha_0 + \alpha_1X_{11} + \alpha_2X_{12} + \dots + \alpha_mX_{1m} \ p\text{:} & \text{logit model } \rar \log(\lambda) = \bm{X_2\beta} = \beta_0 + \beta_1X_{21} + \beta_2X_{22} + \dots + \beta_lX_{2l} \end{cases} ) \item (\boldsymbol{X_1} = (1, X_{11}, X_{12}, \dots, X_{1m})) : covariate vector included in the zero stage\ (\boldsymbol{X_2} = (1, X_{21}, X_{22}, \dots, X_{2l})) : covariate vector included in the Poisson stage \item (\boldsymbol{\alpha} = (\alpha_0, \alpha_1, \dots, \alpha_m)^{T}, \boldsymbol{\beta} = (\beta_0, \beta_1, \dots, \beta_l)^{T})\ $\rar$ corresponding coefficient vectors \end{itemize} \end{frame} \end{document}

But please note that the math in your cases environment doesn't fit on the slides.

Abby
  • 621