When applying regression to a large data set with consisting of both numeric and categorical variables are there exploratory techniques in order to spot potential significant interactions between variables without having to systematically test each and every combination of variables?
1 Answer
$\begingroup$
$\endgroup$
2
There are several approaches to finding interactions, among others:
Estimate a model using all interactions of given degree. Example in R:
X <- data.frame(y=rnorm(100), x1=rnorm(100), x2=runif(100)) glm(y~.^2, data=X)
.
includes all columns fromX
in model formula,^2
includes all second degree interactions.- Estimate a model which automatically finds interactions, eg. MARS (Multivariate Adaptive Regression Splines) from
earth
package inR
.
-
$\begingroup$ Thank you. Approach 2 makes sense to me. However regarding approach 1, when including all interaction terms in a single model, then the significance of each term will be dependent on the presence of other interaction terms within the same model, thus each interaction doesn't undergo a "pure" test...right? $\endgroup$– pd441Commented Oct 4, 2017 at 8:01
-
$\begingroup$ Yes, you are right, yet it will allow you to identify possible interactions for further testing. $\endgroup$– maciekCommented Oct 4, 2017 at 8:12