Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [interaction]

A situation where the effect of an explanatory variable may depend on the value of another explanatory variable.

121
votes
9answers
48k views

Obtaining knowledge from a random forest

Random forests are considered to be black boxes, but recently I was thinking what knowledge can be obtained from a random forest? The most obvious thing is the importance of the variables, in the ...
83
votes
17answers
66k views

Including the interaction but not the main effects in a model

Is it ever valid to include a two-way interaction in a model without including the main effects? What if your hypothesis is only about the interaction, do you still need to include the main effects?
66
votes
7answers
37k views

Do all interactions terms need their individual terms in regression model?

I am actually reviewing a manuscript where the authors compare 5-6 logit regression models with AIC. However, some of the models have interaction terms without including the individual covariate terms....
37
votes
2answers
142k views

Different ways to write interaction terms in lm?

I have a question about which is the best way to specify an interaction in a regression model. Consider the following data: ...
34
votes
5answers
28k views

What are best practices in identifying interaction effects?

Other than literally testing each possible combination of variable(s) in a model (x1:x2 or x1*x2 ... xn-1 * xn). How do you ...
30
votes
1answer
5k views

Intuition behind tensor product interactions in GAMs (MGCV package in R)

Generalized additive models are those where $$ y = \alpha + f_1(x_1) + f_2(x_2) + e_i $$ for example. the functions are smooth, and to be estimated. Usually by penalized splines. MGCV is a package ...
25
votes
3answers
35k views

Why could centering independent variables change the main effects with moderation?

I have a question related to multiple regression and interaction, inspired by this CV thread: Interaction term using centered variables hierarchical regression analysis? What variables should we ...
24
votes
4answers
24k views

What if interaction wipes out my direct effects in regression?

In a regression, the interaction term wipes out both related direct effects. Do I drop the interaction or report the outcome? The interaction was not part of the original hypothesis.
24
votes
1answer
16k views

Is interaction possible between two continuous variables?

All of my variables are continuous. There are no levels. Is it possible to even have interaction between the variables?
23
votes
3answers
40k views

Interpreting interaction terms in logit regression with categorical variables

I have data from a survey experiment in which respondents were randomly assigned to one of four groups: ...
21
votes
3answers
1k views

Understanding Simpson's paradox: Andrew Gelman's example with regressing income on sex and height

Andrew Gelman in one of his recent blog posts says: I do not think counterfactuals or potential outcomes are necessary for Simpson’s paradox. I say this because one can set up Simpson’s ...
20
votes
5answers
21k views

What is a block in experimental design?

I have two questions about the notion of block in experimental design : (1) What is the difference between a block and a factor ? (2) I tried to read some books but something is not clear: it seems ...
19
votes
1answer
36k views

What is the non-parametric equivalent of a two-way ANOVA that can include interactions?

Hi I am trying to find the non-parametric equivalent of a two-way ANOVA (3x4 design) which is capable of including interactions. From my reading in Zar 1984 "Biostatistical analysis" this is possible ...
17
votes
3answers
47k views

How to interpret main effects when the interaction effect is not significant?

I ran a Generalized Linear Mixed Model in R and included an interaction effect between two predictors. The interaction was not significant, but the main effects (the two predictors) both were. Now ...
17
votes
2answers
9k views

Two negative main effects yet positive interaction effect?

I have two main effects, V1 and V2. The effects of V1 and V2 on the response variables are negative. However, for some reason I am getting positive coefficient for the interaction term V1*V2. How can ...
14
votes
1answer
9k views

Interpreting the regression output from a mixed model when interactions between categorical variables are included

I have a question about my use of a mixed model/lmer. The basic model is this: lmer(DV ~ group * condition + (1|pptid), data= df) Group and condition are both ...
14
votes
2answers
2k views

Representing interaction effects in directed acyclic graphs

Directed acyclic graphs (DAGs; e.g., Greenland, et al, 1999) are a part of a formalism of causal inference from the counterfactual interpretation of causality camp. In these graphs the presence of an ...
13
votes
1answer
6k views

