MyNixOS website logo
Description

High-Dimensional Repeated Measures.

Methods for testing main and interaction effects in possibly high-dimensional parametric or nonparametric repeated measures in factorial designs for univariate or multivariate data. The observations of the subjects are assumed to be multivariate normal if using the parametric test. The nonparametric version tests with regard to nonparametric relative effects (based on pseudo-ranks). It is possible to use up to 2 whole- and 3 subplot factors.

HRM 1.2.0

CRANstatus Travis-CI Build Status AppVeyor Build Status codecov

R package for analysing high-dimensional repeated measures for factorial designs. A description of this package can be found in [1], theoretical derivations of the test statistics are in [2] and [3].

To install the current development version:

## install devtools package
if (!requireNamespace("devtools", quietly = TRUE)) {
  install.packages("devtools")
}
# install package
devtools::install_github("happma/HRM", ref = "test", dependencies = TRUE)
library(HRM)

With this package it is possible to test for main and interaction effects of up to three whole- or subplot-factors. In total, a maximum of four factors can be used. There are two different S3 methods available. The first method requires a list of matrices in the wide table format. The second method requires a data.frame in the long table format.

## hrm_test with a list of matrices

# number patients per group
n = c(10,10)
# number of groups
a=2
# number of variables
d=40

# defining the list consisting of the samples from each group
mu_1 = mu_2 = rep(0,d)
# autoregressive covariance matrix
sigma_1 = diag(d)
for(k in 1:d) for(l in 1:d) sigma_1[k,l] = 1/(1-0.5^2)*0.5^(abs(k-l))
sigma_2 = 1.5*sigma_1
X = list(mvrnorm(n[1],mu_1, sigma_1), mvrnorm(n[2],mu_2, sigma_2))
X=lapply(X, as.matrix)

hrm_test(data=X, alpha=0.05)


## hrm.test with a data.frame using a 'formula' object

# using the EEG dataset
hrm_test(value ~ group*region*variable, subject = "subject", data = EEG)

To get confidence intervals for each factor combination you can use the generic function 'confint' for an object of class 'HRM'. This function calculates simultaneous confidence intervals which maintains the family wise error rate (FWER). See the following code:

# using the EEG dataset
z <- hrm_test(value ~ group*region*variable, subject = "subject", data = EEG)

# calculate 99% confidence intervals
confint(z, level = 0.99)

In the data there are 4 variables with each 10 regions. We can use a multivariate approach as the variables are on different scales. For that, we can use the function 'hrm_test' with the argument 'variable' set to the column name which contains the factor variable for the variables.

# using the EEG dataset
hrm_test(value ~ group*region, subject = subject, variable = variable, data = EEG)

Additionally, the package can be used with a GUI.

hrm_GUI()

References

[1] Happ, M., Harrar, S. W., and Bathke, A. C. (2018). HRM: An R Package for Analysing High-dimensional Multi-factor Repeated Measures. The R Journal 10(1), 534--548. https://journal.r-project.org/archive/2018/RJ-2018-032/index.html

[2] Happ, M., Harrar S. W. and Bathke, A. C. (2017). High-dimensional Repeated Measures. Journal of Statistical Theory and Practice. 11(3), 468-477. URL: doi:10.1080/15598608.2017.1307792.

[3] Happ, M., Harrar, S. W., & Bathke, A. C. (2016). Inference for low‐and high‐dimensional multigroup repeated measures designs with unequal covariance matrices. Biometrical Journal, 58(4), 810-830. doi:10.1002/bimj.201500064

Metadata

Version

1.2.1

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows