SPSS Syntax that generates a Correlation Matrix

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

SPSS Syntax that generates a Correlation Matrix

3J LEMA
Appreciate if someone shall provide a syntax that generates correlation matrix that contains only the Pearson r and the flags (*, **, ***), similar below:

Pearson Correlation
  Y X1 X2 X3 X4 X5 X6
Y 1 .437** .460** .433** .457** .467** .483**
X1 .437** 1 .824** .755** .809** .839** .907**
X2 .460** .824** 1 .801** .859** .842** .929**
X3 .433** .755** .801** 1 .870** .787** .910**
X4 .457** .809** .859** .870** 1 .842** .943**
X5 .467** .839** .842** .787** .842** 1 .929**
X6 .483** .907** .929** .910** .943** .929** 1
**. Correlation is significant at the 0.01 level (2-tailed).

Manual use of the pivot is tedious because I need to generate a matrix per group for 20 groups.

Thank you for your help.

Lema
===================== 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
Reply | Threaded
Open this post in threaded view
|

Re: SPSS Syntax that generates a Correlation Matrix

Jeff A

 

 

Try this:

 

FACTOR

  /VARIABLES=x1 x2 x3 x4

  /PRINT CORRELATION

  /ROTATION NOROTATE .

 

Best,

 

Jeff

 

 

 

From: SPSSX(r) Discussion <[hidden email]> On Behalf Of 3J LEMA
Sent: Sunday, June 7, 2020 11:21 AM
To: [hidden email]
Subject: SPSS Syntax that generates a Correlation Matrix

 

Appreciate if someone shall provide a syntax that generates correlation matrix that contains only the Pearson r and the flags (*, **, ***), similar below:

 

Pearson Correlation

 

Y

X1

X2

X3

X4

X5

X6

Y

1

.437**

.460**

.433**

.457**

.467**

.483**

X1

.437**

1

.824**

.755**

.809**

.839**

.907**

X2

.460**

.824**

1

.801**

.859**

.842**

.929**

X3

.433**

.755**

.801**

1

.870**

.787**

.910**

X4

.457**

.809**

.859**

.870**

1

.842**

.943**

X5

.467**

.839**

.842**

.787**

.842**

1

.929**

X6

.483**

.907**

.929**

.910**

.943**

.929**

1

**. Correlation is significant at the 0.01 level (2-tailed).

 

Manual use of the pivot is tedious because I need to generate a matrix per group for 20 groups.

 

Thank you for your help.

 

Lema

===================== 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


Virus-free. www.avast.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
Reply | Threaded
Open this post in threaded view
|

Re: SPSS Syntax that generates a Correlation Matrix

Art Kendall
if the 20 groups are mutually exclusive, you could first use something like
SPLIT FILE BY Groups.


Depending on the meaning of your grouping it might be interesting to explore
via an Individual Differences Multidimensional Scaling in SPSS.

This is often a way to explore a set of {correlation, similarity, proximity,
distance} matrices.



-----
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
Reply | Threaded
Open this post in threaded view
|

Re: SPSS Syntax that generates a Correlation Matrix

Jon Peck
In reply to this post by 3J LEMA
You haven't said what your purpose is, but if it an issue of displaying these correlations, you might want to format them further.  This extension command code will tidy up a correlation matrix computed by the CORRELATION procedure.  It can be run once with PROCESS=ALL if you have a batch of these to format.
This code hides the counts and the upper triangle and does other useful things.

SPSSINC MODIFY TABLES SUBTYPE='"'Correlations'"' SELECT=0 DIMENSION=ROWS PROCESS=PRECEDING
/styles customfunction=
"formatcorrmat.cleancorr(hidecounts=True, hidel=True, lowertri=True, hideinsig=1., emphlarge=.5, "+
    "boldsig=.05)".

On Sat, Jun 6, 2020 at 7:20 PM 3J LEMA <[hidden email]> wrote:
Appreciate if someone shall provide a syntax that generates correlation matrix that contains only the Pearson r and the flags (*, **, ***), similar below:

Pearson Correlation
  Y X1 X2 X3 X4 X5 X6
Y 1 .437** .460** .433** .457** .467** .483**
X1 .437** 1 .824** .755** .809** .839** .907**
X2 .460** .824** 1 .801** .859** .842** .929**
X3 .433** .755** .801** 1 .870** .787** .910**
X4 .457** .809** .859** .870** 1 .842** .943**
X5 .467** .839** .842** .787** .842** 1 .929**
X6 .483** .907** .929** .910** .943** .929** 1
**. Correlation is significant at the 0.01 level (2-tailed).

Manual use of the pivot is tedious because I need to generate a matrix per group for 20 groups.

Thank you for your help.

Lema
===================== 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