FRpredcor: Compute the FR coefficient on two vectors based exactly on...

View source: R/FRpredcor.R

FRpredcorR Documentation

Compute the FR coefficient on two vectors based exactly on Gamma2.

Description

This function computes the unidimensional graph prediction coefficient between two vectors xvec and yvec.

Usage

FRpredcor(xvec, yvec, tiemethod = "average")

Arguments

xvec

Vector of numeric values in the first coordinate.

yvec

Vector of numeric values in the second coordinate.

tiemethod

Choice of treatment for ties, default is the "average"

Value

In the case simple = TRUE, function returns the value of the FR standardized coefficient.

Note

Auxiliary function with no checks for NA, etc.

Author(s)

Sourav Chatterjee, Susan Holmes

References

Chatterjee, S. and Holmes, S (2020) Practical observations and applications of the robust prediction coefficient.

See Also

xicor FRpredcorhalf

Examples

# Compute  the coefficient and compare to the xi coefficient
simulCompare <- function(n = 20, B = 1000)
{
 diffs<- rep(0,B)
 xvec <- 1:n
 for (i in 1:B)
 {
   yvec <- runif(n)
   diffs[i] <- FRpredcor(xvec, yvec) - xicor(xvec, yvec)
 }
 return(diffs)
 }

 simulcompare1K <- simulCompare()
 summary(simulcompare1K)



XICOR documentation built on April 21, 2023, 5:06 p.m.