Stack equations in brackets

alignamsmath

How would I recreate this format with equation/align/pmatrix?
Image of what i'm trying to recreate

\begin{equation}
    \begin{align}
    P(t&=11 \\ t&=13 |sex&=1  \\ education &=1 )
    \end{align} = \begin{pmatrix}
        q_{11t} & q_{12t} & 0 & 0 & q_{15t} \\
        q_{21t} & q_{22t} & q_{23t} & 0 & q_{25t} \\
        0 & q_{32t} & q_{33t} & q_{34t} & q_{35t} \\
        0 & 0 & q_{43t} & q_{44t} & q_{45t} \\
        0 & 0 & 0 & 0 & 0
    \end{pmatrix}
    \label{fig:transition-intensity-matrix} 
\end{equation}

The content is not important, I'm just trying to get the layout! I have got this far, but I am also recieving the error:
"Package amsmath Error: Erroneous nesting of equation structures;(amsmath) trying to recover with `aligned'. \end{align}"

what I've got

Any advice? Thank you!

Best Answer

First version: I have used spalign package to have the vertical rule in the matrix. There are so many ways to create your image. I've inserted the fonts from the image that look like Times New Roman to me.

\documentclass[a4paper,12pt]{article}
\usepackage{newtxtext,newtxmath}
\usepackage{spalign}
\begin{document}
\[
\mathbf{\hat{P}}
\spalignaugmatn[l]{1}{{t_1=11,} {\mathit{sex}=1,};{t_2=13} {\mathit{education}=1}} 
= \begin{pmatrix}
        q_{11t} & q_{12t} & 0 & 0 & q_{15t} \\
        q_{21t} & q_{22t} & q_{23t} & 0 & q_{25t} \\
        0 & q_{32t} & q_{33t} & q_{34t} & q_{35t} \\
        0 & 0 & q_{43t} & q_{44t} & q_{45t} \\
        0 & 0 & 0 & 0 & 0
    \end{pmatrix}
    \label{fig:transition-intensity-matrix} 
    \]
\end{document}

enter image description here

Second version: Peraphs this MWE it is more closer to the original image.

\documentclass[a4paper,12pt]{article}
\usepackage{mathtools,amssymb}
\begin{document}
\[\mathbf{\hat{P}}\biggl(\,\begin{aligned}
  & t_1=11, \\
  & t_2=13
\end{aligned}\, \Big\lvert \mkern5mu \begin{aligned}
  & \mathit{sex}=1,\\
  & \mathit{education}=1
\end{aligned}\,\biggr)=\begin{pmatrix}
        q_{11t} & q_{12t} & 0 & 0 & q_{15t} \\
        q_{21t} & q_{22t} & q_{23t} & 0 & q_{25t} \\
        0 & q_{32t} & q_{33t} & q_{34t} & q_{35t} \\
        0 & 0 & q_{43t} & q_{44t} & q_{45t} \\
        0 & 0 & 0 & 0 & 0
    \end{pmatrix}
    \label{fig:transition-intensity-matrix} \]
\end{document}

enter image description here