I am not sure how LaTeX packages are loaded into StackExchanges like Stats, but I'm curious whether the multicolumn functionality can be added for arrays? I know some of the amsmath symbols are loaded since characters like $\nabla$ and $\mathbb{F}$ and $\mathcal{S}$ are loaded by default.
As an example, I was trying to implement this table as would appea
$$
\begin{array}{c|cccc}
& \multicolumn{2}{c}{W=0} & \multicolumn{2}{c}{W=1}& \\
& X & \bar{X} & X & \bar{X} \\ \hline
Y & a & b & r & s \\
\bar{Y} & c & d & u & v \\
\end{array}$$
So that it was clear we depicted an X-Y relation stratified by groups according to W=0 and W=1, like this:
\multicolumn
isn't supported by MathJax: docs.mathjax.org/en/latest/input/tex/macros/index.html. (MathJax is an external service which converts a subset of LaTeX into MathML, so S.E. can't add functionality without writing & hosting its own extensions.) $\endgroup$$$
's when you start & end the mathjax w/\begin{} ... \end{}
. $\endgroup$