I am having some troubles regarding how to successfully change variables for a specific probability density function that I am reading about in a paper. In the paper, they consider this density:
$$f(\bar{x},y,\tilde{S})=\sqrt{\frac{n}{n-1}}\frac{\Gamma\left(\frac{n-1}{2}\right)}{\sqrt{\pi}\Gamma\left(\frac{n-2}{2}\right)}\frac{1}{\tilde{S}}\left[1-\left(\frac{\bar{x}-y}{\tilde{S}}\right)^2\frac{n}{n-1}\right]^{(n-4)/2},$$
where $\bar{x}\sim N(\mu,\sigma^2/n)$ is the sample mean, $y\sim N(\mu,\sigma^2)$, and $\tilde{S}^2/\sigma^2\sim\chi^2(n-1)$. More specifically, $\tilde{S}$ is the scaled sample standard deviation
$$\tilde{S}=\sqrt{\sum_{i=1}^{n}(x_i-\bar{x})^2}.$$
The authors in the paper then propose the transformation
$$z=\frac{1}{2}+\frac{1}{2}\frac{\bar{x}-y}{\tilde{S}}\sqrt{\frac{n}{n-1}}$$
which then yields a beta distribution in terms of the variable $z$
$$\frac{\Gamma(n-2)}{\Gamma\left(\frac{n-2}{2}\right)\Gamma\left(\frac{n-2}{2}\right)}z^{(n-2)/2-1}(1-z)^{(n-2)/2-1}.$$
I have tried using this transformation, but I have not been completely successful (I can show you my results if needed). I am not far from it, and I think I know what I am missing. I have not incorporated the Jacobian while changing variables. However, I am not entirely sure what my Jacobian would be. If anyone can help me with this (hints) or refer me to some material I can read about this I would highly appreciate that!
Thanks in advance.