Interaction between two continuous variables
From PsychWiki - A Collaborative Psychology Wiki
(Difference between revisions)
Line 4: | Line 4: | ||
*Interactions are when the effect of two, or more, variables is not simply additive. This page describes the interaction between two variables. It is possible to examine the interactions of three or more variables but this is beyond the scope of this page. | *Interactions are when the effect of two, or more, variables is not simply additive. This page describes the interaction between two variables. It is possible to examine the interactions of three or more variables but this is beyond the scope of this page. | ||
*Example of interaction - One possible interaction is the effect of energy bars and energy drinks on time to run the 1500 meters. The quantity of energy bars and energy drinks represent two variables. The dependent variable is the time taken to run 1500 meters. | *Example of interaction - One possible interaction is the effect of energy bars and energy drinks on time to run the 1500 meters. The quantity of energy bars and energy drinks represent two variables. The dependent variable is the time taken to run 1500 meters. | ||
- | *# ''Example 1'' - An interaction occurs if running speed improves by more than just the additive effect of having either an energy bar or an | + | *# ''Example 1'' - An interaction occurs if running speed improves by more than just the additive effect of having either an energy bar or an energy drink. For example, imagine eating a certain amount of energy bars increases running speed by 5 seconds, and drinking energy drinks increases running speed by 3 seconds. An interaction occurs if the joint effect of energy bars and energy drinks increases running speed by more than 8 seconds, such as liquid in the drink amplifying the ability to digest the energy in the bar leading to faster times. |
*# ''Example 2'' - Another example of an interaction effect would be if running time worsened by the joint effect of energy bars and energy drinks -- perhaps the person feels bloated from eating ''and'' drinking and so are unable to run quickly. | *# ''Example 2'' - Another example of an interaction effect would be if running time worsened by the joint effect of energy bars and energy drinks -- perhaps the person feels bloated from eating ''and'' drinking and so are unable to run quickly. | ||
*# ''Example 3'' - A third and final example of an interaction is that alone neither variable may have an effect on running speed, such as imagining that an energy bar by itself, or an energy drink by itself, is unable to increase running speed. But, there might be an interaction effect that influences running speed when you eat the bar ''and'' drink the drink, such as the energy bar having a chemical that unleashes the power of the energy drink to increase running speed. | *# ''Example 3'' - A third and final example of an interaction is that alone neither variable may have an effect on running speed, such as imagining that an energy bar by itself, or an energy drink by itself, is unable to increase running speed. But, there might be an interaction effect that influences running speed when you eat the bar ''and'' drink the drink, such as the energy bar having a chemical that unleashes the power of the energy drink to increase running speed. | ||
Line 29: | Line 29: | ||
#'''Center''' the two continuous variables | #'''Center''' the two continuous variables | ||
#*To increase interpretability of interactions numerous researchers (e.g. [[Aiken and West, 1991]]; [[Judd and McClelland, 1989]]) have recommended centering the predictor variables (X1 and X2). If the variables are not centered there are possible problems with multicolinearity, which means that if the IVs are not centered their product (used in computing the interaction) is highly correlated with the original IV. | #*To increase interpretability of interactions numerous researchers (e.g. [[Aiken and West, 1991]]; [[Judd and McClelland, 1989]]) have recommended centering the predictor variables (X1 and X2). If the variables are not centered there are possible problems with multicolinearity, which means that if the IVs are not centered their product (used in computing the interaction) is highly correlated with the original IV. | ||
- | #*You center the continuous variables by subtracting the mean score from each | + | #*You center the continuous variables by subtracting the mean score from each data-point. In other words, use SPSS, or another statistical program, to find the mean value of the variable. Then, use the "Compute" command in SPSS to create a new variable that is the original values minus the mean. Then, repeat the procedure for the second variable. |
#*As a concrete example, imagine you have 200 subjects (N=200) for which you have their IQ score and the length of time they studied for an exam. Thus, there are two continuous variables (X1=IQ, X2=time spent studying), and your dependent variable is the test score (Y=test score). | #*As a concrete example, imagine you have 200 subjects (N=200) for which you have their IQ score and the length of time they studied for an exam. Thus, there are two continuous variables (X1=IQ, X2=time spent studying), and your dependent variable is the test score (Y=test score). | ||
#*Imagine that the average IQ score is 100. To center the IQ variable, 100 needs to be subtracted from every every subject's IQ score. So if a subject has an IQ of 115, their centered IQ score is 15. If a subject has an IQ of 90, their centered IQ score is -10. For easy reference, lets called the newly centered IQ score as "IQ_c". | #*Imagine that the average IQ score is 100. To center the IQ variable, 100 needs to be subtracted from every every subject's IQ score. So if a subject has an IQ of 115, their centered IQ score is 15. If a subject has an IQ of 90, their centered IQ score is -10. For easy reference, lets called the newly centered IQ score as "IQ_c". | ||
- | #* | + | #*To check your transformation has been performed correctly you should compute the mean of your IQ_c variable. If the centering process has worked the mean score for IQ_c should be 0. It is important that the mean score you subtract is as accurate as possible. Typically this means your mean score should be entered to say at least 4 decimal places (though the number of decimal places needed will depend on your data). If you have rounded your mean score your centered variable may not have a mean of zero. |
+ | |||
Revision as of 05:59, 30 October 2006
Statistical programs, like SPSS, do not always have "point-and-click" commands for every possible statistical test. This page is a description of how to test the interaction between two continuous variables. Below, an explanation of interactions is presented, then the three steps to conduct the interaction is described, and examples are given to help in understanding the steps involved.
What is an interaction?
- Interactions are when the effect of two, or more, variables is not simply additive. This page describes the interaction between two variables. It is possible to examine the interactions of three or more variables but this is beyond the scope of this page.
- Example of interaction - One possible interaction is the effect of energy bars and energy drinks on time to run the 1500 meters. The quantity of energy bars and energy drinks represent two variables. The dependent variable is the time taken to run 1500 meters.
- Example 1 - An interaction occurs if running speed improves by more than just the additive effect of having either an energy bar or an energy drink. For example, imagine eating a certain amount of energy bars increases running speed by 5 seconds, and drinking energy drinks increases running speed by 3 seconds. An interaction occurs if the joint effect of energy bars and energy drinks increases running speed by more than 8 seconds, such as liquid in the drink amplifying the ability to digest the energy in the bar leading to faster times.
- Example 2 - Another example of an interaction effect would be if running time worsened by the joint effect of energy bars and energy drinks -- perhaps the person feels bloated from eating and drinking and so are unable to run quickly.
- Example 3 - A third and final example of an interaction is that alone neither variable may have an effect on running speed, such as imagining that an energy bar by itself, or an energy drink by itself, is unable to increase running speed. But, there might be an interaction effect that influences running speed when you eat the bar and drink the drink, such as the energy bar having a chemical that unleashes the power of the energy drink to increase running speed.
- For those more technically minded, here is the algebra. An interaction effect reflects the effect of the interaction controlling for the two predictors themselves.
- In the following examples:
- energy bar = X1,
- energy drink = X2
- the interaction = X1*X2,
- Y = running speed
- Here is the formula for: Running speed = intercept + b1energu drink + b2energy bar + b3(bar * drink) + ei
- Y_{i} = b_{0} + b_{1}X1_{i} + b_{2}X2_{i} + b_{3}(X1_{i} X2_{i}) + e_{i}
- This formula can be rewritten as
- Y_{i} = (b_{0} + b_{2}X_{2i}) + (b_{1}+ b_{3}X_{2i}) X_{1i} + e_{i}
- where (b_{1}+ b_{3}X_{2i}) represents the effect of X_{1} on Y at specific levels of X_{2}
- and b_{3} indicates how much the slope of X_{1} changes as X_{2} goes up or down one unit.
- It is then possible to factor out X_{2}
- Y_{i} = (b_{0} + b_{1}X_{1i}) + (b_{2}+ b_{3}X_{1i}) X_{2i} + e_{i}
- where (b_{2}+ b_{3}X_{1i}) represents the effect of X_{2} on Y at specific levels of X_{1}
- and b_{3} indicates how much the slope of X_{2} changes as X_{2} goes up or down one unit.
- In the following examples:
Three Steps
There are three steps involved to calculate the interaction between two continuous variables.
- Center the two continuous variables
- To increase interpretability of interactions numerous researchers (e.g. (Aiken and West, 1991); (Judd and McClelland, 1989)) have recommended centering the predictor variables (X1 and X2). If the variables are not centered there are possible problems with multicolinearity, which means that if the IVs are not centered their product (used in computing the interaction) is highly correlated with the original IV.
- You center the continuous variables by subtracting the mean score from each data-point. In other words, use SPSS, or another statistical program, to find the mean value of the variable. Then, use the "Compute" command in SPSS to create a new variable that is the original values minus the mean. Then, repeat the procedure for the second variable.
- As a concrete example, imagine you have 200 subjects (N=200) for which you have their IQ score and the length of time they studied for an exam. Thus, there are two continuous variables (X1=IQ, X2=time spent studying), and your dependent variable is the test score (Y=test score).
- Imagine that the average IQ score is 100. To center the IQ variable, 100 needs to be subtracted from every every subject's IQ score. So if a subject has an IQ of 115, their centered IQ score is 15. If a subject has an IQ of 90, their centered IQ score is -10. For easy reference, lets called the newly centered IQ score as "IQ_c".
- To check your transformation has been performed correctly you should compute the mean of your IQ_c variable. If the centering process has worked the mean score for IQ_c should be 0. It is important that the mean score you subtract is as accurate as possible. Typically this means your mean score should be entered to say at least 4 decimal places (though the number of decimal places needed will depend on your data). If you have rounded your mean score your centered variable may not have a mean of zero.