suppressing output (correlations)

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

suppressing output (correlations)

Handel, Richard W.

Hello,

 

I am looking to correlate a small number of variables (say, Variables A-E) with a much larger number of variables (say, Variables 1-50).  Is there a way for SPSS to either rank these correlations from highest to lowest point estimates or to suppress all correlations below a chosen value (similar to what can be done for factor loadings in SPSS Factor Analysis output)? 

 

 

Richard W. Handel, Ph.D.

Associate Professor

Department of Psychiatry and Behavioral Sciences

Eastern Virginia Medical School

825 Fairfax Avenue, Hofheimer Hall

Norfolk, VA 23507

Phone (757)-446-7992

 

Reply | Threaded
Open this post in threaded view
|

Re: suppressing output (correlations)

Ruben Geert van den Berg
Dear Mr. Handel,

There may be a Python extension to accomplish this but I'm not sure. Anyway, I'd use OMS to create a dataset with the correlations and then edit this dataset. See the syntax below.

HTH,

Ruben van den Berg

Methodologist

TNS NIPO

E: [hidden email]

P: +31 20 522 5738

I: www.tns-nipo.com


*Create fake data.

data list free/id.
begin data
1 2 3 4 5 6 7 8 9 10
end data.

dataset name d1.

compute #t=rv.uni(0,.5).
do repeat v=var_a var_b var_c var_d var_e.
compute v=rv.uni(0,.5)+#t.
end repeat.
do repeat v=v_1 to v_50.
compute v=rv.uni(0,.5)+#t.
end repeat.

*OMS command to track down the correlation matrix.

* OMS.
DATASET DECLARE cor.
OMS
 /SELECT TABLES
 /IF COMMANDS = ["Correlations"]
     SUBTYPES = ["Correlations"]
 /DESTINATION FORMAT = SAV NUMBERED = TableNumber_
  OUTFILE = cor
  VIEWER = NO
 /TAG = "cor".

correlations var_a to var_e with v_1 to v_50.

omsend tag=['cor'].
dataset activate cor.

*Throw away n and p values.

select if var2 eq 'Pearson Correlation'.
exe.
delete variables TableNumber_ to Label_ var2.

*Rank correlations (not ABSOLUTE correlations!).

rank v_1 to v_50.
format Rv_1 to Rv_50 (f1.0).

*Suppress all correlations not in ranges [-1, -.3] and [.3, 1] (replace with zeros).

recode v_1 to v_50 (.3 thr 1=cop)(-1 thr -.3=cop)(els=0).
exe.

*Reorder variables in correlation dataset.

define !reorder()
matc fil fil */keep var1
!do !lv=1 !to 50
!con ('v_',!lv,' ','Rv_',!lv,' ')
!doend
.
!enddefine.

set mpr on.
!reorder.
exe.








Date: Tue, 27 Apr 2010 12:57:33 -0400
From: [hidden email]
Subject: suppressing output (correlations)
To: [hidden email]

Hello,

 

I am looking to correlate a small number of variables (say, Variables A-E) with a much larger number of variables (say, Variables 1-50).  Is there a way for SPSS to either rank these correlations from highest to lowest point estimates or to suppress all correlations below a chosen value (similar to what can be done for factor loadings in SPSS Factor Analysis output)? 

 

 

Richard W. Handel, Ph.D.

Associate Professor

Department of Psychiatry and Behavioral Sciences

Eastern Virginia Medical School

825 Fairfax Avenue, Hofheimer Hall

Norfolk, VA 23507

Phone (757)-446-7992

 



Express yourself instantly with MSN Messenger! MSN Messenger
Reply | Threaded
Open this post in threaded view
|

Re: suppressing output (correlations)

Jon K Peck

Ok, here is a snippet from the talk I am giving on extension commands in May at the European Directions conference.

Suppose you have run CORRELATIONS.  Then the following command hides all the insignificant correlations.

SPSSINC CENSOR TABLES
CRITLABEL="Sig. (2-tailed)" TESTTYPE=">" CRITVALUE=.05
DIRECTION=COLUMN NEIGHBORS=-1
SUBTYPE="'Correlations'"
/OPTIONS HIDECRITFIELD SYMBOL=" ".

In my talk, I'll show other ways to use extension commands to improve the readability of a correlation matrix.

SPSSINC CENSOR TABLES can be downloaded from Developer Central (www.spss.com/devcentral) and requires the Python plugin in and at least V17.

This syntax finds rows labeled "Sig. (2-tailed)", tests whether the values are > .05, and if so, blanks the item one column above.  It also hides all the significance values (HIDECRITFIELD).

I originally developed this command for the purpose of blanking table cells with a small count, but it can be applied to many types of tables.

