How to use the CINV function in SAS?

The CINV function in SAS is used to calculate the inverse of a cumulative distribution function for a specific probability. The syntax of the function is CINV(probability, mean, standard_deviation) where probability is the probability for which the inverse cumulative distribution is desired, mean is the mean of the distribution, and standard_deviation is the standard deviation of the distribution. The function returns the inverse cumulative distribution for the given probability.


You can use the CINV function in SAS to find critical values from the Chi-Square distribution.

This function uses the following basic syntax:

CINV(p, df)

where:

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

The following example shows how to use the CINV function in practice to calculate Chi-Square critical values.

Example: How to Use CINV Function in SAS to Calculate Chi-Square Critical Values

Suppose we would like to find the Chi-Square critical value for a significance level of 0.05 and degrees of freedom = 11.

We can use the CINV function to calculate this value:

/*create dataset that contains Chi-Square critical value*/
data my_data;
    critical_val=cinv(.95, 11);
    put critical_val=;
run;

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

The Chi-Square critical value for a significance level of 0.05 and degrees of freedom = 11 is 19.67514.

Thus, if we’re conducting some type of Chi-Square test then we can compare the Chi-Square test statistic to 19.67514.

If the test statistic is greater than 19.67514, then the results of the test are statistically significant.

It’s worth noting that smaller values for the significance level will lead to larger Chi-Square critical values.

For example, consider the Chi-Square critical value for a significance level of 0.01, and degrees of freedom = 11:

/*create dataset that contains Chi-Square critical value*/
data my_data;
    critical_val=cinv(.99, 11);
    put critical_val=;
run;

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

The Chi-Square critical value for a significance level of 0.01 and degrees of freedom = 11 is 24.7250.

Note: You can also use the to find critical values by hand. The values that you find in the table will match the ones calculated by the CINV function in SAS.

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

x