Assign cases randomly to three groups

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Assign cases randomly to three groups

Muir Houston
Dear Listers,
 
I am trying to randomly assign cases to one of three groups - what I wish to do is test whether an ideal type classification of three 'types' does any better than randomly assigning cases to three groups when the types or groups responses to various survey items are compared
 
I had a look at the select if random procedure and the random number generator but neither seemed suitable
 
thanks
Muir
 
Muir Houston
Research Fellow
CRLL
Institute of Education
University of Stirling
FK9 4LA
01786-46-7615

--
The University of Stirling (a charity registered in Scotland, number
SCO11159) is a university established in Scotland by charter at Stirling,
FK9 4LA.  Privileged/Confidential Information may be contained in this
message.  If you are not the addressee indicated in this message (or
responsible for delivery of the message to such person), you may not
disclose, copy or deliver this message to anyone and any action taken or
omitted to be taken in reliance on it, is prohibited and may be unlawful.
In such case, you should destroy this message and kindly notify the sender
by reply email.  Please advise immediately if you or your employer do not
consent to Internet email for messages of this kind.

====================To manage your subscription to SPSSX-L, send a message to
[hidden email] (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
Reply | Threaded
Open this post in threaded view
|

Re: Assign cases randomly to three groups

Norton, John
Hi Muir,

One way to tackle this is by computing a variable with a uniform distribution of values 1, 2 and 3:

COMPUTE group = TRUNC(UNIFORM(3) + 1).

HTH,

John Norton
SPSS Inc.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Muir Houston
Sent: Wednesday, April 09, 2008 12:32 PM
To: [hidden email]
Subject: Assign cases randomly to three groups

Dear Listers,

I am trying to randomly assign cases to one of three groups - what I wish to do is test whether an ideal type classification of three 'types' does any better than randomly assigning cases to three groups when the types or groups responses to various survey items are compared

I had a look at the select if random procedure and the random number generator but neither seemed suitable

thanks
Muir

Muir Houston
Research Fellow
CRLL
Institute of Education
University of Stirling
FK9 4LA
01786-46-7615

--
The University of Stirling (a charity registered in Scotland, number
SCO11159) is a university established in Scotland by charter at Stirling,
FK9 4LA.  Privileged/Confidential Information may be contained in this
message.  If you are not the addressee indicated in this message (or
responsible for delivery of the message to such person), you may not
disclose, copy or deliver this message to anyone and any action taken or
omitted to be taken in reliance on it, is prohibited and may be unlawful.
In such case, you should destroy this message and kindly notify the sender
by reply email.  Please advise immediately if you or your employer do not
consent to Internet email for messages of this kind.

=======
To manage your subscription to SPSSX-L, send a message to
[hidden email] (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

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (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
Reply | Threaded
Open this post in threaded view
|

Re: Assign cases randomly to three groups

Art Kendall
In reply to this post by Muir Houston
try something like this untested syntax.

compute ranorder = uniform(1).
sort cases by ranorder.
compute newgroup= mod($casenum,3)+1.

Art Kendall
Social Research Consultants

Muir Houston wrote:

> Dear Listers,
>
> I am trying to randomly assign cases to one of three groups - what I wish to do is test whether an ideal type classification of three 'types' does any better than randomly assigning cases to three groups when the types or groups responses to various survey items are compared
>
> I had a look at the select if random procedure and the random number generator but neither seemed suitable
>
> thanks
> Muir
>
> Muir Houston
> Research Fellow
> CRLL
> Institute of Education
> University of Stirling
> FK9 4LA
> 01786-46-7615
>
>

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (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
Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|

Re: Assign cases randomly to three groups

Muir Houston
In reply to this post by Norton, John
works fine and very simple once you know how!
 
Muir Houston
Research Fellow
CRLL
Institute of Education
University of Stirling
FK9 4LA
01786-46-7615

________________________________

From: Norton, John [mailto:[hidden email]]
Sent: Wed 09/04/2008 18:50
To: Muir Houston; [hidden email]
Subject: RE: Assign cases randomly to three groups



Hi Muir,

One way to tackle this is by computing a variable with a uniform distribution of values 1, 2 and 3:

COMPUTE group = TRUNC(UNIFORM(3) + 1).

HTH,

John Norton
SPSS Inc.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Muir Houston
Sent: Wednesday, April 09, 2008 12:32 PM
To: [hidden email]
Subject: Assign cases randomly to three groups

Dear Listers,

I am trying to randomly assign cases to one of three groups - what I wish to do is test whether an ideal type classification of three 'types' does any better than randomly assigning cases to three groups when the types or groups responses to various survey items are compared

I had a look at the select if random procedure and the random number generator but neither seemed suitable

thanks
Muir

Muir Houston
Research Fellow
CRLL
Institute of Education
University of Stirling
FK9 4LA
01786-46-7615

--
The University of Stirling (a charity registered in Scotland, number
SCO11159) is a university established in Scotland by charter at Stirling,
FK9 4LA.  Privileged/Confidential Information may be contained in this
message.  If you are not the addressee indicated in this message (or
responsible for delivery of the message to such person), you may not
disclose, copy or deliver this message to anyone and any action taken or
omitted to be taken in reliance on it, is prohibited and may be unlawful.
In such case, you should destroy this message and kindly notify the sender
by reply email.  Please advise immediately if you or your employer do not
consent to Internet email for messages of this kind.

=======
To manage your subscription to SPSSX-L, send a message to
[hidden email] (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



--
The University of Stirling (a charity registered in Scotland, number
SCO11159) is a university established in Scotland by charter at Stirling,
FK9 4LA.  Privileged/Confidential Information may be contained in this
message.  If you are not the addressee indicated in this message (or
responsible for delivery of the message to such person), you may not
disclose, copy or deliver this message to anyone and any action taken or
omitted to be taken in reliance on it, is prohibited and may be unlawful.
In such case, you should destroy this message and kindly notify the sender
by reply email.  Please advise immediately if you or your employer do not
consent to Internet email for messages of this kind.

====================To manage your subscription to SPSSX-L, send a message to
[hidden email] (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
Reply | Threaded
Open this post in threaded view
|

Re: Assign cases randomly to three groups

Norton, John
In reply to this post by Art Kendall
I think Art's solution would be more useful than the one I suggested if/when sample sizes of equal N is required.  The solution I suggested does not guarantee equal group sizes (though it comes close); Art's does.

John Norton
SPSS Inc.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Art Kendall
Sent: Wednesday, April 09, 2008 12:56 PM
To: [hidden email]
Subject: Re: Assign cases randomly to three groups

try something like this untested syntax.

compute ranorder = uniform(1).
sort cases by ranorder.
compute newgroup= mod($casenum,3)+1.

Art Kendall
Social Research Consultants

Muir Houston wrote:

> Dear Listers,
>
> I am trying to randomly assign cases to one of three groups - what I wish to do is test whether an ideal type classification of three 'types' does any better than randomly assigning cases to three groups when the types or groups responses to various survey items are compared
>
> I had a look at the select if random procedure and the random number generator but neither seemed suitable
>
> thanks
> Muir
>
> Muir Houston
> Research Fellow
> CRLL
> Institute of Education
> University of Stirling
> FK9 4LA
> 01786-46-7615
>
>

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (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

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (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
Reply | Threaded
Open this post in threaded view
|

Re: Assign cases randomly to three groups

Art Kendall
In reply to this post by Art Kendall
Are you sure you did the frequencies on newgroup?

This syntax worked for me.


new file.
*generate random integers.
INPUT PROGRAM.
LOOP id=1 TO 30000.
COMPUTE  ranorder = uniform(1).
END CASE.
END LOOP.
END FILE.
END INPUT PROGRAM.


sort cases by ranorder.
compute newgroup= mod($casenum,3)+1.
frequencies vars = newgroup.


Art Kendall
Social Research Consultants


Muir Houston wrote:

> Hi Art,
> did not seem to work - it gave a frequency table which went from:
> 0.00358350109309 to 0.9975419952534  with a frequency of '1' for each
> of 641 cases
>
> the syntax from John Norton appears to do the job and splits the cases
> into 3 groups
>
> thanks
> Muir
>
> Muir Houston
> Research Fellow
> CRLL
> Institute of Education
> University of Stirling
> FK9 4LA
> 01786-46-7615
>
> ------------------------------------------------------------------------
> *From:* Art Kendall [mailto:[hidden email]]
> *Sent:* Wed 09/04/2008 18:55
> *To:* Muir Houston
> *Cc:* [hidden email]
> *Subject:* Re: Assign cases randomly to three groups
>
> try something like this untested syntax.
>
> compute ranorder = uniform(1).
> sort cases by ranorder.
> compute newgroup= mod($casenum,3)+1.
>
> Art Kendall
> Social Research Consultants
>
> Muir Houston wrote:
> > Dear Listers,
> >
> > I am trying to randomly assign cases to one of three groups - what I
> wish to do is test whether an ideal type classification of three
> 'types' does any better than randomly assigning cases to three groups
> when the types or groups responses to various survey items are compared
> >
> > I had a look at the select if random procedure and the random number
> generator but neither seemed suitable
> >
> > thanks
> > Muir
> >
> > Muir Houston
> > Research Fellow
> > CRLL
> > Institute of Education
> > University of Stirling
> > FK9 4LA
> > 01786-46-7615
> >
> >
>
> --
>
> The University of Stirling (a charity registered in Scotland, number
> SCO11159) is a university established in Scotland by charter at
> Stirling, FK9 4LA. Privileged/Confidential Information may be
> contained in this message. If you are not the addressee indicated in
> this message (or responsible for delivery of the message to such
> person), you may not disclose, copy or deliver this message to anyone
> and any action taken or omitted to be taken in reliance on it, is
> prohibited and may be unlawful. In such case, you should destroy this
> message and kindly notify the sender by reply email. Please advise
> immediately if you or your employer do not consent to Internet email
> for messages of this kind.
>

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (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
Art Kendall
Social Research Consultants