Does anyone know of a macro or something so that I don't have to create
32 save outfile statements followed by an add cases?
Bill Feuer
Biostatistics/Ophthalmology
U Miami Medical School
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
**** Begin example.
data list free /id (a) v1 v2 v3.
begin data.
a 1 2 3
b 4 5 6
c 7 8 9
end data.
vector v=v1 to v3.
loop #i=1 to 3.
comp var=v(#i).
xsave
/out="c:\work\test.sav"
/keep=id var.
end loop.
execute.
get file="c:\work\test.sav".
list cases.
**** End example.
produces this result:
ID VAR
a 1,00
a 2,00
a 3,00
b 4,00
b 5,00
b 6,00
c 7,00
c 8,00
c 9,00
Number of cases read: 9 Number of cases listed: 9
TZS
wfeuer...@my-deja.com schrieb in Nachricht
<7s5og8$nr0$1...@nnrp1.deja.com>...
I did it with something like
new file .
input program .
loop #x1=1 to 13 .
loop #x2=1 to 2 .
loop #x3=0 to 48 .
comp alter1=#x1.
comp ort1 = #x2.
compute subgr =10*#x1 +#x2.
do repeat nr=1 to 7
/zi =
motScore,perScore,komScore,intScore,schScore,hauScore,totScore.
compute zi=#x3 .
if (nr=7 )zi=zi*6.
end repeat.
end case .
end loop .
end loop .
end loop .
end file .
end input program .
MATCH FILES /TABLE='DELPHIGEGLÄTTET.SAV'
/FILE=*
/BY subgr.
to create a file with about 1200 cases with a certain substructure
and datasequence - could be random-variables as well
and then MATCH my original file with the appropriate substructure
of only 26, which where reproduced many times .
Seems to be a quite general solution -
thinks
Gottfried.
--
-------------------------------------------------------------
Gottfried Helms Soz.Päd./Soz.Arb.
Institute for Applied Social Gerontology at University
D-34109 Kassel Moenchebergstr. 19 B
----------------------------------------------------------------
email: mailto:he...@hrz.uni-kassel.de
www: http://www.uni-kassel.de/~helms
================================================================
VECTOR VARS=V1 to V32 .
LOOP NUM=1 to 32 .
COMPUTE NewVar = VARS(NUM) .
XSAVE OUTFILE "TMP" / KEEP ID NUM NEWVAR .
END LOOP.
EXECUTE.
GET FILE "TMP" .
Thats all, Neila
Gottfried Helms wrote in message <3814A6...@hrz.uni-kassel.de>...