Dear all,
when searching for ztest in R2015a I cannot find it. Does anyone know how can I add it? I did the same for ttest getting the same issue.
Regards,
Gilly

 Akzeptierte Antwort

Star Strider
Star Strider am 8 Mär. 2015

0 Stimmen

The core MATLAB functions erfc and erfcinv can emulate the normal probability distributions:
P = @(z) erfc(-z/sqrt(2))/2; % Equivalent to ‘normcdf’
CV = @(alpha) -sqrt(2) * erfcinv(2*alpha); % Equivalent to ‘norminv’
and the t-distribution is a one-line anonymous function:
tdist2T = @(t,v) (1-betainc(v/(v+t^2),v/2,0.5)); % 2-tailed t-distribution
tdist1T = @(t,v) 1-(1-tdist2T(t,v))/2; % 1-tailed t-distribution
where ‘t’ is the t-statistic and ‘v’ the degrees-of-freedom.

2 Kommentare

Guilherme Barbosa
Guilherme Barbosa am 9 Mär. 2015
Thanks a lot for your help! Much appreciate it!
Star Strider
Star Strider am 9 Mär. 2015
My pleasure!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Produkte

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by