Dear all,
I'm writing some SPSS syntax for a colleague that should calculate some correlations but then replace nonsignificant correlations by 0 (or perhaps -99 or something) and write the end result to EXCEL. My syntax seems to work fine with one exception: the decimals are not visible in EXCEL so I have to manually alter the cell formats in order to see them. Is it possible to fix this in any way? If so, I guess it should have to do with either the FORMATS or the SAVE TRANSLATE command but I can't figure out what exactly.
TIA!
Ruben van den Berg
*Syntax with test data.
DATA LIST FREE/ID.
BEGIN DATA
1 2 3 4 5 6 7 8 9 10
END DATA.
DO REP VARS=VAR1 TO VAR15.
COMP VARS=RV.NOR(100,15).
END REP.
* OMS.
DATASET DECLARE Corr.
OMS
/SELECT TABLES
/IF COMMANDS = ["Correlations"]
SUBTYPES = ["Correlations"]
/DESTINATION FORMAT = SAV NUMBERED = TableNumber_
OUTFILE = Corr
/TAG = "Corr".
CORR VAR1 TO VAR10 WITH VAR11 TO VAR15.
OMSEND TAG=['Corr'].
DATAS ACT Corr.
COMP TempID=$Casenum.
SOR CAS by TempID (D).
DO REP Vars=VAR11 TO VAR15.
DO IF Var2='Pearson Correlation' AND LAG (VARS) >.25.
COMP VARS=0.
END IF.
END REP.
SOR CAS by TempID (A).
SEL IF Var2='Pearson Correlation' .
SAV TRA OUT 'C:\Documents and Settings\DELL\Bureaublad\Study_SPSS\Corrs.xls'
/TYP=XLS
/DRO TableNumber_ Command_ Subtype_ Label_ Var2 TempID
/FIE
/REP.
Express yourself instantly with MSN Messenger!
MSN Messenger