Structural equations: how to specify interaction effects in R lavaan package

I am using R lavaan package to estimate a structural equation model. Let's say the model consists of 1 endogenous manifest variable with 1 latent and 2 manifest explanatory variables: ...
12
votes
4answers
19k views

“Moderation” versus “interaction”?

I have come across these two terms which are used interchangeably in many contexts. Basically, a moderator (M) is a factor that impacts on the relationship between X and Y. Moderation analysis is ...
11
votes
2answers
33k views

How to draw an interaction plot with confidence intervals?

My attempts: I couldn't get confidence intervals in interaction.plot() and on the other hand plotmeans() from package 'gplot' ...
11
votes
3answers
586 views

Moderated regression: Why do we calculate a *product* term between the predictors?

Moderated regression analyses are often used in social sciences to assess the interaction between two or more predictors/covariates. Typically, with two predictor variables, the following model is ...
11
votes
2answers
16k views
11
votes
1answer
15k views

How to do an instrumental variables regression with an instrumented interaction term in Stata?

I'm having a bit of a problem with Stata syntax. I need to do the following regression: $$y = ax + bz + c(xz) + e$$ where both $x$ and $z$ are instrumented and also the interaction term $xz$ uses ...
11
votes
2answers
5k views

SVM, variable interaction and training data fit

I have 2 general/more theoretical question. 1) I'm curious how SVMs handle variable interactions when building predictive models. E.g., if I have two features f1 and f2 and the target depends on f1, ...
11
votes
3answers
166 views

Are interactions only useful in the context of regression?

I have always read the term interaction in the context of regression. Should we also consider interactions with different models e.g. knn or svm? If there are $50$, $100$ or even more features and ...
11
votes
0answers
1k views

Ratios in Regression, aka Questions on Kronmal

Recently, randomly browsing questions triggered a memory of on off-hand comment from one of my professors a few years back warning about the usage of ratios in regression models. So I started reading ...
10
votes
3answers
9k views

Joint model with interaction terms vs. separate regressions for a group comparison

After gathering valuable feedback from previous questions and discussions, I have came up with the following question: Suppose that the goal is to detect effect differences across two groups, male vs. ...
10
votes
2answers
25k views

How to perform post-hoc comparison on interaction term with mixed-effects model?

I’m working on a data set in order to evaluate the impact of drying on sediment microbial activities. The objective is to determine if the impact of drying varies among sediment types and/or depth ...
10
votes
1answer
387 views

Techniques for analyzing ratios

I am looking for advice and comments that deal with the analysis of ratios and rates. In the field in which I work analysis of ratios in particular is widespread but I have read a few papers that ...
9
votes
3answers
24k views

How to calculate the difference of two slopes?

Is there a method to understand if two lines are (more or less) parallel? I have two lines generated from linear regressions and I would like to understand if they are parallel. In other words, I ...
9
votes
3answers
32k views

Linear regression with factors in R

I'm trying to understand how exactly factors work in R. Let's say I want to run a regression using some sample data in R: ...
9
votes
2answers
871 views

Does a positive interaction term imply correlation between its constituent variables?

Let's say I'm running a linear regression that has the form $y = \beta_0 + \beta_1A+\beta_2B+\beta_3AB +\epsilon$. If $\beta_3$ is positive, does this imply a positive correlation between $A$ and $B$...
9
votes
2answers
14k views

How do you plot an interaction between a factor and a continous covariate?

I would like to plot on the same graph the interaction between my continuous predictor and my categorical moderator. I know how to do it when both are categorical (factor interaction), but don't ...
9
votes
4answers
19k views

Help to interpret an interaction plot?

I have trouble interpreting interaction plots when there is an interaction between the two independent variables. The following graphs are from this site: Here, $A$ and $B$ are the independent ...
9
votes
2answers
6k views

How to test whether a regression coefficient is moderated by a grouping variable?

