simmr: Similarity-based multimodal regression

View source: R/simmr.R

simmrR Documentation

Similarity-based multimodal regression

Description

simmr fits a multimodal regression model using only distance matrices computed on the original data. Permutation testing is used to obtain p-values.

Usage

simmr(
  D,
  X,
  variables,
  tests = c("Dempster", "PC"),
  D.scale = c("max", "trace", "dvar", "none"),
  pc.pv = NULL,
  pc.n = NULL,
  n.perm = 999,
  eigen.tol = 1e-10,
  debug = FALSE
)

Arguments

D

List of distance matrices of class matrix or dist

X

Design matrix, either output of model.matrix or valid input to the function.

variables

Names of explanatory variables to regress on, must match with column names of X

tests

Chosen test statistics from "Dempster", "PC". For "PC", defaults to using n-p-1 PCs, where X is ⁠n x p⁠. If pc.pv and pc.n are both specified, pc.pv is prioritized.

D.scale

Method for normalization of distance matrices

pc.pv

Optional, calculate additional PC-based test statistics for specified proportions of variation explained

pc.n

Optional, calculate additional PC-based test statistics for specific numbers of PCs. If 'all', tries every possible number of PCs.

n.perm

Number of permutations to perform

eigen.tol

Discard eigenvalues below this tolerance for both PCA and computing test statistics

debug

Include internal objects in output (from unpermuted analysis)

Value

A list with the following components:

stat

Test statistics computed on original data.

perms

Test statistics after permutations.

perm.p

Permutation p-values for each test.

Examples

D <- list(dist(rnorm(10)), dist(rnorm(10)), dist(rnorm(10)))
X <- list("var" = runif(10))
simmr(D, X, "var")

andy1764/SiMMR documentation built on Jan. 29, 2024, 1:28 a.m.