Learn R Programming

funtimes (version 10.0)

r_crit: Critical Value for Correlation Coefficient

Description

Calculate critical value for correlation coefficient, for a given sample size and confidence level. If absolute value of an observed correlation coefficient is higher than the critical value, then the correlation is statistically significant with the specified confidence. This approach is identical to using textbook tables of critical values and alternative to calculating \(p\)-values.

Usage

r_crit(n, conf.level = 0.95, method = c("t"))

Value

A vector of critical values.

Arguments

n

sample size(s) used to calculate correlations. Values of \(n < 4\) are omitted.

conf.level

confidence level for calculating the critical value(s). Default is 0.95 (i.e., confidence of 95%). If length of the input is higher than 1, only the first element is used.

method

Method for calculating the critical values. Currently only the method based on \(t\)-distribution is used.

Author

Vyacheslav Lyubchich

Details

Using Student's \(t\)-distribution, the critical value is $$r_{crit} = \frac{t}{\sqrt{n - 2 + t^2}},$$ where \(t\) is a quantile of \(t\)-distribution with \(n - 2\) degrees of freedom for probability \(1 - (1 - conf.level)/2\).

References

See Also

Examples

Run this code
r_crit(120)
r_crit(20:30, conf.level = 0.9)

Run the code above in your browser using DataLab