interactions Flashcards
what is an interaction?
when the effects of one predictor on the outcome differ across levels of another predictor
categorical * continuous interaction general definition
the slope of the regression line between a continuous predictor and the outcome is different across levels of the categorical predictor
continuous * continuous interaction general definition
the slope of the regression line between a continuous predictor and the outcome changes as the values of a second predictor change - this is also called moderation
categorical * categorical interaction general definition
there is a difference in the difference between groups across levels of a second factor
interaction equation
yi = β0 + β1xi + β2zi + β3xizi + error
where:
β0 = intercept
xi = first predictor
zi = second predictor
β3 = interaction coefficient
categorical * continuous example and interpretation
RSQ: how years of service (x) predicts salary (y) in two different departments (z)
- accounts = 1 and managers = 0
β0 = predicted salary for a manager (=0) with 0 years of service
β1 = salary increase for each additional year of service for a manger
β2 = difference in salary for accounts and managers with 0 years of service
β3 = (difference in slope) change in salary for those in accounts for each year of service
categorical * continuous generic interpretation
where z is a binary predictor
β0 = value of y when x and z = 0
β1 = effect of x (slope) when z = 0 (reference group)
β2 = difference in intercept between z=1 and z=0, when x = 0
β3 = difference in slope across levels of z
simple slopes
method of plotting interactions
regression of the outcome y on a predictor x at specific values of an interacting z variable
calculation:
^y = (β1 + β3z)x + (β2z + β0) this means y = coefficients for slope + intercept
the above equation is easy when we have binary variables for x or z - when we have continuous variables the norm is to select + and - 1sd and the mean value
what are marginal effects
in a linear model with no interaction, the β values are called main effects
when their is an interaction term, the marginal effects are the β coefficients when the other variables = 0
what is a higher order term?
another word for an interaction term - it has a non-linear effect
centring predictors
for interpretation of models with interaction involves evaluating variables when another = 0 - this means that it is important that 0 is meaningful in someway.
centring predictors
for interpretation of models with interaction involves evaluating variables when another = 0 - this means that it is important that 0 is meaningful in someway.
centring shifts the 0 point on the model line - slope will be unaffected but the intercept point will change
e.g. if we mean centre, the mean values are made 0 so our intercept value is now the value for the mean of x and z
continuous * continuous generic interpretation
β0 = value of y when z and x = 0
β1 = effect of x (slope) when z = 0
β2 = effect of z (slope) when x = 0
β3 = change in slope of x on y across values of z (and vice versa)
β1 and 2 here are conditional effects, not main effects, as they are the effects at the value of 0 of the interacting variable.
continuous * continuous example and interpretation
how years of service (x) and employee performance (z) predicts salary
β0 = salary of someone with 0 years of service and an performance score of 0
β1 = change in salary for someone with a performance rating of 0 for each year of service
β2 = change in salary for someone with 0 years of service for each point increase of performance rating
β3 = for every year of service the relationship between performance rating and salary increases/decreases by…. (and vice versa)
probing interactions
in R we use the function probe_interaction to plot model interactions. simple slope ananlysis requires us to pick 2 points at which to test the slope