rgcm: GCM test with pre-computed residuals

View source: R/gcm.R

rgcmR Documentation

GCM test with pre-computed residuals

Description

GCM test with pre-computed residuals

Usage

rgcm(
  rY,
  rX,
  alternative = "two.sided",
  type = c("quadratic", "max", "scalar"),
  ...
)

Arguments

rY

Vector or matrix of response values.

rX

Matrix or data.frame of covariates.

alternative

A character string specifying the alternative hypothesis, must be one of "two.sided" (default), "greater" or "less". Only applies if type = "quadratic" and Y and X are one-dimensional.

type

Type of test statistic, either "quadratic" (default) or "max". If "max" is specified, the p-value is computed based on a bootstrap approximation of the null distribution with B samples.

...

Further arguments passed to independence_test().

Value

Object of class 'gcm' and 'htest' with the following components:

statistic

The value of the test statistic.

p.value

The p-value for the hypothesis

parameter

In case X is multidimensional, this is the degrees of freedom used for the chi-squared test.

hypothesis

String specifying the null hypothesis.

null.value

String specifying the null hypothesis.

method

The string "Generalised covariance measure test".

data.name

A character string giving the name(s) of the data.

rY

Residuals for the Y on Z regression.

rX

Residuals for the X on Z regression.


comets documentation built on April 4, 2025, 1:24 a.m.

Related to rgcm in comets...