I am trying to create a table that includes multiple rows in a single cell without using \shortstack
which seems to squash the words close together. In the sample I include below I opted to just create new rows with what I want to have on the second line. This works, but I don't like how single-lined rows are not centered.
How can this be fixed?
Maybe \multirow
? Maybe a p
column, which I do not know how to use?
\documentclass{article}
\usepackage[margin= .75in]{geometry}
\usepackage{amsmath}
\begin{document}
\begin{center}
\begin{tabular}{|c|c|c|c|c|}
\hline
distribution & pmf & $\mu$ & $\sigma^{2}$ & mgf \\
\hline
Uniform & $ f(x) = \frac{1}{m}, \quad x=0,1,\dots,m $ & $ \frac{m+1}{2} $ & $ \frac{m^{2} - 1}{12} $ & -- \\
$X \sim U(m)$ & & & & \\
\hline
Hypergeometric & $f(x) \frac{ \binom{N_{1}}{x} \binom{N_{2}}{n-x} }{ \binom{N}{n} }, \quad x= 0,1,\dots, n$ & $n\frac{N_{1}}{N}$ & $n \frac{N_{1}}{N} \frac{N_{2}}{N} \frac{N-n}{N-1}$ & -- \\
$N = N_{1} + N_{2}$ & & & & \\
\hline
Bernoulli & $f(x) = p^{x}q^{1-x}, \quad x = 0,1 $ & $p$ & $pq$ & $1 - p + pe^{t}$ \\
\hline
Binomial & $ f(x) = \binom{n}{x} p^{x}q^{n-x}, \quad x = 0,1,\dots, n $ & $np$ & $npq$ & $(1-p+pe^{t})^{n}$ \\
$X \sim b(n,p)$ & & & & \\
\hline
Poisson & $f(x) = \frac{\lambda^{x} e ^{-\lambda}}{x!}$ & $\lambda$ & $\lambda$ & $e^{\lambda e^{t}}$ \\
$X \sim Poisson(\lambda)$ & & & & \\
\hline
\end{tabular}
\end{center}
\end{document}
I did find this thread, but I did not see its application here (either that or I do not know how to apply it to this situation).