Date: Wed, 19 Jan 2005 15:19:05 +0100
Reply-To: Pieter van Groenestijn <P.vanGroenestijn@MAW.RU.NL>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Pieter van Groenestijn <P.vanGroenestijn@MAW.RU.NL>
Subject: macro needed
Content-Type: text/plain; charset="us-ascii"; format=flowed
Dear list,
In the syntax below I first generate some data. After this the output of
the 'Estimates of Covariance Parameters' table is saved.
So far so good.
What I want SPSS to do is run the syntax several times (for example 100)
and write down the results of the mentioned table in a sav file.
I think using a macro would help. My question is how should this macro look
like?
My syntax is:
OMS
/select tables
/if commands = [ 'Mixed']
labels = ['Estimates of Covariance Parameters']
/DESTINATION FORMAT=sav
outfile = 'c:\temp\results.sav'.
input program
comp school =-1.
comp b0j=-1.
leave school b0j.
loop #j= 1 to 15.
comp school=#j.
comp b0j = rv.normal(8,3).
loop #i = 1 to 20.
comp student = #i.
comp x = rv.normal(20,4).
comp e0ij = rv.normal(0,2).
comp y = b0j + 2*x + e0ij.
end case.
end loop.
end loop.
end file.
end inp pro.
exe.
mixed y by school with x
/fixed x
/random intercept | subject(school) covtype(un)
/print solution g testcov
/method ml
/cri mxiter(200).
OMSEND.
Any help will be very welcome!
Pieter van Groenestijn