circ.cor: Correlation Coefficient for Angular Variables

Description Usage Arguments Details Value References Examples

Description

Computes a circular version of the Pearson's product moment correlation, and performs a significance test if requested.

Usage

1
circ.cor(alpha, beta, test=FALSE)

Arguments

alpha

vector of circular data measured in radians.

beta

vector of circular data measured in radians.

test

if test = TRUE, then a significance test for the correlation coefficient is computed.

Details

The correlation coefficient is computed like Pearson's product moment correlation for two linear variables X and Y. In the computational formula, however, (xi - xbar) and (yi - ybar) are replaced by sin(xi - xbar) and sin(yi - ybar), where xbar and ybar in the second two expressions are the mean directions of the samples.

Value

Returns a data frame with variables r, a circular version of the Pearson's product moment correlation, test.stat and p.value, the test statistic and p-value respectively, for testing significance of the correlation coefficient. test.stat and p.value are by default not produced, but are given when test=TRUE is specified in the function call.

References

Jammalamadaka, S. Rao and SenGupta, A. (2001). Topics in Circular Statistics, Section 8.2, World Scientific Press, Singapore.

Jammalamadaka, S. and Sarma, Y. (1988). A correlation coefficient for angular variables. Statistical Theory and Data Analysis 2. North Holland: New York.

Examples

1
2
3
4
# Generate two circular data sets, and compute their correlation.
data1 <- rvm(50, 0, 3)
data2 <- data1 + pi + rvm(50, 0, 10)
circ.cor(data1, data2, test=TRUE)

Example output

Loading required package: MASS
Loading required package: boot
          r test.stat      p.value
1 0.8692404  4.435759 9.174835e-06

CircStats documentation built on May 2, 2019, 2:24 a.m.