Regards,

Jon Peck
SPSS, an IBM Company
[hidden email]
312-651-3435



From: Ruben van den Berg <[hidden email]>
To: [hidden email]
Date: 04/27/2010 11:10 PM
Subject: Re: [SPSSX-L] suppressing output (correlations)
Sent by: "SPSSX(r) Discussion" <[hidden email]>





Dear Mr. Handel,

There may be a Python extension to accomplish this but I'm not sure. Anyway, I'd use OMS to create a dataset with the correlations and then edit this dataset. See the syntax below.

HTH,

Ruben van den Berg
Methodologist
TNS NIPO
E: ruben_van_den_berg@...
P: +31 20 522 5738
I: www.tns-nipo.com


*Create fake data.


data list free/id.
begin data
1 2 3 4 5 6 7 8 9 10
end data.

dataset name d1.

compute #t=rv.uni(0,.5).
do repeat v=var_a var_b var_c var_d var_e.
compute v=rv.uni(0,.5)+#t.
end repeat.
do repeat v=v_1 to v_50.
compute v=rv.uni(0,.5)+#t.
end repeat.

*OMS command to track down the correlation matrix.

* OMS.
DATASET DECLARE cor.
OMS
 /SELECT TABLES
 /IF COMMANDS = ["Correlations"]
     SUBTYPES = ["Correlations"]
 /DESTINATION FORMAT = SAV NUMBERED = TableNumber_
  OUTFILE = cor
  VIEWER = NO
 /TAG = "cor".

correlations var_a to var_e with v_1 to v_50.

omsend tag=['cor'].
dataset activate cor.

*Throw away n and p values.

select if var2 eq 'Pearson Correlation'.
exe.
delete variables TableNumber_ to Label_ var2.

*Rank correlations (not ABSOLUTE correlations!).

rank v_1 to v_50.
format Rv_1 to Rv_50 (f1.0).

*Suppress all correlations not in ranges [-1, -.3] and [.3, 1] (replace with zeros).

recode v_1 to v_50 (.3 thr 1=cop)(-1 thr -.3=cop)(els=0).
exe.

*Reorder variables in correlation dataset.

define !reorder()
matc fil fil */keep var1
!do !lv=1 !to 50
!con ('v_',!lv,' ','Rv_',!lv,' ')
!doend
.
!enddefine.

set mpr on.
!reorder.
exe.








Date: Tue, 27 Apr 2010 12:57:33 -0400
From: [hidden email]
Subject: suppressing output (correlations)
To: [hidden email]

Hello,
 
I am looking to correlate a small number of variables (say, Variables A-E) with a much larger number of variables (say, Variables 1-50).  Is there a way for SPSS to either rank these correlations from highest to lowest point estimates or to suppress all correlations below a chosen value (similar to what can be done for factor loadings in SPSS Factor Analysis output)?  
 
 
Richard W. Handel, Ph.D.
Associate Professor
Department of Psychiatry and Behavioral Sciences
Eastern Virginia Medical School
825 Fairfax Avenue, Hofheimer Hall
Norfolk, VA 23507
Phone (757)-446-7992
 



Express yourself instantly with MSN Messenger! MSN Messenger

Reply | Threaded
Open this post in threaded view
|

Re: suppressing output (correlations)

Albert-Jan Roskam
Hi Jon,
 
Not sure if I have asked this before, but is SPSSINC CENSOR TABLES also able to suppress values of arbitrary size but with little or no associated variation? Large cell sizes but small SDs imply that the values of the entire group are (more or less) exposed. It can be desirable to suppress such cells.
By the way, may I ask where the European Directions conference is held?

Regards,
Albert-Jan

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
All right, but apart from the sanitation, the medicine, education, wine, public order, irrigation, roads, a fresh water system, and public health, what have the Romans ever done for us?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

--- On Wed, 4/28/10, Jon K Peck <[hidden email]> wrote:

From: Jon K Peck <[hidden email]>
Subject: Re: [SPSSX-L] suppressing output (correlations)
To: [hidden email]
Date: Wednesday, April 28, 2010, 2:48 PM


Ok, here is a snippet from the talk I am giving on extension commands in May at the European Directions conference.

Suppose you have run CORRELATIONS.  Then the following command hides all the insignificant correlations.

SPSSINC CENSOR TABLES
CRITLABEL="Sig. (2-tailed)" TESTTYPE=">" CRITVALUE=.05
DIRECTION=COLUMN NEIGHBORS=-1
SUBTYPE="'Correlations'"
/OPTIONS HIDECRITFIELD SYMBOL=" ".

In my talk, I'll show other ways to use extension commands to improve the readability of a correlation matrix.

