reg_test: Regression-based Information Loss Test

View source: R/conditional-independence.R

reg_testR Documentation

Regression-based Information Loss Test

Description

Test whether x and y are associated, given conditioning_set using a generalized linear model.

Usage

reg_test(x, y, conditioning_set, suff_stat)

Arguments

x

Index of x variable.

y

Index of y variable.

conditioning_set

Index vector of conditioning variable(s), possibly NULL.

suff_stat

List with data, binary variables and order.

Details

All included variables should be either numeric or binary. If y is binary, a logistic regression model is fitted. If y is numeric, a linear regression model is fitted. x and conditioning_set are included as explanatory variables. Any numeric variables among x and conditioning_set are modeled with spline expansions (natural splines, 3 df). This model is tested against a numeric where x (including a possible spline expansion) has been left out using a likelihood ratio test. The model is fitted in both directions (interchanging the roles of x and y). The final p-value is the maximum of the two obtained p-values.

Value

A numeric, which is the p-value of the test.


causalDisco documentation built on April 13, 2026, 5:06 p.m.