Skip to content

Commit

Permalink
add DL badge
Browse files Browse the repository at this point in the history
  • Loading branch information
tnagler committed Jan 17, 2023
1 parent a6452c3 commit 7c63ae5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
1 change: 1 addition & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ knitr::opts_chunk$set(
[![R-CMD-check](https://github.com/tnagler/wdm-r/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/tnagler/wdm-r/actions/workflows/R-CMD-check.yaml)
[![Coverage status](https://codecov.io/gh/tnagler/wdm-r/branch/master/graph/badge.svg)](https://codecov.io/github/tnagler/wdm-r?branch=master)
[![CRAN status](https://www.r-pkg.org/badges/version/wdm)](https://cran.r-project.org/package=wdm)
![CRAN downloads](http://cranlogs.r-pkg.org/badges/wdm)

R interface to the [wdm](https://github.com/tnagler/wdm) C++ library, which
provides efficient implementations of weighted dependence measures and related
Expand Down
41 changes: 21 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@
status](https://codecov.io/gh/tnagler/wdm-r/branch/master/graph/badge.svg)](https://codecov.io/github/tnagler/wdm-r?branch=master)
[![CRAN
status](https://www.r-pkg.org/badges/version/wdm)](https://cran.r-project.org/package=wdm)
![CRAN downloads](http://cranlogs.r-pkg.org/badges/wdm)

R interface to the [wdm](https://github.com/tnagler/wdm) C++ library,
which provides efficient implementations of weighted dependence measures
and related independence tests:

- Pearsons’s rho
- Spearmans’s rho
- Kendall’s tau
- Blomqvist’s beta
- Hoeffding’s D
- Pearsons’s rho
- Spearmans’s rho
- Kendall’s tau
- Blomqvist’s beta
- Hoeffding’s D

All measures are computed in *O(n* log *n)* time, where *n* is the
number of observations.
Expand All @@ -25,13 +26,13 @@ documentation](https://tnagler.github.io/wdm-r/).

### Installation

- the stable release from CRAN:
- the stable release from CRAN:

``` r
install.packages("wdm")
```

- the development version from [GitHub](https://github.com/) with:
- the development version from [GitHub](https://github.com/) with:

``` r
# install.packages("devtools")
Expand Down Expand Up @@ -65,9 +66,9 @@ x <- rnorm(100)
y <- rpois(100, 1) # all but Hoeffding's D can handle ties
w <- runif(100)
wdm(x, y, method = "kendall") # unweighted
#> [1] -0.01835054
#> [1] -0.1206219
wdm(x, y, method = "kendall", weights = w) # weighted
#> [1] -0.02273855
#> [1] -0.01751542
```

##### Dependence in a matrix
Expand All @@ -76,14 +77,14 @@ wdm(x, y, method = "kendall", weights = w) # weighted
x <- matrix(rnorm(100 * 3), 100, 3)
wdm(x, method = "spearman") # unweighted
#> [,1] [,2] [,3]
#> [1,] 1.00000000 0.02384638 0.04360036
#> [2,] 0.02384638 1.00000000 0.09418542
#> [3,] 0.04360036 0.09418542 1.00000000
#> [1,] 1.0000000 -0.1842904 -0.0060006
#> [2,] -0.1842904 1.0000000 0.1281728
#> [3,] -0.0060006 0.1281728 1.0000000
wdm(x, method = "spearman", weights = w) # weighted
#> [,1] [,2] [,3]
#> [1,] 1.00000000 0.09307647 0.08380492
#> [2,] 0.09307647 1.00000000 0.14823843
#> [3,] 0.08380492 0.14823843 1.00000000
#> [,1] [,2] [,3]
#> [1,] 1.00000000 -0.1435049 0.03738866
#> [2,] -0.14350490 1.0000000 0.23603074
#> [3,] 0.03738866 0.2360307 1.00000000
```

##### Independence test
Expand All @@ -93,9 +94,9 @@ x <- rnorm(100)
y <- rpois(100, 1) # all but Hoeffding's D can handle ties
w <- runif(100)
indep_test(x, y, method = "kendall") # unweighted
#> estimate statistic p_value n_eff method alternative
#> 1 -0.07862879 -0.9162974 0.3595109 100 kendall two-sided
#> estimate statistic p_value n_eff method alternative
#> 1 0.05391935 0.6092239 0.5423761 100 kendall two-sided
indep_test(x, y, method = "kendall", weights = w) # weighted
#> estimate statistic p_value n_eff method alternative
#> 1 -0.06030227 -0.6043739 0.5455951 76.3268 kendall two-sided
#> estimate statistic p_value n_eff method alternative
#> 1 0.01193407 0.115073 0.9083872 75.82538 kendall two-sided
```

0 comments on commit 7c63ae5

Please sign in to comment.