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 (October 2006)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Sun, 29 Oct 2006 15:16:54 -0600
Reply-To:     "Oliver, Richard" <roliver@spss.com>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         "Oliver, Richard" <roliver@spss.com>
Subject:      Re: Assigning subjects randomly to groups
Comments: To: John.Antonakis@unil.ch
Content-Type: text/plain; charset="iso-8859-1"

Let's go back to your original example, but instead of the scratch variable #I, we'llcreate a permanent variable ID which is set to the current value of the loop counter. As you can seen from the case listings, the first 10 cases are assigned to group 0, and the second ten case are assigned to group 1. There's nothing random about group assignment. In your example, variable X is completely random, but group assignment is not. In a real experiment, this would be like assigning the first 10 people who walked in the door to one group, and the next 10 people to the other group. That's not random. But since you've then randomly assigned test "results" based on nothing, it really doesn't make any difference. input program. loop ID=1 to 20. if (ID<=10) group=0. if (ID>10) group=1. compute x=normal(1). end case. end loop. end file. end input program. sort cases by ID. list. Case listing: ID group x 1.00 .00 .01 2.00 .00 -.88 3.00 .00 1.52 4.00 .00 -.27 5.00 .00 -.01 6.00 .00 1.36 7.00 .00 -.21 8.00 .00 -.32 9.00 .00 .70 10.00 .00 -.98 11.00 1.00 .00 12.00 1.00 1.06 13.00 1.00 -1.38 14.00 1.00 -.28 15.00 1.00 -.78 16.00 1.00 -.31 17.00 1.00 -1.14 18.00 1.00 1.15 19.00 1.00 1.35 20.00 1.00 -1.22

________________________________

From: SPSSX(r) Discussion on behalf of John Antonakis Sent: Sun 10/29/2006 2:12 PM To: SPSSX-L@LISTSERV.UGA.EDU Subject: Re: Assigning subjects randomly to groups

Dominic:

Thank you for taking the time to explain this to me. Unfortunately, I still don't get it (I am certainly misunderstanding or misexplaining something)! I realize that what I have done is a "restricted random assignment" of sorts. If it were really random then I would probably have unbalanced groups with such a small sample (hence I am forcing equal sample sizes).

I still don't see how your procedure is works. From the printout below, person 1 to 10 is assigned to group 0 and person 11 to 20 to group 1. Where is the random assignment?

x id group .01 1.00 .00 .19 2.00 .00 .19 3.00 .00 .24 4.00 .00 .27 5.00 .00 .38 6.00 .00 .48 7.00 .00 .54 8.00 .00 .58 9.00 .00 .60 10.00 .00 .66 11.00 1.00 .67 12.00 1.00 .67 13.00 1.00 .71 14.00 1.00 .84 15.00 1.00 .87 16.00 1.00 .93 17.00 1.00 .95 18.00 1.00 .98 19.00 1.00 .99 20.00 1.00

If I use the following code, will it make any difference to you (I am telling SPSS to include the case number--I did not do that before, but assumed row number to be case number--perhaps there is where I was not explicit)?

input program. loop #I=1 to 20. if (#I<=10) group=0. if (#I>10) group=1. compute x=normal(1). end case. end loop. end file. end input program. sort cases by x. compute id=$casenum. print table/ $casenum group. execute.

Could you give it one more shot?

Best, John.

----- Original Message ----- Expéditeur: "Dominic Lusinchi" <dominic@farwestresearch.com> à: "'John Antonakis'" <John.Antonakis@unil.ch>, <SPSSX-L@LISTSERV.UGA.EDU> Sujet: RE: Assigning subjects randomly to groups Date: Sun, 29 Oct 2006 08:57:57 -0800

