File Exchange

image thumbnail

Critical t-value calculator

version 1.0.0.0 (9.6 KB) by Joris Meurs
Tool for quickly obtaining critical t-values

4 Downloads

Updated 07 Dec 2015

View License

File name : 'CritT.m'. This file can be used
for quickly obtaining the critical t-value for
alfa values of 0.01, 0.05, 0.10 and degrees of freedom
between 1 and 100
One input values : 'alfa','v','tail'
One output value : 't'

alfa: significance level (0.01,0.05,0.10)
v: degrees of freedom (integer from 1 till 100)
tail: one-tailed = 'one' two-tailed = 'two'
t: critical t-value

Input syntax : CritT(alfa,v,tail)
NOTE: Only the above-mentioned values for alfa and v
can be used as input arguments

Table with alfa values and corresponding t-values
were obtained by using the icdf functions

Developed by Joris Meurs BASc (2015)

Comments and Ratings (3)

Nice function! It includes tables of critical t-values and a lookup. I have refactored the code a bit, and will upload a derivative version.

Sorry, I mistyped in my other comment. You can use the formulas in that other comment if you replaced alpha with the confidence level (e.g., 0.95). If you want to use the alpha level (e.g., 0.05), you should use the following:

alpha = 0.05; n = 50;
tcrit2 = tinv(1-alpha/2,n-1);
tcrit1 = tinv(1-alpha,n-1);
tcrit2
= 2.0096
tcrit1 = 1.6766

You can also get the critical t value using the tinv() function.

For two tails:
tcrit = tinv(1-(1-alpha)/2,n-1);

For one tail:
tcrit = tinv(1-(1-alpha),n-1);

MATLAB Release Compatibility
Created with R10
Compatible with any release
Platform Compatibility
Windows macOS Linux
Acknowledgements

Inspired: Critical t-value calculator - 2017