CovCorTest

R package providing statistical tests for covariance and correlation matrices and their structures

https://github.com/sjedhoff/covcortest

Science Score: 49.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 4 DOI reference(s) in README
  • Academic publication links
    Links to: arxiv.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.2%) to scientific vocabulary
Last synced: 9 months ago · JSON representation

Repository

R package providing statistical tests for covariance and correlation matrices and their structures

Basic Info
  • Host: GitHub
  • Owner: sjedhoff
  • License: gpl-3.0
  • Language: R
  • Default Branch: main
  • Homepage:
  • Size: 339 KB
Statistics
  • Stars: 1
  • Watchers: 1
  • Forks: 1
  • Open Issues: 0
  • Releases: 0
Created over 2 years ago · Last pushed about 1 year ago
Metadata Files
Readme License

README.md

CovCorTest

Statistical Tests for Covariance and Correlation Matrices and their Structures

R-CMD-check Codecov test coverage CRAN status <!-- badges: end -->

A compilation of tests for hypotheses regarding covariance and correlation matrices for one or more groups. The hypothesis can be specified through a corresponding hypothesis matrix and a vector or by choosing one of the basic hypotheses, while for the structure test, only the latter works. Thereby Monte-Carlo and Bootstrap-techniques are used, and the respective method must be chosen, and the functions provide p-values and mostly also estimators of calculated covariance matrices of test statistics.

Installation

The official version of CovCorTest can be installed using the R Console:

r install.packages("CovCorTest")

You can install the development version of CovCorTest from GitHub with:

``` r

install.packages("devtools")

devtools::install_github("sjedhoff/CovCorTest") ```

Structure of the package

The package is structures in tests regarding the covariance matrix and the correlation matrix and their structures. A combined test for both is implemented as well. For each of the matrices, covariance and correlation, two test functions are defined. The best approach is to start with the simple functions: test_covariance and test_correlation respectively allow to test for a selection of different predefined hypotheses for the corresponding matrices. These function take the dataset, the group sizes (when testing for multiple groups) and the hypothesis, which should be tested. Since the hypothesis can be chosen using a character string like “equal”, no further knowledge about the matrices used to test the hypotheses is needed. For more advanced users, alternatively to using the hypothesis argument, a specific hypothesis matrix C and a corresponding vector Xi can be passed along to the function. This can be used to test all forms of hypotheses, but in-depth knowledge is necessary.

The structures of the covariance and correlation matrices can be tested using test_covariance_structureand test_correlation_structure respectively. Instead of a hypothesis, a structure can be selected using a string, which will then be tested.

The combined_test functions delivers a possibility to test for equality of the covariance and correlation matrix of two groups.

Example

We are using the EEGwide dataset from the MANOVA.RM package as an example. For this, we are just focusing on two groups and the numerical variables. ``` r library(CovCorTest) data("EEGwide", package = "MANOVA.RM") vars <- colnames(EEGwide)[1:6]

data <- list(t(EEGwide[EEGwide$sex == "M" & EEGwide$diagnosis == "AD", vars]), t(EEGwide[EEGwide$sex == "M" & EEGwide$diagnosis == "MCI", vars])) ```

For the two groups, we can check for equality of the covariance matrices ```r test_covariance(X = data, nv = c(12,27), hypothesis = "equal")

``` The nv argument is for passing along group sizes. We can also leave it empty and a warning message shows.

We could also test, if the two groups are equal-correlated r test_correlation(X = data, hypothesis = "equal-correlated")

With the combined test, we can test for the covariance and the correlation matrices r test_combined(X = data, nv = c(12, 27))

The test for the structure of the covariance and correlation matrices are just for one matrix, i.e. just one group. Different structures can be tested: r test_covariance_structure(X = data[[1]], structure = "diag")

Literature

Owner

  • Name: Svenja Jedhoff
  • Login: sjedhoff
  • Kind: user

GitHub Events

Total
  • Member event: 1
  • Public event: 1
  • Push event: 7
  • Pull request event: 1
  • Fork event: 1
Last Year
  • Member event: 1
  • Public event: 1
  • Push event: 7
  • Pull request event: 1
  • Fork event: 1

Packages

  • Total packages: 1
  • Total downloads:
    • cran 180 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 1
  • Total maintainers: 1
cran.r-project.org: CovCorTest

Statistical Tests for Covariance and Correlation Matrices and their Structures

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 180 Last month
Rankings
Dependent packages count: 26.3%
Dependent repos count: 32.4%
Average: 48.4%
Downloads: 86.6%
Last synced: 10 months ago

Dependencies

.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v4 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/rhub.yaml actions
  • r-hub/actions/checkout v1 composite
  • r-hub/actions/platform-info v1 composite
  • r-hub/actions/run-check v1 composite
  • r-hub/actions/setup v1 composite
  • r-hub/actions/setup-deps v1 composite
  • r-hub/actions/setup-r v1 composite
.github/workflows/test-coverage.yaml actions
  • actions/checkout v4 composite
  • actions/upload-artifact v4 composite
  • codecov/codecov-action v5 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
DESCRIPTION cran
  • MANOVA.RM * imports
  • Rdpack * imports
  • matrixcalc * imports
  • testthat >= 3.0.0 suggests