Bruce Perfect. Mille fois merci. John GET FILE="H:\F drive backup\Research1a\4 Surveys\Quality of Life\QLGB1971-75\QL3\districtuk.sav". DATASET NAME raw. * OMS. DATASET DECLARE varinfo. OMS /SELECT TABLES /TAG = "varinfo" /IF COMMANDS=['Sysfile Info'] SUBTYPES=['Variable Information'] /DESTINATION FORMAT=SAV NUMBERED=TableNumber_ OUTFILE='varinfo' VIEWER=YES. SYSFILE INFO raw. OMSEND TAG = "varinfo". DATASET ACTIVATE varinfo. DELETE VARIABLES TableNumber_ TO Subtype_ Position MeasurementLevel TO MissingValues. * Change Var1 to A8 and rename it to VARNAME_ to make it match name & format in the next file. ALTER TYPE Var1 (A8). RENAME VARIABLES (Var1 Label = VARNAME_ varlabel). DATASET ACTIVATE raw. DATASET DECLARE corrmat. CORRELATIONS var235 TO var250 /MATRIX = OUT("corrmat"). DATASET ACTIVATE corrmat. SELECT IF ROWTYPE_ EQ "CORR" AND VARNAME_ NE "var250". EXECUTE. MATCH FILES FILE = "varinfo" /FILE= "corrmat" /BY VARNAME_. EXECUTE. DATASET NAME merged. DATASET CLOSE varinfo. DATASET CLOSE corrmat. DATASET ACTIVATE merged. SELECT IF ROWTYPE_ EQ "CORR". COMPUTE absr = ABS(var250). SORT CASES by absr(D). VARIABLE LABELS varlabel "Variable". FORMATS var250 (F8.4). SUMMARIZE /TABLES=varlabel var250 /FORMAT=LIST NOCASENUM /TITLE='Correlations with District' /MISSING=VARIABLE /CELLS=NONE.
From: Bruce Weaver <[hidden email]> Here's a souped up version of what I posted previously, John. It uses SYSFILE INFO in conjunction with OMS to grab the variable labels for use in the final table of (sorted) correlations. NPR as I like to say. I.e., No Python Required.* I did not take time to comment extensively, but hope things are relatively clear nevertheless! * Jon P will never agree with me on this, but I really dislike the way IBM has gone to implementing so much new functionality via Python and R programmability rather than fixing and adding native SPSS commands. Cheers, Bruce On Wed, Jul 22, 2020 at 4:31 AM <[hidden email]> wrote:
Bruce Weaver |
Free forum by Nabble | Edit this page |