> John, > > The goal, if I understand, is to assign 20 individuals to > either a control group (0) or a treatment group (1) with > 10 persons in each group. > > First, each individual is assigned a random number between > 0 and 1, based on the uniform distribution. Once these > numbers have been assigned, they are sorted here in > ascending order, and then the first ten numbers are > assigned to the control group while the last ten to the > treatment. > > You will agree, will you not, that each individual is as > likely to be in the control group as in the treatment by > virtue of the random number associated with that > individual? In other words, an individual is as likely to > be among the first ten as among the last ten. > > In you original code, if I'm correct, you assigned the > number 1 to 20 to the individuals, then you told the > program to put the first ten in the control group (0) and > the others in the treatment group (1). This is not a > random assignment. The fact that each individual is > assigned, after being placed in one of the two groups, a > random number does not make the group assignment random. > The random number should be assigned first, and then the > group assignment can be accomplished. > > Yes? > > Dominic > > -----Original Message----- > From: John Antonakis [mailto:John.Antonakis@unil.ch] > Sent: Sunday, October 29, 2006 1:29 AM > To: SPSSX-L@LISTSERV.UGA.EDU > Cc: Dominic Lusinchi > Subject: RE: Assigning subjects randomly to groups > > Hi Dominic: > > Thanks for the comments and the new code. Why precisely, > does the old code not assign randomly? It seems to me > that it generates random numbers, sorts the numbers, and > then assigns individuals to groups based on the random > numbers. For example, I get: > > Group x > .00 -1.46 > 1.00 -1.40 > .00 -1.16 > 1.00 -.51 > .00 -.46 > 1.00 -.35 > .00 -.10 > .00 .14 > 1.00 .34 > 1.00 .56 > .00 .68 > .00 .73 > .00 .76 > .00 .95 > 1.00 .97 > .00 1.03 > 1.00 1.18 > 1.00 1.40 > 1.00 1.42 > 1.00 2.05 > > So based on the above, person 1 is assigned to group 0, > person 2 to group 1, person 3 to group zero, and so > forth. > > Also, I don't see how your new code works. When I run it, > I get for example: > > x id group > .01 1.00 .00 > .19 2.00 .00 > .19 3.00 .00 > .24 4.00 .00 > .27 5.00 .00 > .38 6.00 .00 > .48 7.00 .00 > .54 8.00 .00 > .58 9.00 .00 > .60 10.00 .00 > .66 11.00 1.00 > .67 12.00 1.00 > .67 13.00 1.00 > .71 14.00 1.00 > .84 15.00 1.00 > .87 16.00 1.00 > .93 17.00 1.00 > .95 18.00 1.00 > .98 19.00 1.00 > .99 20.00 1.00 > > How does the above constitute random assignment? > > Best regards, > John. > > At 14:45 28.10.2006 -0700, Dominic Lusinchi wrote: > >John, > > > >Greg is right but your original syntax should read: > > > >input program. > >loop #I=1 to 20. > >if (#I LE 10) group=0. > >if (#I GT 10) group=1. > >compute x=normal(1). > >end case. > >end loop. > >end file. > >end input program. > >sort cases by x. > >print table/ $casenum group. > >execute. > > > >Richard is also correct in saying there's nothing > particularly random about >the way your syntax makes the > assignment. I think what you are looking for >is the > following: > > >input program. > >loop #I=1 to 20. > >compute x=uniform(1). > >end case. > >end loop. > >end file. > >end input program. > >formats x (F8.2). > >sort cases by x. > >compute id=$casenum . > >if (id LE 10) group=0. > >if (id GT 10) group=1. > >print table/ $casenum group. > >execute. > > > >Hope it makes sense. > > > >Cheers, > >Dominic > > > >Dominic Lusinchi > >Statistician > >Far West Research > >Statistical Consulting > >San Francisco, California > >415-664-3032 > >www.farwestresearch.com > >-----Original Message----- > >From: SPSSX(r) Discussion > [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of >John > Antonakis >Sent: Saturday, October 28, 2006 9:18 AM > >To: SPSSX-L@LISTSERV.UGA.EDU > >Subject: Assigning subjects randomly to groups > > > >Hi: > > > >I am executing the below program (from Shadish, Cook & > >Campbell's book) to assign 20 subjects randomly to an > >experimental and control group > > > >input program. > >loop #I=1 to 20. > >if (#I<10) group=0. > >if (#I>10) group=1. > >compute x=normal(1). > >end case. > >end loop. > >end file. > >end input program. > >sort cases by x. > >print table/ $casenum group. > >execute. > > > >When I run the program (in SPSS ver 14.0), it gives me a > >missing value for some of the members of the group. Any > >thoughts? > > > >Thanks, > >J. > > > >___________________________________ > > > >Prof. John Antonakis > >School of Management and Economics > >University of Lausanne > >Internef #527 > >CH-1015 Lausanne-Dorigny > >Switzerland > > > >Tel: ++41 (0)21 692-3438 > >Fax: ++41 (0)21 692-3305 > > > >http://www.hec.unil.ch/jantonakis > >___________________________________ > > ___________________________________ > > Prof. John Antonakis > School of Management and Economics > University of Lausanne > Internef #527 > CH-1015 Lausanne-Dorigny > Switzerland > > Tel: ++41 (0)21 692-3438 > Fax: ++41 (0)21 692-3305 > > http://www.hec.unil.ch/jantonakis > ___________________________________ > > >

___________________________________

Prof. John Antonakis School of Management and Economics University of Lausanne Internef #527 CH-1015 Lausanne-Dorigny Switzerland

Tel: ++41 (0)21 692-3438 Fax: ++41 (0)21 692-3305

http://www.hec.unil.ch/jantonakis ___________________________________


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