# Multiple correlations with pairs of variables and their respective pairs of residual variables

21 messages
12
Open this post in threaded view
|

## Multiple correlations with pairs of variables and their respective pairs of residual variables

 I wonder you could help work out a simpler syntax. I have 7 variables and have done a regression with each of them as a DV and a particular IV and have saved the unstandardised residual scores for each of those regressions. This is because I wanted to remove the shared variance from each of those DVs with the specific IV. Then I want to correlate these pairs of variables with their residual variables separately (not all in one matrix). This is because I need to add these matrices in a particular calculator which asks for 4x4 matrix. To do that I would have about 21 correlation commands to produce 21 correlation matrices. I will also be repeating this by using few other IVs so there will be more than 100 correlations in total. So this is how I've started now: CORRELATIONS /VARIABLES=v1 v2 res_v1 res_v2 /PRINT=TWOTAIL SIG /MISSING=PAIRWISE. CORRELATIONS /VARIABLES=v1 v3 res_v1 res_v3 /PRINT=TWOTAIL SIG /MISSING=PAIRWISE. CORRELATIONS /VARIABLES=v2 v3 res_v2 res_v3 /PRINT=TWOTAIL SIG /MISSING=PAIRWISE. And so on...until all pairs are done. Would there be a simpler syntax than to repeating this command 100 times? Thanks for your help! -- Sent from: http://spssx-discussion.1045642.n5.nabble.com/===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Open this post in threaded view
|

## Re: Multiple correlations with pairs of variables and their respective pairs of residual variables

 If you use paired t-test for all pairs you will obtain all individual means and se all pairwise correlation an all t tests Or do factor analysis with options for descriptive and correlations Residuals may be calculated from SEs Sent from my iPhone > On 1 Sep 2020, at 06:26, userTC <[hidden email]> wrote: > > I wonder you could help work out a simpler syntax. > > I have 7 variables and have done a regression with each of them as a DV and > a particular IV and have saved the unstandardised residual scores for each > of those regressions. This is because I wanted to remove the shared variance > from each of those DVs with the specific IV. > > Then I want to correlate these pairs of variables with their residual > variables separately (not all in one matrix). This is because I need to add > these matrices in a particular calculator which asks for 4x4 matrix. > > To do that I would have about 21 correlation commands to produce 21 > correlation matrices. I will also be repeating this by using few other IVs > so there will be more than 100 correlations in total. > > So this is how I've started now: > > CORRELATIONS > > /VARIABLES=v1 v2 res_v1 res_v2 > > /PRINT=TWOTAIL SIG > > /MISSING=PAIRWISE. > > CORRELATIONS > > /VARIABLES=v1 v3 res_v1 res_v3 > > /PRINT=TWOTAIL SIG > > /MISSING=PAIRWISE. > > CORRELATIONS > > /VARIABLES=v2 v3 res_v2 res_v3 > > /PRINT=TWOTAIL SIG > > /MISSING=PAIRWISE. > > And so on...until all pairs are done. > > Would there be a simpler syntax than to repeating this command 100 times? > > Thanks for your help! > > > > -- > Sent from: http://spssx-discussion.1045642.n5.nabble.com/> > ===================== > To manage your subscription to SPSSX-L, send a message to > [hidden email] (not to SPSSX-L), with no body text except the > command. To leave the list, send the command > SIGNOFF SPSSX-L > For a list of commands to manage subscriptions, send the command > INFO REFCARD ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Open this post in threaded view
|

## Re: Multiple correlations with pairs of variables and their respective pairs of residual variables

 In reply to this post by userTC Well, for one compact set that includes (I think) many of the correlations that you want, you could look at the part-corr matrix of the 7 variables while partialing out your particular independent variable. Please, what are you hoping to get, in the end?  My imagination is failing me. And, if you point us at the end result, someone might have a quicker way to get there. By the way, I think the relations among the correlations that you do describe are going to be screwed up (if looked at closely) if you have different Ns owing to MISSING scores -- your syntax-example suggests there are Missing. -- Rich Ulrich From: SPSSX(r) Discussion <[hidden email]> on behalf of userTC <[hidden email]> Sent: Monday, August 31, 2020 8:28 PM To: [hidden email] <[hidden email]> Subject: Multiple correlations with pairs of variables and their respective pairs of residual variables   I wonder you could help work out a simpler syntax. I have 7 variables and have done a regression with each of them as a DV and a particular IV and have saved the unstandardised residual scores for each of those regressions. This is because I wanted to remove the shared variance from each of those DVs with the specific IV. Then I want to correlate these pairs of variables with their residual variables separately (not all in one matrix). This is because I need to add these matrices in a particular calculator which asks for 4x4 matrix. To do that I would have about 21 correlation commands to produce 21 correlation matrices. I will also be repeating this by using few other IVs so there will be more than 100 correlations in total. So this is how I've started now: CORRELATIONS /VARIABLES=v1 v2 res_v1 res_v2 /PRINT=TWOTAIL SIG /MISSING=PAIRWISE. CORRELATIONS /VARIABLES=v1 v3 res_v1 res_v3 /PRINT=TWOTAIL SIG /MISSING=PAIRWISE. CORRELATIONS /VARIABLES=v2 v3 res_v2 res_v3 /PRINT=TWOTAIL SIG /MISSING=PAIRWISE. And so on...until all pairs are done. Would there be a simpler syntax than to repeating this command 100 times? Thanks for your help! -- Sent from: http://spssx-discussion.1045642.n5.nabble.com/ ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Open this post in threaded view
