Date: Mon, 18 May 1998 20:10:33 -0500
Reply-To: "Matheson, David" <davidm@SPSS.COM>
Sender: "SPSSX(r) Discussion" <SPSSX-L@UGA.CC.UGA.EDU>
From: "Matheson, David" <davidm@SPSS.COM>
Subject: Re: matrix data
Annette,
I'm quite sure that the error message is due to the inconsistency
between the values in varname_ and your actual variable names.
>compute VARNAME_ = concat('ITEM',ltrim(string(item,f2))) .
When your variable names were called item1 to item57, the above
command placed values in varname_ that were consistent with the
variable names, i.e. the value in varname_ for case i was the same
as the variable name for column i of the proximity matrix. Switching
to the meaningful names in aggregate means that you need to
drop the above command for an alternate way to place those
names in varname_ for the corresponding rows. The following syntax,
which would follow the AGGREGATE command in your job below,
uses the flip command to transpose the data. The variable names
become values in a string variable called CASE_LBL and the original
data rows become variables with numbered names, i.e. var001 to var057.
We rename case_lbl to varname_ and match this column to qsmat.sav,
which had been saved with rowtype_ and the 57 proximity variables before
the transpose. We resave qsmat.sav after the merge, using the /keep
subcommand
to order the variables. qsmat.sav is then in the proper form for alscal
or cluster analysis.
Note that VARNAME_ was omitted from the STRING command. Note also that
the values
of CASE_LBL were automatically set to uppercase by the flip command.
Finally, note that
rowtype_ was not included in the list of variables to transpose by FLIP.
David Matheson
SPSS Technical Support
******************************************.
string ROWTYPE_ (A8).
COMPUTE ROWTYPE_ = 'PROX' .
save outfile = qsmat.sav
/keep = ROWTYPE_ blind to firefigh.
FLIP
VARIABLES=blind to firefigh .
rename variables (case_lbl = varname_).
match files /file = * /file = qsmat.sav / drop = var001 to var057.
execute.
* the execute forces the execution of the match, which save would also
do, but you may want
* to examine the avtive file before saving .
save outfile = qsmat.sav
/keep = ROWTYPE_ VARNAME_ blind to firefigh.
get file = qsmat.sav .
>----------
>From: Annette Towler[SMTP:towleraj@RUF.RICE.EDU]
>Sent: Monday, May 18, 1998 2:06 PM
>To: SPSSX-L@UGA.CC.UGA.EDU
>Subject: matrix data
>
>Hi people,
>
>Recently, David Matheson posted some very useful syntax to enable data to
>be entered as a proximity matrix for cluster and multidimensional scaling.
>I was able to enter the syntax when I labeled my variables item1 to item57,
>but when I used nominal labels, I got the following error from spss:
>
>>Error # 17228
>>The system file specified for input on the MATRIX subcommand does not
>>contain valid matrix information. Possible reason is that there are no
>>rows with ROWTYPE_ value of PROX or/and there are no rows with VARNAME_
>>values specified on the variable list.
>>This command not executed.
>
>Could someone take a quick look at my syntax and see what the problem is. I
>have been looking at it for several hours and have got nowhere. Thanks in
>advance:
>
>
>vector it = blind to firefigh.
>vector hit (57, F4).
>loop #j = 1 to 57.
>compute item = #j.
>loop #k =1 to 57.
>compute hit(#k) = (it(#j) = it(#k)).
>end loop.
>xsave outfile = hits.sav /keep = item hit1 to hit57.
>end loop.
>execute.
>get file = hits.sav .
>aggregate outfile = *
> /break = item
> /blind obese amputee depress epilepsy smoker blacks acne homeless deaf
> drugadd ugly rape cancer burn gay lesbian transsex mental suicidal nervous
>ms stutter birthmar bodyodor unkempt welfare unemploy alzheime sexoff aids
>caraccid schizo filmstar chess femaleen writer relief beauty ballet
>navyseal inventor models aristocr athletes scientis psychiat brainsur
>philosop philanth playwrig poets musicpro gymnasts physicis rockstar
>firefigh = sum(hit1 to hit57).
>
>string ROWTYPE_ VARNAME_ (A8).
>COMPUTE ROWTYPE_ = 'PROX' .
>compute VARNAME_ = concat('ITEM',ltrim(string(item,f2))) .
>save outfile = qsmat.sav
> /keep = ROWTYPE_ VARNAME_ blind to firefigh.
>get file = qsmat.sav .
>
>ALSCAL VARIABLES= blind to firefigh
> /SHAPE=SYMMETRIC
> /LEVEL=ORDINAL (SIMILAR)
> /CONDITION=MATRIX
> /MODEL=EUCLID
> /CRITERIA=CONVERGE(.001) STRESSMIN(.005) ITER(30)
> CUTOFF(0) DIMENS(2,2)
> /PLOT=DEFAULT
> /PRINT=DATA HEADER.
>
>
>
>
>Annette Towler
>Psychology Department
>Rice University
>466 Sewall Hall, MS 25
>6100 Main
>Houston, Texas 77005-1892
>
|