Movatterモバイル変換


[0]ホーム

URL:


qad

CRAN status


Summary

The R-package qad (short for quantification of asymmetric dependence)allows to estimate the (directed) dependence of two random variablesX andY. The estimated population valueq(X,Y) introduced in [1,3] fulfills thefollowing properties:

While the Pearson correlation coefficient assesses only linear andSpearman rank correlation only monotonic relationships, qad is able todetect any kind of association. For further information we refer to thevignette or the related publications [1,2,3].

Installation

The easiest way to get the package qad is:

install.packages("qad")

In order to install the development version of qad from GitHub:

# install devtools packageif (!requireNamespace("devtools",quietly =TRUE)) {install.packages("devtools")}# install packagedevtools::install_github("griefl/qad",dependencies =TRUE)

Usage

library(qad)set.seed(314)n<-100x<-rnorm(n)y<- x^2+rnorm(n,0,1)plot(x,y,pch =16)

fit<-qad(x,y)#>#> quantification of asymmetric dependence:#>#> Data: x1 := x#>       x2 := y#>#> Sample Size: 100#> Number of unique ranks: x1: 100#>                         x2: 100#>                    (x1,x2): 100#> Resolution: 10 x 10#>#> Dependence measures:#>                     q p.values#>  q(x1,x2)       0.610    0.000#>  q(x2,x1)       0.393    0.002#>  max.dependence 0.610    0.000#>#>                      a p.values#>  asymmetry       0.217       NAcoef(fit)#>         q(x1,x2)         q(x2,x1)   max.dependence        asymmetry#>            0.610            0.393            0.610            0.217#>       p.q(x1,x2)       p.q(x2,x1) p.max.dependence      p.asymmetry#>            0.000            0.002            0.000               NA#Comparison with correlationcor(x,y,method ="pearson")#> [1] -0.04404337cor(x,y,method ="spearman")#> [1] 0.06546655cor(x,y,method ="kendall")#> [1] 0.05090909

References


[8]ページ先頭

©2009-2025 Movatter.jp