% Return P(|t(df)| >= |t|) (two-sided Student-t P-value)
function pval = pvtdist(tt,df)
%  pval = 1 - fdist(tt.*tt,1,df)
  pval = 1 - betainc((tt.*tt)./(df+tt.*tt), 1/2, df/2);