SPSSINC CENSOR TABLES can be downloaded from Developer Central (www.spss.com/devcentral) and requires the Python plugin in and at least V17.

This syntax finds rows labeled "Sig. (2-tailed)", tests whether the values are > .05, and if so, blanks the item one column above.  It also hides all the significance values (HIDECRITFIELD).

I originally developed this command for the purpose of blanking table cells with a small count, but it can be applied to many types of tables.

Regards,

Jon Peck
SPSS, an IBM Company
[hidden email]
312-651-3435



From: Ruben van den Berg <[hidden email]>
To: [hidden email]
Date: 04/27/2010 11:10 PM
Subject: Re: [SPSSX-L] suppressing output (correlations)
Sent by: "SPSSX(r) Discussion" <[hidden email]>





Dear Mr. Handel,

There may be a Python extension to accomplish this but I'm not sure. Anyway, I'd use OMS to create a dataset with the correlations and then edit this dataset. See the syntax below.

HTH,

Ruben van den Berg
Methodologist
TNS NIPO
E: ruben_van_den_berg@...
P: +31 20 522 5738
I: www.tns-nipo.com

*Create fake data.


data list free/id.
begin data
1 2 3 4 5 6 7 8 9 10
end data.

dataset name d1.

compute #t=rv.uni(0,.5).
do repeat v=var_a var_b var_c var_d var_e.
compute v=rv.uni(0,.5)+#t.
end repeat.
do repeat v=v_1 to v_50.
compute v=rv.uni(0,.5)+#t.
end repeat.

*OMS command to track down the correlation matrix.

* OMS.
DATASET DECLARE cor.
OMS
 /SELECT TABLES
 /IF COMMANDS = ["Correlations"]
     SUBTYPES = ["Correlations"]
 /DESTINATION FORMAT = SAV NUMBERED = TableNumber_
  OUTFILE = cor
  VIEWER = NO
 /TAG = "cor".

correlations var_a to var_e with v_1 to v_50.

omsend tag=['cor'].
dataset activate cor.

*Throw away n and p values.

select if var2 eq 'Pearson Correlation'.
exe.
delete variables TableNumber_ to Label_ var2.

*Rank correlations (not ABSOLUTE correlations!).

rank v_1 to v_50.
format Rv_1 to Rv_50 (f1.0).

*Suppress all correlations not in ranges [-1, -.3] and [.3, 1] (replace with zeros).

recode v_1 to v_50 (.3 thr 1=cop)(-1 thr -.3=cop)(els=0).
exe.

*Reorder variables in correlation dataset.

define !reorder()
matc fil fil */keep var1
!do !lv=1 !to 50
!con ('v_',!lv,' ','Rv_',!lv,' ')
!doend
.
!enddefine.

set mpr on.
!reorder.
exe.








Date: Tue, 27 Apr 2010 12:57:33 -0400
From: [hidden email]
Subject: suppressing output (correlations)
To: [hidden email]

Hello,
 
I am looking to correlate a small number of variables (say, Variables A-E) with a much larger number of variables (say, Variables 1-50).  Is there a way for SPSS to either rank these correlations from highest to lowest point estimates or to suppress all correlations below a chosen value (similar to what can be done for factor loadings in SPSS Factor Analysis output)?  
 
 
Richard W. Handel, Ph.D.
Associate Professor
Department of Psychiatry and Behavioral Sciences
Eastern Virginia Medical School
825 Fairfax Avenue, Hofheimer Hall
Norfolk, VA 23507
Phone (757)-446-7992
 


Express yourself instantly with MSN Messenger! MSN Messenger

Reply | Threaded
Open this post in threaded view
|

Re: suppressing output (correlations)

Jon K Peck

See below
Jon Peck
SPSS, an IBM Company
[hidden email]
312-651-3435



From: Albert-Jan Roskam <[hidden email]>
To: [hidden email], Jon K Peck/Chicago/IBM@IBMUS
Date: 04/28/2010 08:04 AM
Subject: Re: [SPSSX-L] suppressing output (correlations)





Hi Jon,
 
Not sure if I have asked this before, but is SPSSINC CENSOR TABLES also able to suppress values of arbitrary size but with little or no associated variation? Large cell sizes but small SDs imply that the values of the entire group are (more or less) exposed. It can be desirable to suppress such cells.
>>> CENSOR TABLES takes a single cell value as the criterion with your choice of comparison operator.  So if your table had the standard deviation or coefficient of variation in it, you could use that for censoring.  

By the way, may I ask where the European Directions conference is held?
>>> European Directions is May 17 - 18 in Rome.  Details are on www.spss.com.  It is being held this year in conjunction with the IBM Information on Demand conference which immediately follows.