I have a regression done on two groups of the sample based on a moderating variable (say gender). I'm doing a simple test for the moderating effect by checking whether the significance of the ...
9
votes
2answers
374 views

In linear regression, why should we include quadratic terms when we are only interested in interaction terms?

Suppose I am interested in a linear regression model, for $$Y_i = \beta_0 + \beta_1x_1 + \beta_2x_2 + \beta_3x_1x_2$$, because I would like to see if an interaction between the two covariates have an ...
9
votes
2answers
6k views

Is it possible to have a variable that acts as both an effect modifier and a confounder?

Is it possible to have a variable that acts as both an effect (measurement) modifier and a confounder for a given pair of risk-outcome associations? I'm still a little unsure of the distinction. I've ...
9
votes
2answers
1k views

How should I model interactions between explanatory variables when one of them may have quadratic and cubic terms?

I'm sincerely hoping that I have phrased this question in such a way that it can be definitively answered--if not, please let me know and I will try again! I should also I guess note that I will be ...
9
votes
1answer
15k views

Interpreting coefficients of an interaction between categorical and continuous variable

I have a question about the interpretation of the coefficients of an interaction between continuous and categorical variable. here is my model: ...
9
votes
1answer
10k views

Cox proportional hazard model and interpretation of coefficients when higher case interaction is involved

Here is the summary-output of the Coxph-model I used (I used R and the output is based on the best final model i.e. all significant explanatory variables and their interactions are included): ...
9
votes
2answers
9k views

What is a valid post-hoc analysis for a three-way repeated measures ANOVA?

I've performed a three-way repeated measures ANOVA; what post-hoc analyses are valid? This is a fully balanced design (2x2x2) with one of the factors having a within-subjects repeated measure. I'm ...
9
votes
1answer
2k views

2x3 ANOVA interaction no longer significant after including a covariate? [duplicate]

My experiment had a 2x3 design with one covariate. If I analyse the results using an ANOVA, I get a strongly significant interaction between the two main factors (p<.001). If I add the covariate ...
8
votes
2answers
6k views

How to prepare interactions of categorical variables in scikit-learn?

What is the best way to prepare interactions of categorical features before fitting with scikit-learn? With statsmodels I could conveniently say in R-style ...
8
votes
1answer
7k views

Interaction term using centered variables hierarchical regression analysis? What variables should we center?

I'm running a hierarchical regression analysis and I have some little doubts: Do we calculate the interaction term using the centered variables? Do we have to center ALL the continuous variables we ...
8
votes
1answer
119 views

Does correlation between variables in an interaction matter?

Suppose you fit a model $y = x_1 + x_2 + x_1\times x_2$. Are there any practical implications for estimation of the interaction effect if $x_1$ and $x_2$ are correlated? I understand there could be ...
8
votes
1answer
157 views

A statistical interaction is significant, but the author denies it. Why?

I am evaluating a journal article regarding its statistical interactions. The article is trying to establish a relationship between less-tight control of blood pressure and progression to severe ...
8
votes
1answer
3k views

Coding an interaction between a nominal and a continuous predictor for logistic regression in MATLAB

So our data is structured as follows: We have $M$ participants, each participant can be categorized into 3 groups (G $\in {A,B,C}$), and for each participant we have $N$ samples of a continuous ...
8
votes
1answer
64 views

In multiple regression, why are interactions modelled as products, and not something else, of the predictors?

Consider multiple linear regression. This question might be deceptively simple, but I'm trying to intuitively understand why, say if I have predictors X1 and X2, then interactions between these ...
8
votes
2answers
6k views

How to interpret lower order interaction when higher order interaction is significant?

I have a question about the interpretation of lower order interaction terms in the presence of a significant higher order interaction effect. Suppose I have a 2 (factor $A$) $\times$ 2 (factor $B$) $\...
8
votes
1answer
1k views

Does every log-linear model have a perfectly equivalent logistic regression?

I am trying to fit a log-linear model to a large number of variables from survey data. There are some reasons that it might be preferable to fit logistic regressions to that data instead. Several ...