How to Use the TINV Function in SAS (With Examples)

The TINV function in SAS is a statistical function that returns the inverse of the Student’s t-distribution for a given probability and degrees of freedom. It is useful for performing statistical calculations such as confidence interval estimation, hypothesis testing, and other applications. The syntax for the TINV function is TINV (probability, df), where probability is the probability associated with the t-distribution and df is the degrees of freedom. Examples of how to use the TINV function in SAS are included in the article.


You can use the TINV function in SAS to find critical values from the t distribution.

This function uses the following basic syntax:

TINV(p, df)

where:

  • p: 1 – the significance level
  • df: The degrees of freedom

The following example shows how to use the TINV function to find the t critical value for a left-tailed test, right-tailed test, and a two-tailed test.

Example 1: Using TINV Function for Left-Tailed Test

Suppose we want to find the t critical value for a left-tailed test with a significance level of .05 and degrees of freedom = 22:

We can use the TINV function to calculate this value:

/*create dataset that contains t critical value*/
data my_data;
    critical_val=tinv(.05, 22);
    put critical_val=;
run;

/*view results*/
proc print data=my_data; 

The t critical value for a significance level of 0.05 and degrees of freedom = 22 is -1.71714.

Thus, if the test statistic is less than this value then the results of the test are statistically significant.

Example 2: Using TINV Function for Right-Tailed Test

Suppose we want to find the t critical value for a right-tailed test with a significance level of .05 and degrees of freedom = 22:

We can use the TINV function to calculate this value:

/*create dataset that contains t critical value*/
data my_data;
    critical_val=tinv(.95, 22);
    put critical_val=;
run;

/*view results*/
proc print data=my_data; 

The t critical value for a significance level of 0.05 and degrees of freedom = 22 is 1.71714.

Thus, if the test statistic is greater than this value then the results of the test are statistically significant.

Example 3: Using TINV Function for Two-Tailed Test

Suppose we want to find the t critical value for a two-tailed test with a significance level of .05 and degrees of freedom = 22:

We can use the TINV function to calculate this value:

/*create dataset that contains t critical value*/
data my_data;
    critical_val=tinv(.05/2, 22);
    put critical_val=;
run;

/*view results*/
proc print data=my_data; 

Whenever you perform a two-tailed test, there will be two critical values. In this case, the t critical values are -2.07387 and 2.07387.

Thus, if the test statistic is less than -2.0739 or greater than 2.0739 then the results of the test are statistically significant.

The following tutorials explain how to perform other common tasks in SAS:

x