|
Sorry, this is what I tried to modify with not much luck
* seed, needed for reproducability.
set rng=mt mtindex= 20090120.
* sample data.
input program.
loop #i=1 to 2000.
compute ses = trunc(rv.uniform(0, 5)).
compute age = trunc(rv.uniform(18, 45)).
compute sex = trunc(rv.uniform(1, 2.9)).
compute blah = rv.normal(1, 100).
compute bloh = rnd(rv.normal(1, 52)).
compute casecontr = trunc(rv.uniform(0,1.9)).
end case.
end loop.
end file.
end input program.
value labels casecontr 0 'control' 1 'case'.
variable label blah 'mysterious outcome var #1' / bloh 'mysterious outcome
var #2'.
* actual code.
compute random = rv.uniform(0,1).
sort cases by casecontr sex age ses random.
aggr out = *
/ presorted
/ break = casecontr sex age ses
/ blah = first (blah) / bloh = first (bloh).
formats all (f5).
sort cases by sex age ses.
casestovars / id = sex age ses / index = casecontr.
begin program.
import spss
spss.Submit("sample 41 from %s." % spss.GetCaseCount())
end program.
exe.
--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Obtaining-a-matched-control-group-tp4271299p4271542.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.
=====================
To manage your subscription to SPSSX-L, send a message to
LISTSERV@LISTSERV.UGA.EDU (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
|