Interaction between two continuous variables

From PsychWiki - A Collaborative Psychology Wiki

(Difference between revisions)
Jump to: navigation, search
CatroCoudo (Talk | contribs)
m (http://caraines.qsh.eu/cbasnrl.htm)
Jchristie (Talk | contribs)
(R commands)
 
(8 intermediate revisions not shown)
Line 1: Line 1:
-
[http://caraines.qsh.eu/cbasnrl.htm snow in august movie] [http://zelgetgo.0lx.net/new872.htm saving grace movie review] [http://faquafav.is-the-boss.com/text-117.htm jenny mccracken] [http://caraines.qsh.eu/lobofa.htm merengue dance video] [http://acsitzar.0lx.net/news-mediasubtypempeg2video-2008-11-16.html mediasubtype_mpeg2_video]
+
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. Three approaches are described below:<br>
-
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. Two approaches are described below:<br>
+
(1) '''[[#Three Steps Using SPSS | three steps to conduct the interaction using commands within SPSS]]''', and<br>
(1) '''[[#Three Steps Using SPSS | three steps to conduct the interaction using commands within SPSS]]''', and<br>
-
(2) '''[[#Interaction! software | Interaction! software]]''' by Daniel S. Soper that performs statistical analysis and graphics for interactions between dichotomous, categorical, and continuous variables.
+
(2) '''[[#Interaction! software | Interaction! software]]''' by Daniel S. Soper that performs statistical analysis and graphics for interactions between dichotomous, categorical, and continuous variables.<br>
 +
(3)  '''[[#R commands | R commands]]''' for executing the analysis.
<nowiki>*</nowiki>For a description of what is an interaction and main effects, please see the accompanying page about [[What is an Interaction?]].
<nowiki>*</nowiki>For a description of what is an interaction and main effects, please see the accompanying page about [[What is an Interaction?]].
Line 12: Line 12:
==Three Steps using SPSS==
==Three Steps using SPSS==
There are three steps involved to calculate the interaction between two continuous variables.
There are three steps involved to calculate the interaction between two continuous variables.
-
===► '''Center''' the two continuous variables===
+
==='''Center''' the two continuous variables===
*Why center the variables?  
*Why center the 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).  
*#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).  
Line 38: Line 38:
*#:/VARS  = IQ, study
*#:/VARS  = IQ, study
*#:/DVARS = IQ_c, study_c
*#:/DVARS = IQ_c, study_c
-
*#In the above example, ‘IQ’ and ‘study’ are the variable names in SPSS given to the IQ and time spent studying by the subjects. ‘Subjects’ indicates the variable containing the case numbers, in this case 1-200 as there were 200 subjects in the study.
+
*#In the above example, ‘IQ’ and ‘study’ are the variable names in SPSS given to the IQ and time spent studying by the subjects. ‘Subjects’ indicates the variable containing the case numbers, in this case 1-200 as there were 200 subjects in the study.
*#Highlight the text, and click run selection. A new SPSS data editor window should be created at the end of which should be 2 new SPSS variables IQ_c and study_c. You should now save this spss file with a new name.
*#Highlight the text, and click run selection. A new SPSS data editor window should be created at the end of which should be 2 new SPSS variables IQ_c and study_c. You should now save this spss file with a new name.
-
===► '''Create the interaction term'''===
+
==='''Create the interaction term'''===
*How to create the interaction term?
*How to create the interaction term?
*#Simply multiply together the two new centered variables.
*#Simply multiply together the two new centered variables.
Line 51: Line 51:
-
===► '''Conduct Regression'''===
+
==='''Conduct Regression'''===
*How to conduct the regression analysis?
*How to conduct the regression analysis?
*#In SPSS, click on "linear regression" and enter the test score variable as the DV.
*#In SPSS, click on "linear regression" and enter the test score variable as the DV.
Line 68: Line 68:
*There is an SPSS macro for conducting cross-product regressions [http://www.ilstu.edu/~wjschne/tests.html here].  
*There is an SPSS macro for conducting cross-product regressions [http://www.ilstu.edu/~wjschne/tests.html here].  
-
   
+
==R commands==
-
 
+
*Assuming you have your data in a comma delimited text file called 'myGreatData.csv' and the first line (header) labels the three columns 'y, x1, x2', the following command will generate your regression.  Note that these commands are the minimum and assume the same things are true as are true in the SPSS example above (centering, assumptions of the regression are met, etc.).
-
 
+
*#setwd( 'dataDir' ) #Set the working director to the path to your data file. You could skip this step and just enter the full path into the next step.
-
 
+
*#dat <- read.csv( 'myGreatData.csv', header = TRUE ) #load your data file into the variable 'dat'
 +
*#m <- lm( y ~ x1 * x2, data = 'dat') #do the regression
 +
*#summary(m) #view the results
----
----
-
◄ Back to [[Research_Tools |Research Tools mainpage]]
+
Back to [[Analyzing Data]] page

Latest revision as of 16:49, 5 August 2011

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. Three approaches are described below:
(1) three steps to conduct the interaction using commands within SPSS, and
(2) Interaction! software by Daniel S. Soper that performs statistical analysis and graphics for interactions between dichotomous, categorical, and continuous variables.
(3) R commands for executing the analysis.

*For a description of what is an interaction and main effects, please see the accompanying page about What is an Interaction?.


Contents


Three Steps using SPSS

There are three steps involved to calculate the interaction between two continuous variables.

Center the two continuous variables


Create the interaction term


Conduct Regression



Interaction! software

R commands


◄ Back to Analyzing Data page

Personal tools
Namespaces
Variants
Actions
Navigation
Interaction
Toolbox