* Hello, SPSS friends. * I've got a question on correlations output. * Let's say these are the data. DATA LIST FREE (" ")/v1 v2 v3. BEGIN DATA 1 2 3 2 1 1 3 1 3 2 3 2 END DATA. * Default correlations are calculated. CORRELATIONS /VARIABLES=v1 v2 v3 /PRINT=TWOTAIL NOSIG /MISSING=PAIRWISE . * Question 1: How can I suppress rows "significance" and "N"? (SPSS 15). * Question 2: Is it possible to suppress columns "v2" and "v3" as well - if I'm interested in but the first variables' correlations?. * Thanks for any help. * Mario.
Mario Giesel
Munich, Germany |
Hi Mario:
Regarding question 1, significance and N are part of the output, and can't be suppressed, unless you save the correlation matrix as a dataset, delete the unwanted rows and print it again. Workaround: You can use FACTOR to print a correlation matrix without N or Sigs: FACTOR /VARIABLES v1 v2 v3 /MISSING LISTWISE /ANALYSIS v1 v2 v3 /PRINT CORRELATION /ROTATION NOROTATE /METHOD=CORRELATION . Question 2 I don't understand clearly, but, assuming you only want the correlation of V1 with V2, and V1 with V3, but not the correlation between V2&V3, this modification of the correlation command will do it: CORRELATIONS /VARIABLES=v2 v3 WITH v1 /PRINT=TWOTAIL NOSIG /MISSING=PAIRWISE . Unfortunately, both solutions can't be combined (you can either have the correlation matrix without N&Sigs, or the non square table, with some correlation coefficients suppressed, but not both). HTH, Marta GG El 16/05/2012 11:53, Mario Giesel escribió:
|
Thanks Marta, you understood correctly. I tried the factor workaround and this is a good solution for casual purposes. I can delete columns manually after that. Thanks for that. However - addressed to the other list users - for automated reports a compact display of correlations v2 v3 WITH v1 would be desirable. Maybe MATRIX can help somehow? Thanks, Mario Von: Marta García-Granero <[hidden email]> An: [hidden email] Gesendet: 12:49 Mittwoch, 16.Mai 2012 Betreff: Re: Print correlations only?
Hi Mario:
Regarding question 1, significance and N are part of the output, and can't be suppressed, unless you save the correlation matrix as a dataset, delete the unwanted rows and print it again. Workaround: You can use FACTOR to print a correlation matrix without N or Sigs: FACTOR /VARIABLES v1 v2 v3 /MISSING LISTWISE /ANALYSIS v1 v2 v3 /PRINT CORRELATION /ROTATION NOROTATE /METHOD=CORRELATION . Question 2 I don't understand clearly, but, assuming you only want the correlation of V1 with V2, and V1 with V3, but not the correlation between V2&V3, this modification of the correlation command will do it: CORRELATIONS /VARIABLES=v2 v3 WITH v1 /PRINT=TWOTAIL NOSIG /MISSING=PAIRWISE . Unfortunately, both solutions can't be combined (you can either have the correlation matrix without N&Sigs, or the non square table, with some correlation coefficients suppressed, but not both). HTH, Marta GG El 16/05/2012 11:53, Mario Giesel escribió:
Mario Giesel
Munich, Germany |
In reply to this post by Mario Giesel
There is no way to suppress the N and sig
rows in CORRELATIONS. There is a custom dialog, Format Correlation
Matrix, that can do this and much more, but it will not work with old versions
of SPSS. However, you could write a script or autoscript in SaxBasic
to do these tasks.
Regards, Jon Peck (no "h") aka Kim Senior Software Engineer, IBM [hidden email] new phone: 720-342-5621 From: Mario Giesel <[hidden email]> To: [hidden email] Date: 05/16/2012 03:57 AM Subject: [SPSSX-L] Print correlations only? Sent by: "SPSSX(r) Discussion" <[hidden email]> * Hello, SPSS friends. * I've got a question on correlations output. * Let's say these are the data. DATA LIST FREE (" ")/v1 v2 v3. BEGIN DATA 1 2 3 2 1 1 3 1 3 2 3 2 END DATA. * Default correlations are calculated. CORRELATIONS /VARIABLES=v1 v2 v3 /PRINT=TWOTAIL NOSIG /MISSING=PAIRWISE . * Question 1: How can I suppress rows "significance" and "N"? (SPSS 15). * Question 2: Is it possible to suppress columns "v2" and "v3" as well - if I'm interested in but the first variables' correlations?. * Thanks for any help. * Mario. |
In reply to this post by Mario Giesel
Hi Mario, Perhaps this workaround: DATA LIST FREE (" ")/v1 v2 v3. BEGIN DATA 1 2 3 2 1 1 3 1 3 2 3 2 END DATA. CORRELATIONS /VARIABLES=v1 v2 v3 /matrix = out( *). select if (rowtype_ = 'CORR'). list cases /var = varname_ v1. HTH, Gerard van Meurs Van: SPSSX(r) Discussion [mailto:[hidden email]] Namens Mario Giesel Thanks Marta, you understood correctly. I tried the factor workaround and this is a good solution for casual purposes. I can delete columns manually after that. Thanks for that. However - addressed to the other list users - for automated reports a compact display of correlations v2 v3 WITH v1 would be desirable. Maybe MATRIX can help somehow? Thanks, Mario Von: Marta García-Granero <[hidden email]> Hi Mario: * Hello, SPSS friends. * Mario. |
Administrator
|
In reply to this post by Mario Giesel
You can also get the correlations via RELIABILITY. E.g.,
RELIABILITY /VARIABLES=v1 v2 v3 /SCALE('ALL VARIABLES') ALL /STATISTICS=CORR. This gives the complete 3x3 matrix, so you'll have to delete the last two columns to get what you want. HTH.
--
Bruce Weaver bweaver@lakeheadu.ca http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." PLEASE NOTE THE FOLLOWING: 1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above. 2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/). |
Administrator
|
Another way:
REGRESSION /STATISTICS ZPP /DEPENDENT v1 /METHOD=ENTER v2 v3. The two correlations you want are in the zero-order column.
--
Bruce Weaver bweaver@lakeheadu.ca http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." PLEASE NOTE THE FOLLOWING: 1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above. 2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/). |
In reply to this post by Mario Giesel
El 16/05/2012 14:41, Mario Giesel escribió:
You can work it from here: MATRIX. GET data /VAR=v1 v2 v3 /NAMES=vnames. COMPUTE k=NCOL(data). COMPUTE n=NROW(data). COMPUTE datadev=data - MAKE(n,n,1)*data/n. COMPUTE CovMat=T(datadev)*datadev/(n-1). COMPUTE rtdiagS=SQRT(DIAG(CovMat)). COMPUTE rtD=MDIAG(rtdiagS). COMPUTE invrtD=INV(rtD). COMPUTE CorrMat=invrtD*CovMat*invrtD. PRINT CorrMat. END MATRIX. You can modify it to select the columns you want to print. HTH, Marta
|
Administrator
|
In reply to this post by Marta Garcia-Granero
Either CORR using WITH then script Statistics into the layer.
or FACTOR. or MATRIX. GET X / VAR v1 TO v3/ FILE */NAMES=LBL. COMPUTE CCP= SSCP(X)-T(CSUM(X))*CSUM(X)/NROW(X). COMPUTE D=GINV(MDIAG(SQRT(DIAG(CCP)))). COMPUTE R=D*CCP*D. COMPUTE X1=LBL(1). PRINT R(:,1)/RNAMES=LBL/CNAMES=X1. END MATRIX.
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
Thanks to Marta, Jon, Gerard, Bruce and David for your work and comments! I'm curious to explore the MATRIX solutions a bit more so that I can understand what's being done there. They work fine, however. I also like Gerards pretty solution. For quick views I'm probably going to work with this FACTOR approach: DEFINE !cor(!POS !CMDEND) FACTOR /VARIABLES !1 /ANALYSIS !1 /PRINT CORRELATION /ROTATION NOROTATE. !ENDDEFINE. !cor v1 v2 v3. Best wishes, Mario Von: David Marso <[hidden email]> An: [hidden email] Gesendet: 18:48 Mittwoch, 16.Mai 2012 Betreff: Re: Print correlations only? Either CORR using WITH then script Statistics into the layer. or FACTOR. or MATRIX. GET X / VAR v1 TO v3/ FILE */NAMES=LBL. COMPUTE CCP= SSCP(X)-T(CSUM(X))*CSUM(X)/NROW(X). COMPUTE D=GINV(MDIAG(SQRT(DIAG(CCP)))). COMPUTE R=D*CCP*D. COMPUTE X1=LBL(1). PRINT R(:,1)/RNAMES=LBL/CNAMES=X1. END MATRIX. -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Print-correlations-only-tp5710657p5710997.html Sent from the SPSSX Discussion mailing list archive at 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
Mario Giesel
Munich, Germany |
You could clean the output up a little
by wrapping the FACTOR command in this.
oms /exceptif subtypes = ['Correlation Matrix'] /destination viewer=no. FACTOR ... omsend. Jon Peck (no "h") aka Kim Senior Software Engineer, IBM [hidden email] new phone: 720-342-5621 From: Mario Giesel <[hidden email]> To: [hidden email] Date: 05/17/2012 10:50 AM Subject: Re: [SPSSX-L] Print correlations only? Sent by: "SPSSX(r) Discussion" <[hidden email]> Thanks to Marta, Jon, Gerard, Bruce and David for your work and comments! I'm curious to explore the MATRIX solutions a bit more so that I can understand what's being done there. They work fine, however. I also like Gerards pretty solution. For quick views I'm probably going to work with this FACTOR approach: DEFINE !cor(!POS !CMDEND) FACTOR /VARIABLES !1 /ANALYSIS !1 /PRINT CORRELATION /ROTATION NOROTATE. !ENDDEFINE. !cor v1 v2 v3. Best wishes, Mario Von: David Marso <[hidden email]> An: [hidden email] Gesendet: 18:48 Mittwoch, 16.Mai 2012 Betreff: Re: Print correlations only? Either CORR using WITH then script Statistics into the layer. or FACTOR. or MATRIX. GET X / VAR v1 TO v3/ FILE */NAMES=LBL. COMPUTE CCP= SSCP(X)-T(CSUM(X))*CSUM(X)/NROW(X). COMPUTE D=GINV(MDIAG(SQRT(DIAG(CCP)))). COMPUTE R=D*CCP*D. COMPUTE X1=LBL(1). PRINT R(:,1)/RNAMES=LBL/CNAMES=X1. END MATRIX. -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Print-correlations-only-tp5710657p5710997.html Sent from the SPSSX Discussion mailing list archive at Nabble.com. ===================== To manage your subscription to SPSSX-L, send a message to LISTSERV@... (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 |
Great, Jon! I never was aware of that OMS command. Pretty method to suppress viewer output. Thanks, Mario Von: Jon K Peck <[hidden email]> An: Mario Giesel <[hidden email]> CC: [hidden email] Gesendet: 18:59 Donnerstag, 17.Mai 2012 Betreff: Re: [SPSSX-L] Print correlations only? You could clean the output up a little
by wrapping the FACTOR command in this.
oms /exceptif subtypes = ['Correlation Matrix'] /destination viewer=no. FACTOR ... omsend. Jon Peck (no "h") aka Kim Senior Software Engineer, IBM [hidden email] new phone: 720-342-5621 From: Mario Giesel <[hidden email]> To: [hidden email] Date: 05/17/2012 10:50 AM Subject: Re: [SPSSX-L] Print correlations only? Sent by: "SPSSX(r) Discussion" <[hidden email]> Thanks to Marta, Jon, Gerard, Bruce and David for your work and comments! I'm curious to explore the MATRIX solutions a bit more so that I can understand what's being done there. They work fine, however. I also like Gerards pretty solution. For quick views I'm probably going to work with this FACTOR approach: DEFINE !cor(!POS !CMDEND) FACTOR /VARIABLES !1 /ANALYSIS !1 /PRINT CORRELATION /ROTATION NOROTATE. !ENDDEFINE. !cor v1 v2 v3. Best wishes, Mario Von: David Marso <[hidden email]> An: [hidden email] Gesendet: 18:48 Mittwoch, 16.Mai 2012 Betreff: Re: Print correlations only? Either CORR using WITH then script Statistics into the layer. or FACTOR. or MATRIX. GET X / VAR v1 TO v3/ FILE */NAMES=LBL. COMPUTE CCP= SSCP(X)-T(CSUM(X))*CSUM(X)/NROW(X). COMPUTE D=GINV(MDIAG(SQRT(DIAG(CCP)))). COMPUTE R=D*CCP*D. COMPUTE X1=LBL(1). PRINT R(:,1)/RNAMES=LBL/CNAMES=X1. END MATRIX. -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Print-correlations-only-tp5710657p5710997.html Sent from the SPSSX Discussion mailing list archive at 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
Mario Giesel
Munich, Germany |
Free forum by Nabble | Edit this page |