Skip to content

Commit

Permalink
Merge pull request #20 from permaverse/remove-lmjl-alea
Browse files Browse the repository at this point in the history
Remove all occurences to LMJL-Alea GitHub organization in favour of n…
  • Loading branch information
astamm authored Jan 6, 2025
2 parents 07ec8dc + 989985e commit e508e8d
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 50 deletions.
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ R-release due to pandoc version not available preventing the `pvalue-function` v
test is performed.
* Add a function to compute p-value functions for sets of null hypotheses.
* Draft of article illustrating the computation of p-value functions with
[**flipr**](https://lmjl-alea.github.io/flipr/).
[**flipr**](https://permaverse.github.io/flipr/).
* Add $t$, mean and Fisher test statistics.
* Correct two-tail p-value computation.
* Better API for pvalue function.
Expand Down
39 changes: 21 additions & 18 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,49 +13,52 @@ knitr::opts_chunk$set(
)
```

# Overview <a href='https://lmjl-alea.github.io/flipr/'><img src='man/figures/logo.png' align="right" height="139" /></a>
# Overview <a href='https://permaverse.github.io/flipr/'><img src='man/figures/logo.png' align="right" height="139" /></a>

<!-- badges: start -->
[![R-CMD-check](https://github.com/LMJL-Alea/flipr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/LMJL-Alea/flipr/actions/workflows/R-CMD-check.yaml)
[![test-coverage](https://github.com/LMJL-Alea/flipr/workflows/test-coverage/badge.svg)](https://github.com/LMJL-Alea/flipr/actions)
[![Codecov test coverage](https://codecov.io/gh/LMJL-Alea/flipr/branch/master/graph/badge.svg)](https://codecov.io/gh/LMJL-Alea/flipr?branch=master)
[![pkgdown](https://github.com/LMJL-Alea/flipr/workflows/pkgdown/badge.svg)](https://github.com/LMJL-Alea/flipr/actions)
[![R-CMD-check](https://github.com/permaverse/flipr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/permaverse/flipr/actions/workflows/R-CMD-check.yaml)
[![test-coverage](https://github.com/permaverse/flipr/workflows/test-coverage/badge.svg)](https://github.com/permaverse/flipr/actions)
[![Codecov test coverage](https://codecov.io/gh/permaverse/flipr/branch/master/graph/badge.svg)](https://codecov.io/gh/permaverse/flipr?branch=master)
[![pkgdown](https://github.com/permaverse/flipr/workflows/pkgdown/badge.svg)](https://github.com/permaverse/flipr/actions)
[![CRAN status](https://www.r-pkg.org/badges/version/flipr)](https://CRAN.R-project.org/package=flipr)
<!-- badges: end -->

The goal of the [**flipr**](https://lmjl-alea.github.io/flipr/) package is to
The goal of the [**flipr**](https://permaverse.github.io/flipr/) package is to
provide a flexible framework for making inference via permutation. The idea is
to promote the permutation framework as an incredibly well-suited tool for
inference on complex data. You supply your data, as complex as it might be, in
the form of lists in which each entry stores one data point in a representation
that suits you and [**flipr**](https://lmjl-alea.github.io/flipr/) takes care of
that suits you and [**flipr**](https://permaverse.github.io/flipr/) takes care of
the permutation magic and provides you with either point estimates or confidence
regions or $p$-value of hypothesis tests. Permutation tests are especially
appealing because they are exact no matter how small or big your sample sizes
are. You can also use the so-called *non-parametric combination* approach in
this setting to combine several statistics to better target the alternative
hypothesis you are testing against. Asymptotic consistency is also guaranteed
under mild conditions on the statistic you use. The
[**flipr**](https://lmjl-alea.github.io/flipr/) package provides a flexible
[**flipr**](https://permaverse.github.io/flipr/) package provides a flexible
permutation framework for making inference such as point estimation, confidence
intervals or hypothesis testing, on any kind of data, be it univariate,
multivariate, or more complex such as network-valued data, topological data,
functional data or density-valued data.

## Installation

You can install the latest stable version of
[**flipr**](https://lmjl-alea.github.io/flipr/) on CRAN with:
You can install the package from [CRAN](https://CRAN.R-project.org) with:

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

Or you can install the development version from [GitHub](https://github.com/) with:
Alternatively, You can install the development version of
[**flipr**](https://permaverse.github.io/flipr/) from
[GitHub](https://github.com/) with:

``` r
# install.packages("remotes")
remotes::install_github("LMJL-Alea/flipr")
# install.packages("pak")
pak::pak("permaverse/flipr")
```

## Example

```{r}
Expand All @@ -64,7 +67,7 @@ library(flipr)

We hereby use the very simple t-test for comparing the means of two univariate
samples to show how easy it is to carry out a permutation test with
[**flipr**](https://lmjl-alea.github.io/flipr/).
[**flipr**](https://permaverse.github.io/flipr/).

### Data generation

Expand Down Expand Up @@ -98,12 +101,12 @@ null_spec <- function(y, parameters) {

Next, we need to decide which test statistic(s) we are going to use for performing the test. Here, we are only interested in one parameter, namely the mean difference $\delta$. Since the two samples share the same variance, we can use for example the $t$-statistic with a pooled estimate of the common variance.

This statistic can be easily computed using `stats::t.test(x, y, var.equal = TRUE)$statistic`. However, we want to extend its evaluation to any permuted version of the data. Test statistic functions compatible with [**flipr**](https://lmjl-alea.github.io/flipr/) should have at least two mandatory input arguments:
This statistic can be easily computed using `stats::t.test(x, y, var.equal = TRUE)$statistic`. However, we want to extend its evaluation to any permuted version of the data. Test statistic functions compatible with [**flipr**](https://permaverse.github.io/flipr/) should have at least two mandatory input arguments:

- `data` which is either a concatenated list of size $n_x + n_y$ regrouping the data points of both samples or a distance matrix of size $(n_x + n_y) \times (n_x + n_y)$ stored as an object of class `dist`.
- `indices1` which is an integer vector of size $n_x$ storing the indices of the data points belonging to the first sample in the current permuted version of the data.

Some test statistics are already implemented in [**flipr**](https://lmjl-alea.github.io/flipr/) and ready to use. User-defined test statistics can be used as well, with the use of the helper function `use_stat(nsamples = 2, stat_name = )`. This function creates and saves an `.R` file in the `R/` folder of the current working directory and populates it with the following template:
Some test statistics are already implemented in [**flipr**](https://permaverse.github.io/flipr/) and ready to use. User-defined test statistics can be used as well, with the use of the helper function `use_stat(nsamples = 2, stat_name = )`. This function creates and saves an `.R` file in the `R/` folder of the current working directory and populates it with the following template:
```{r, eval=FALSE}
#' Test Statistic for the Two-Sample Problem
#'
Expand Down Expand Up @@ -141,7 +144,7 @@ stat_{{{name}}} <- function(data, indices1) {
}
```

For instance, a [**flipr**](https://lmjl-alea.github.io/flipr/)-compatible version of the $t$-statistic with pooled variance will look like:
For instance, a [**flipr**](https://permaverse.github.io/flipr/)-compatible version of the $t$-statistic with pooled variance will look like:
```{r}
my_t_stat <- function(data, indices1) {
n <- if (inherits(data, "dist"))
Expand Down Expand Up @@ -172,7 +175,7 @@ stat_functions <- list(my_t_stat)

### Assign test statistics to parameters

Finally we need to define a named list that tells [**flipr**](https://lmjl-alea.github.io/flipr/) which test statistics among the ones declared in the `stat_functions` list should be used for each parameter under investigation. This is used to determine bounds on each parameter for the plausibility function. This list, often termed `stat_assignments`, should therefore have as many elements as there are parameters under investigation. Each element should be named after a parameter under investigation and should list the indices corresponding to the test statistics that should be used for that parameter in `stat_functions`. In our example, it boils down to:
Finally we need to define a named list that tells [**flipr**](https://permaverse.github.io/flipr/) which test statistics among the ones declared in the `stat_functions` list should be used for each parameter under investigation. This is used to determine bounds on each parameter for the plausibility function. This list, often termed `stat_assignments`, should therefore have as many elements as there are parameters under investigation. Each element should be named after a parameter under investigation and should list the indices corresponding to the test statistics that should be used for that parameter in `stat_functions`. In our example, it boils down to:
```{r}
stat_assignments <- list(delta = 1)
```
Expand Down
39 changes: 20 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@

<!-- README.md is generated from README.Rmd. Please edit that file -->

# Overview <a href='https://lmjl-alea.github.io/flipr/'><img src='man/figures/logo.png' align="right" height="139" /></a>
# Overview <a href='https://permaverse.github.io/flipr/'><img src='man/figures/logo.png' align="right" height="139" /></a>

<!-- badges: start -->

[![R-CMD-check](https://github.com/LMJL-Alea/flipr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/LMJL-Alea/flipr/actions/workflows/R-CMD-check.yaml)
[![test-coverage](https://github.com/LMJL-Alea/flipr/workflows/test-coverage/badge.svg)](https://github.com/LMJL-Alea/flipr/actions)
[![R-CMD-check](https://github.com/permaverse/flipr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/permaverse/flipr/actions/workflows/R-CMD-check.yaml)
[![test-coverage](https://github.com/permaverse/flipr/workflows/test-coverage/badge.svg)](https://github.com/permaverse/flipr/actions)
[![Codecov test
coverage](https://codecov.io/gh/LMJL-Alea/flipr/branch/master/graph/badge.svg)](https://codecov.io/gh/LMJL-Alea/flipr?branch=master)
[![pkgdown](https://github.com/LMJL-Alea/flipr/workflows/pkgdown/badge.svg)](https://github.com/LMJL-Alea/flipr/actions)
coverage](https://codecov.io/gh/permaverse/flipr/branch/master/graph/badge.svg)](https://codecov.io/gh/permaverse/flipr?branch=master)
[![pkgdown](https://github.com/permaverse/flipr/workflows/pkgdown/badge.svg)](https://github.com/permaverse/flipr/actions)
[![CRAN
status](https://www.r-pkg.org/badges/version/flipr)](https://CRAN.R-project.org/package=flipr)
<!-- badges: end -->

The goal of the [**flipr**](https://lmjl-alea.github.io/flipr/) package
The goal of the [**flipr**](https://permaverse.github.io/flipr/) package
is to provide a flexible framework for making inference via permutation.
The idea is to promote the permutation framework as an incredibly
well-suited tool for inference on complex data. You supply your data, as
complex as it might be, in the form of lists in which each entry stores
one data point in a representation that suits you and
[**flipr**](https://lmjl-alea.github.io/flipr/) takes care of the
[**flipr**](https://permaverse.github.io/flipr/) takes care of the
permutation magic and provides you with either point estimates or
confidence regions or $p$-value of hypothesis tests. Permutation tests
are especially appealing because they are exact no matter how small or
Expand All @@ -29,7 +29,7 @@ big your sample sizes are. You can also use the so-called
statistics to better target the alternative hypothesis you are testing
against. Asymptotic consistency is also guaranteed under mild conditions
on the statistic you use. The
[**flipr**](https://lmjl-alea.github.io/flipr/) package provides a
[**flipr**](https://permaverse.github.io/flipr/) package provides a
flexible permutation framework for making inference such as point
estimation, confidence intervals or hypothesis testing, on any kind of
data, be it univariate, multivariate, or more complex such as
Expand All @@ -38,19 +38,20 @@ data.

## Installation

You can install the latest stable version of
[**flipr**](https://lmjl-alea.github.io/flipr/) on CRAN with:
You can install the package from [CRAN](https://CRAN.R-project.org)
with:

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

Or you can install the development version from
Alternatively, You can install the development version of
[**flipr**](https://permaverse.github.io/flipr/) from
[GitHub](https://github.com/) with:

``` r
# install.packages("remotes")
remotes::install_github("LMJL-Alea/flipr")
# install.packages("pak")
pak::pak("permaverse/flipr")
```

## Example
Expand All @@ -61,7 +62,7 @@ library(flipr)

We hereby use the very simple t-test for comparing the means of two
univariate samples to show how easy it is to carry out a permutation
test with [**flipr**](https://lmjl-alea.github.io/flipr/).
test with [**flipr**](https://permaverse.github.io/flipr/).

### Data generation

Expand Down Expand Up @@ -119,8 +120,8 @@ This statistic can be easily computed using
`stats::t.test(x, y, var.equal = TRUE)$statistic`. However, we want to
extend its evaluation to any permuted version of the data. Test
statistic functions compatible with
[**flipr**](https://lmjl-alea.github.io/flipr/) should have at least two
mandatory input arguments:
[**flipr**](https://permaverse.github.io/flipr/) should have at least
two mandatory input arguments:

- `data` which is either a concatenated list of size $n_x + n_y$
regrouping the data points of both samples or a distance matrix of
Expand All @@ -131,7 +132,7 @@ mandatory input arguments:
current permuted version of the data.

Some test statistics are already implemented in
[**flipr**](https://lmjl-alea.github.io/flipr/) and ready to use.
[**flipr**](https://permaverse.github.io/flipr/) and ready to use.
User-defined test statistics can be used as well, with the use of the
helper function `use_stat(nsamples = 2, stat_name = )`. This function
creates and saves an `.R` file in the `R/` folder of the current working
Expand Down Expand Up @@ -175,7 +176,7 @@ stat_{{{name}}} <- function(data, indices1) {
```

For instance, a
[**flipr**](https://lmjl-alea.github.io/flipr/)-compatible version of
[**flipr**](https://permaverse.github.io/flipr/)-compatible version of
the $t$-statistic with pooled variance will look like:

``` r
Expand Down Expand Up @@ -214,7 +215,7 @@ stat_functions <- list(my_t_stat)
### Assign test statistics to parameters

Finally we need to define a named list that tells
[**flipr**](https://lmjl-alea.github.io/flipr/) which test statistics
[**flipr**](https://permaverse.github.io/flipr/) which test statistics
among the ones declared in the `stat_functions` list should be used for
each parameter under investigation. This is used to determine bounds on
each parameter for the plausibility function. This list, often termed
Expand Down
Loading

0 comments on commit e508e8d

Please sign in to comment.