Regards,
Albert-Jan

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
All right, but apart from the sanitation, the medicine, education, wine, public order, irrigation, roads, a fresh water system, and public health, what have the Romans ever done for us?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

--- On Wed, 4/28/10, Jon K Peck <[hidden email]> wrote:


From: Jon K Peck <[hidden email]>
Subject: Re: [SPSSX-L] suppressing output (correlations)
To: [hidden email]
Date: Wednesday, April 28, 2010, 2:48 PM


Ok, here is a snippet from the talk I am giving on extension commands in May at the European Directions conference.


Suppose you have run CORRELATIONS.  Then the following command hides all the insignificant correlations.


SPSSINC CENSOR TABLES

CRITLABEL="Sig. (2-tailed)" TESTTYPE=">" CRITVALUE=.05

DIRECTION=COLUMN NEIGHBORS=-1

SUBTYPE="'Correlations'"

/OPTIONS HIDECRITFIELD SYMBOL=" ".


In my talk, I'll show other ways to use extension commands to improve the readability of a correlation matrix.


SPSSINC CENSOR TABLES can be downloaded from Developer Central (
www.spss.com/devcentral) and requires the Python plugin in and at least V17.

This syntax finds rows labeled "Sig. (2-tailed)", tests whether the values are > .05, and if so, blanks the item one column above.  It also hides all the significance values (HIDECRITFIELD).


I originally developed this command for the purpose of blanking table cells with a small count, but it can be applied to many types of tables.


Regards,


Jon Peck
SPSS, an IBM Company
[hidden email]
312-651-3435



From: Ruben van den Berg <[hidden email]>
To: [hidden email]
Date: 04/27/2010 11:10 PM
Subject: Re: [SPSSX-L] suppressing output (correlations)
Sent by: "SPSSX(r) Discussion" <[hidden email]>






Dear Mr. Handel,


There may be a Python extension to accomplish this but I'm not sure. Anyway, I'd use OMS to create a dataset with the correlations and then edit this dataset. See the syntax below.


HTH,


Ruben van den Berg

Methodologist

TNS NIPO

E:
ruben_van_den_berg@...
P: +31 20 522 5738

I:
www.tns-nipo.com

*Create fake data.


data list free/id.

begin data

1 2 3 4 5 6 7 8 9 10

end data.


dataset name d1.


compute #t=rv.uni(0,.5).

do repeat v=var_a var_b var_c var_d var_e.

compute v=rv.uni(0,.5)+#t.

end repeat.

do repeat v=v_1 to v_50.

compute v=rv.uni(0,.5)+#t.

end repeat.


*OMS command to track down the correlation matrix.


* OMS.

DATASET DECLARE cor.

OMS

/SELECT TABLES

/IF COMMANDS = ["Correlations"]

    SUBTYPES = ["Correlations"]

/DESTINATION FORMAT = SAV NUMBERED = TableNumber_

 OUTFILE = cor

 VIEWER = NO

/TAG = "cor".


correlations var_a to var_e with v_1 to v_50.


omsend tag=['cor'].

dataset activate cor.


*Throw away n and p values.


select if var2 eq 'Pearson Correlation'.

exe.

delete variables TableNumber_ to Label_ var2.


*Rank correlations (not ABSOLUTE correlations!).


rank v_1 to v_50.

format Rv_1 to Rv_50 (f1.0).


*Suppress all correlations not in ranges [-1, -.3] and [.3, 1] (replace with zeros).


recode v_1 to v_50 (.3 thr 1=cop)(-1 thr -.3=cop)(els=0).

exe.


*Reorder variables in correlation dataset.


define !reorder()

matc fil fil */keep var1

!do !lv=1 !to 50

!con ('v_',!lv,' ','Rv_',!lv,' ')

!doend

.

!enddefine.


set mpr on.

!reorder.

exe.









Date: Tue, 27 Apr 2010 12:57:33 -0400
From: [hidden email]
Subject: suppressing output (correlations)
To: [hidden email]


Hello,

 
I am looking to correlate a small number of variables (say, Variables A-E) with a much larger number of variables (say, Variables 1-50).  Is there a way for SPSS to either rank these correlations from highest to lowest point estimates or to suppress all correlations below a chosen value (similar to what can be done for factor loadings in SPSS Factor Analysis output)?  

 
 
Richard W. Handel, Ph.D.

Associate Professor

Department of Psychiatry and Behavioral Sciences
Eastern Virginia Medical School

825 Fairfax Avenue
, Hofheimer Hall
Norfolk
, VA 23507
Phone (757)-446-7992

 


Express yourself instantly with MSN Messenger! MSN Messenger