View source: R/conditional-independence.R
| reg_test | R Documentation |
Test whether x and y are associated, given
conditioning_set using a generalized linear model.
reg_test(x, y, conditioning_set, suff_stat)
x |
Index of x variable. |
y |
Index of y variable. |
conditioning_set |
Index vector of conditioning variable(s), possibly |
suff_stat |
List with data, binary variables and order. |
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.
A numeric, which is the p-value of the test.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.