hdrm

R package providing a one sample test for high dimensional repeated measures for one or multiple groups

https://github.com/schnieboli/hdrm

Science Score: 44.0%

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

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.0%) to scientific vocabulary

Keywords

longitudinal-data r repeated-measures rstats
Last synced: 6 months ago · JSON representation ·

Repository

R package providing a one sample test for high dimensional repeated measures for one or multiple groups

Basic Info
  • Host: GitHub
  • Owner: Schnieboli
  • License: gpl-3.0
  • Language: R
  • Default Branch: main
  • Homepage:
  • Size: 371 KB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
longitudinal-data r repeated-measures rstats
Created over 1 year ago · Last pushed 11 months ago
Metadata Files
Readme License Citation

README.Rmd

---
output: github_document
bibliography: inst/REFERENCES.bib 
csl: 2d-materials.csl
---


```{r, results = 'hide', warning = FALSE, error = FALSE, message = FALSE, echo=FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
```
# hdrm




R package for performing tests on high dimensional repeated measure data for one group @Pauly2015 or multiple groups @Sattler2018.

## Installation

The current version can be installed with:

``` {r installation, results = 'hide', warning = FALSE, error = FALSE, message = FALSE}
## install devtools package
if (!requireNamespace("devtools", quietly = TRUE)) {
  install.packages("devtools")
}
# install package
devtools::install_github("Schnieboli/hdrm", dependencies = TRUE)
```
Be aware that the respective [rtools-version](https://cran.r-project.org/bin/windows/Rtools/) for your version of R is required for installation.

## One Group Test

A one group test can be performed by using the function `hdrm_single_longtabe` or `hdrm_single_widetable` depending the format of your data. Both take a `data.frame` as their first argument. The package has two data sets included: `birthrates` @birthrates comes in a wide table format and contains the birthrates of German states from 1990 to 2023. `EEG` @EEG_dataset contains EEG data in 40 dimensions and comes in a long table format.

```{r example hdrm_single, results = 'hide', warning = FALSE, error = FALSE, message = FALSE}
library(hdrm)

### One sample test for data in wide table format with built in data set birthrates
hdrm_single_widetable(data = birthrates,
                      hypothesis = "flat", # test whether time profile is flat
                      )

### One sample test for data in long table format with built in data set EEG
# hypothesis can also be given as a matrix
hypothesis <- matrix(1/40, nrow = 40, ncol = 40) # matrix equivalent to 'flat'
hdrm_single_longtable(data = EEG,
                      hypothesis = hypothesis,
                      value = "value", # can all be given as a character...
                      subject = 4,     # ...or a number
                      dimension = "dimension"
                      )
```


## Multiple Group Test
A test for multiple groups can be performed by using the function `hdrm_grouped_longtabe` or `hdrm_grouped_widetable` depending the format of your data. As for the one group test, both take a `data.frame` as their first argument. The test is performed using bootstraps to estimate the computationally heaviest estimator. The number of bootstraps can be controlled via the argument `B`. If your data is large, setting `bootstrap = TRUE` will call the bootstrap versions for the other estimators as well.
```{r example hdrm_grouped, results = 'hide', warning = FALSE, error = FALSE, message = FALSE}
library(hdrm)

### Test for multiple groups for data in wide table format with built in data set birthrates

## a vector with the same length as ncol(data) is needed that divides subjects into groups
# divide German states in east and west:
group <- factor(c(1,1,2,2,1,1,1,2,1,1,1,1,2,2,1,2), labels = c("west","east"))
hdrm_grouped_widetable(data = birthrates,
                       hypothesis = "interaction", # test for interaction effect between group and dimension
                       group = group
)

### Test for multiple groups for data in long table format with built in data set EEG
# hypothesis can also be given as a matrix
hypothesis <- list(TW = diag(4) - matrix(1/4, 4, 4),
                   TS =matrix(1/40, 40, 40)
                     ) # list entries equivalent to 'whole'
hdrm_grouped_longtable(data = EEG,
                       hypothesis = hypothesis, # test for time effect in groups
                       group = "group",
                       value = "value", # can all be given as a character...
                       subject = 4,     # ...or a number
                       dimension = "dimension"
)
```

### References

Owner

  • Login: Schnieboli
  • Kind: user

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this package, please cite it as below."
authors:
- family-names: "Hichert"
  given-names: "Nils"
title: "hdrm"
subtitle: "A package for testing high dimensional repeated measures"
version: 0.9
date-released: 2024-10-01
url: "https://github.com/Schnieboli/hdrm"

GitHub Events

Total
  • Push event: 4
  • Create event: 1
Last Year
  • Push event: 4
  • Create event: 1