LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (March 2011)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 30 Mar 2011 07:05:49 -0700
Reply-To:     Ivana <>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         Ivana <>
Subject:      Re: Obtaining a matched control group
In-Reply-To:  <>
Content-Type: text/plain; charset=us-ascii

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: Sent from the SPSSX Discussion mailing list archive at

===================== 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

Back to: Top of message | Previous page | Main SPSSX-L page