0

Hi I'm trying to prepare for my presentation, but I have a problem with my latex code.

I'm sure that I'm using "amsmath" package.

I tried to fix this, but still have a lot 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}

Is there something wrong?

2
  • 1
    The cases environment can not be used outpude of math mode.
    – leandriis
    Jul 13, 2020 at 12:27
  • \rar is an undefined code I guess ?
    – user209604
    Jul 13, 2020 at 13:11

2 Answers 2

3
    \usepackage{amsmath}
\begin{document}
\begin{frame}{Zip model}
\begin{itemize}
    \item Probability mass function of Y

    $$*Pr(Y = y\mid\lambda, p) = 
           \begin{cases} 
             p + (1 - p)e^{-\lambda}, & \text{if $y = 0$}\\
             (1 - p)\frac{e^{-\lambda}\lambda^{y}}{y!}, & \text{if $y > 0$}
           \end{cases} $$
    \item $$\begin{aligned}E(Y) =& (1 - p)\lambda \\
    *Var(Y) =& \lambda(1 - p)(1 + p\lambda)\end{aligned}$$
\end{itemize}
\end{frame}
\end{document}

You can replace $$...$$by $...$

enter image description here The second Text I think I found the problem

  \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}$\\

And :

$$\begin{cases}
       \lambda : \text{loglinear model}\   \log(\frac{p}{1-p}) = \textbf{$X_{1\alpha}$} = \alpha_0 + \alpha_{1X}_{11} + \alpha_{2X}_{12} + \dots + \alpha_{mX}_{1m} \\
        p : \text{logit model} \  \log(\lambda) = \textbf{$X_{2\beta}$} = \beta_0 + \beta_{1X}_{21} + \beta_{2X}_{22} + \dots + \beta_{lX}_{2l}
        \end{cases}$$

I didn't get the \item bcs I didn't use its package

1
  • 1
    Hi, add always a \documentclass into your orignal code :-)
    – Sebastiano
    Jul 27, 2020 at 12:00
2

enter image description here

\documentclass{beamer}

\usepackage{amsmath}
\begin{document}
\begin{frame}{ZIP model}
\begin{itemize}
    \item Probability mass function of Y
    \(*Pr(Y = y\mid\lambda, p) = 
           \begin{cases} 
             p + (1 - p)e^{-\lambda}, & \text{if y = 0}\\
             (1 - p)\frac{e^{-\lambda}\lambda^{y}}{y!}, & \text{if y} > 0
           \end{cases} \)
    \item \(\begin{aligned}E(Y) =& (1 - p)\lambda \\
    *Var(Y) =& \lambda(1 - p)(1 + p\lambda)\end{aligned}\)
\end{itemize}
\end{frame}

\end{document}
2
  • Thanks a lot! I'm sorry but I have one more problem :( Jul 13, 2020 at 12:57
  • I tried to change other codes like yours, and still I get a lot of errors... Jul 13, 2020 at 12:58

You must log in to answer this question.

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