|

## Re: Multiple correlations with pairs of variables and their respective pairs of residual variables

 Thank you for your suggestions. Doing all the correlations at once would not work. Or should I say, I would get the same results but there would be lots of searching for the right ones, and copying and pasting if I correlated all the variables in a single correlation matrix. What I am trying to do is correlate pairs of variables with each other and with their respective residual variables (which I saved as variables from the regressions I've done previously). Once I obtain the correlations in a 4x4 matrix I need to paste it into a calculator to work out the significant difference between the adjusted and unadjusted correlations. This calculator converts the Pearson correlations to Fisher's Z and then tests the significance of the difference between them. I use the calculator which treats correlations as dependent but non-overlapping, which is the last table in this excel sheet ( link ). See /"Zou, G. Y. (2007). Toward using confidence intervals to compare correlations. Psychological Methods, 12, 399-413./" for details on comparisons between dependent correlations. While I could just run these correlations one after another, and get the same result, I am trying to find a way to reduce the amount of text in the syntax because I am writing the syntax to make it publicly available so that others can replicate it. So trying to keep it nice and neat. However, I worked out that I could reduce the amount of text by listing all the variables under one correlation command it this way: CORRELATIONS /VARIABLES=v1 v2 res_v1 res_v2 /VARIABLES=v1 v3 res_v1 res_v3 /VARIABLES=v2 v3 res_v2 res_v3 /MISSING=PAIRWISE. That can do the job for now but would be good if I can shorten it even further as I still have about 100 of those combinations to run. It's not the output that I'm concerned about, just the syntax. And there will be no missing values as I've imputed them. You're right, the missing values option is not needed, thanks for pointing that out. Tanja -- Sent from: http://spssx-discussion.1045642.n5.nabble.com/===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Open this post in threaded view
|

## Re: Multiple correlations with pairs of variables and their respective pairs of residual variables

 In reply to this post by userTC KISS( Keep it stupid simple). Do all of the variables at one time and let the devil sort it out. Use OUTFILE on CORR command and manipulate the resulting data.  I am with Rich as far as my imagination failing. What precisely are you attempting to achieve. ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Open this post in threaded view
|

## Re: Multiple correlations with pairs of variables and their respective pairs of residual variables

 In reply to this post by userTC Please tell us the purpose and context of this effort? Understanding the substantive questions, whether the variables are intended as items in summative scales, etc. might allow us to suggest ways to reach your goals. ----- Art Kendall Social Research Consultants -- Sent from: http://spssx-discussion.1045642.n5.nabble.com/===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD Art Kendall Social Research Consultants
Open this post in threaded view
|

## Re: Multiple correlations with pairs of variables and their respective pairs of residual variables

Open this post in threaded view
|

## Re: Multiple correlations with pairs of variables and their respective pairs of residual variables

 In reply to this post by userTC I still am not clear on what you are doing, but  you might find the STATS CORRELATIONS extension command, installablle from Extensions > Extension Hub useful.  It has a different layout of the correlations (and it gives CIs).  Try it out to  see if it helps.On Tue, Sep 1, 2020 at 5:43 PM userTC <[hidden email]> wrote:Thank you for your suggestions. Doing all the correlations at once would not work. Or should I say, I would get the same results but there would be lots of searching for the right ones, and copying and pasting if I correlated all the variables in a single correlation matrix. What I am trying to do is correlate pairs of variables with each other and with their respective residual variables (which I saved as variables from the regressions I've done previously). Once I obtain the correlations in a 4x4 matrix I need to paste it into a calculator to work out the significant difference between the adjusted and unadjusted correlations. This calculator converts the Pearson correlations to Fisher's Z and then tests the significance of the difference between them. I use the calculator which treats correlations as dependent but non-overlapping, which is the last table in this excel sheet ( link ). See /"Zou, G. Y. (2007). Toward using confidence intervals to compare correlations. Psychological Methods, 12, 399-413./" for details on comparisons between dependent correlations. While I could just run these correlations one after another, and get the same result, I am trying to find a way to reduce the amount of text in the syntax because I am writing the syntax to make it publicly available so that others can replicate it. So trying to keep it nice and neat. However, I worked out that I could reduce the amount of text by listing all the variables under one correlation command it this way: CORRELATIONS /VARIABLES=v1 v2 res_v1 res_v2 /VARIABLES=v1 v3 res_v1 res_v3 /VARIABLES=v2 v3 res_v2 res_v3 /MISSING=PAIRWISE. That can do the job for now but would be good if I can shorten it even further as I still have about 100 of those combinations to run. It's not the output that I'm concerned about, just the syntax. And there will be no missing values as I've imputed them. You're right, the missing values option is not needed, thanks for pointing that out. Tanja -- Sent from: http://spssx-discussion.1045642.n5.nabble.com/ ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD -- Jon K Peck[hidden email] ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Open this post in threaded view
|

## Re: Multiple correlations with pairs of variables and their respective pairs of residual variables

Open this post in threaded view
|

## Re: Multiple correlations with pairs of variables and their respective pairs of residual variables

Open this post in threaded view
|

## Re: Multiple correlations with pairs of variables and their respective pairs of residual variables

Open this post in threaded view
|

## Re: Multiple correlations with pairs of variables and their respective pairs of residual variables

 It would be helpful for the OP to describe in more detail exactly how the correlations would be transferred in order to come up with the best organization on the SPSS side.On Wed, Sep 2, 2020 at 8:47 AM Bruce Weaver <[hidden email]> wrote:I did consider suggesting a macro, Jon, but didn't want to upset you and the other Pythonistas.  ;-) Yes, OMS would be helpful too, if I'm on the right track.  Jon Peck wrote > If Bruce is on the right track, this whole set of regression and > correlation commands could be automated using a little Python or, gasp, > macro code so that the syntax could be very compact.  Further, the result > could be saved as an SPSS dataset using OMS, and  you could use SELECT IF > to cut it down to just show the correlation rows. ----- -- Bruce Weaver [hidden email] http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." NOTE: My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above. -- Sent from: http://spssx-discussion.1045642.n5.nabble.com/ ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD -- Jon K Peck[hidden email] ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Open this post in threaded view
|

## Re: Multiple correlations with pairs of variables and their respective pairs of residual variables

 I do not have access to Psychological methods these days. Fisher's Z has been discussed on this list previously. In the archives Bruce said COMPUTE rprime = 0.5*ln((1+r)/(1-r)). In 2006 Marta posted macros to compare correlations. Search ‘comparing correlations’ in the archives If you have the article and you have the formulae in Excel, why not do everything directly in SPSS? Start with the center of what you want, an example 4 by R matrix.  Work out what you would do.  Then generalize with OMS, Python, or macro. ----- Art Kendall Social Research Consultants -- Sent from: http://spssx-discussion.1045642.n5.nabble.com/===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD Art Kendall Social Research Consultants
Open this post in threaded view
|

## Re: Multiple correlations with pairs of variables and their respective pairs of residual variables

Open this post in threaded view
|

## Re: Multiple correlations with pairs of variables and their respective pairs of residual variables

Open this post in threaded view
|

## Re: Multiple correlations with pairs of variables and their respective pairs of residual variables

 The OP may find that you have already done what is needed. Do you have access to the article the OP mentioned? ----- Art Kendall Social Research Consultants -- Sent from: http://spssx-discussion.1045642.n5.nabble.com/===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD Art Kendall Social Research Consultants
Open this post in threaded view
|

## Re: Multiple correlations with pairs of variables and their respective pairs of residual variables

 In reply to this post by userTC Here's the article from Psych. Methods. Toward_Using_Confidence_Intervals_to_Compare_Correlations.pdf   Brian -- Sent from: http://spssx-discussion.1045642.n5.nabble.com/===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Open this post in threaded view
|

## Re: Multiple correlations with pairs of variables and their respective pairs of residual variables

Open this post in threaded view
|