random group sampling

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

random group sampling

ami
I have 96 respondens. I want to devide them into 3 groups, each group will get different treatment. if I give number 1 - 96 each responden, can I randomised them, so I can get 32 each group, and each responden will be in each group randomly? How I can perform this by using SPSS for windows?
Thank you for your help.
Reply | Threaded
Open this post in threaded view
|

Re: random group sampling

Spousta Jan
Run the following syntax from a Syntax window (Run -> All) ; suppose you have opened a datafile with 96 rows:

COMPUTE aux_id = $casenum                                     /*to be able to restore the original order of rows*/.
COMPUTE random_number = uniform(1) .
SORT CASES BY random_number (A) .
compute random_number = $casenum                           /*to convert the random numbers from <0,1> into 1, 2, 3..., N */.
compute random_group = mod(random_number, 3) + 1    /* create 3 groups */.
SORT CASES BY aux_id (A)  .
formats random_group aux_id random_number (f6).
var lab random_group "Random group".

Results are in the variable random_group. Hope this helps

Jan


-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of yanfa tuasikal
Sent: Monday, October 15, 2007 8:04 AM
To: [hidden email]
Subject: random group sampling

I have 96 respondens. I want to devide them into 3 groups, each group will get different treatment. if I give number 1 - 96 each responden, can I randomised them, so I can get 32 each group, and each responden will be in each group randomly? How I can perform this by using SPSS for windows?
Thank you for your help.

View this message in context: http://www.nabble.com/random-group-sampling-tf4624635.html#a13207234
Sent from the SPSSX Discussion mailing list archive at Nabble.com.


>>> Error in line 4 of spssx-l.mailtpl: unknown formatting command <<<
 -> .................... <-




_____

Tato zpráva a všechny připojené soubory jsou důvěrné a určené výlučně adresátovi(-ům). Jestliže nejste oprávněným adresátem, je zakázáno jakékoliv zveřejňování, zprostředkování nebo jiné použití těchto informací. Jestliže jste tento mail dostali neoprávněně, prosím, uvědomte odesilatele a smažte zprávu i přiložené soubory. Odesilatel nezodpovídá za jakékoliv chyby nebo opomenutí způsobené tímto přenosem.

This message and any attached files are confidential and intended solely for the addressee(s). Any publication, transmission or other use of the information by a person or entity other than the intended addressee is prohibited. If you receive this in error please contact the sender and delete the message as well as all attached documents. The sender does not accept liability for any errors or omissions as a result of the transmission.

-.- --


>>> Error in line 4 of spssx-l.mailtpl: unknown formatting command <<<
 -> .................... <-

Reply | Threaded
Open this post in threaded view
|

Re: random group sampling

Paul Ginns-2
In reply to this post by ami
There might be SPSS syntax out there to do this, but a few other
alternatives spring to mind:

1) use http://www.random.org/integers/ to generate 96 random integers
with each value being between 1 and 3.
2) the SPSS add-on zumastat zumastat.com has a utility for random
assignment - from the website:

Random Assignment: ZumaStat provides a utility to generate a set of
random numbers for assigning cases to experimental conditions. For
example, you tell ZumaStat you have 30 cases and 3 experimental
conditions and it will generate random integers between 1 and 30 into
the three conditions. You will have numbered your cases from 1 to 30 and
then assign the case number to the condition that ZumaStat specifies.

Cheers,

Paul


Date:    Sun, 14 Oct 2007 23:04:08 -0700
From:    yanfa tuasikal <[hidden email]>
Subject: random group sampling

I have 96 respondens. I want to devide them into 3 groups, each group
will get different treatment. if I give number 1 - 96 each responden,
can I randomised them, so I can get 32 each group, and each responden
will be in each group randomly? How I can perform this by using SPSS for
windows?
Thank you for your help.
--
View this message in context:
http://www.nabble.com/random-group-sampling-tf4624635.html#a13207234
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
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: random group sampling

Raynald Levesque-2
Here is one method:

* Create a sample file for illustration purspoes.
INPUT PROGRAM.
LOOP id=1 TO 96 .
- END CASE.
END LOOP.
END FILE.
END INPUT PROGRAM.

* Do the job.
COMPUTE draw=UNIFORM(1).
SORT CASES BY draw.
RANK VARIABLES=draw /NTILES(3) INTO group .

Regards

--
Raynald Levesque
www.spsstools.net


On 10/16/07, Paul Ginns <[hidden email]> wrote:

>
> There might be SPSS syntax out there to do this, but a few other
> alternatives spring to mind:
>
> 1) use http://www.random.org/integers/ to generate 96 random integers
> with each value being between 1 and 3.
> 2) the SPSS add-on zumastat zumastat.com has a utility for random
> assignment - from the website:
>
> Random Assignment: ZumaStat provides a utility to generate a set of
> random numbers for assigning cases to experimental conditions. For
> example, you tell ZumaStat you have 30 cases and 3 experimental
> conditions and it will generate random integers between 1 and 30 into
> the three conditions. You will have numbered your cases from 1 to 30 and
> then assign the case number to the condition that ZumaStat specifies.
>
> Cheers,
>
> Paul
>
>
> Date:    Sun, 14 Oct 2007 23:04:08 -0700
> From:    yanfa tuasikal <[hidden email]>
> Subject: random group sampling
>
> I have 96 respondens. I want to devide them into 3 groups, each group
> will get different treatment. if I give number 1 - 96 each responden,
> can I randomised them, so I can get 32 each group, and each responden
> will be in each group randomly? How I can perform this by using SPSS for
> windows?
> Thank you for your help.
> --
> View this message in context:
> http://www.nabble.com/random-group-sampling-tf4624635.html#a13207234
> Sent from the SPSSX Discussion mailing list archive at Nabble.com.
>
> =====================
> 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: random group sampling

Frederic Villamayor Forcada
In reply to this post by ami
Try this syntax.

SET RNG=MT MTINDEX = 92211.
*The SET command is necessary in order to
 document the random assignment and to
 be able to reproduce it later
 The value can be any positive or negative value,
 including fractional values (expressed as decimals),
 or the keyword RANDOM.

INPUT PROGRAM.
- LOOP respondent = 1 TO 96.
-   END CASE.
- END LOOP.
- END FILE.
END INPUT PROGRAM.
FORMATS respondent (F3).
*This generates a file with 96 rows and the respondents identifiers.

COMPUTE aux = UNIFORM(1).
* Computes a uniformly distributed random number for each respondent.

EXECUTE.

RANK
  VARIABLES=aux  (A) /NTILES (3) INTO group /PRINT=NO
  /TIES=MEAN .
* Ranks the respondents in 3 groups accordong to the value of variable aux
  Each group will contain 32 respondents.

DELETE VARIABLES aux.
* To clean the file.

Greetings


Frederic


Frederic Villamayor, BS
Researcher/Study Manager
Biostatistics Unit
Juan de Sada, 32
08028 Barcelona
Tel    +34 935093236
Fax   +34 934112764
[hidden email]
http://www.ferrergrupo.com 

Este mensaje, y en su caso, cualquier fichero anexo al mismo, puede
contener información confidencial, siendo para uso exclusivo del
destinatario, quedando prohibida su divulgación, copia o distribución a
terceros sin la autorización expresa del remitente. Si Vd. ha recibido
este mensaje erróneamente, se ruega lo notifique al remitente y proceda a
su borrado. Gracias por su colaboración.

This message and its annexed files may contain confidential information
which is exclusively for the use of the addressee. It is strictly
forbidden to distribute copies to third parties without the explicit
permission of the sender. If you receive this message by mistake, please
notify it to the sender and make sure to delete it. Thank you for your
kind cooperation.




yanfa tuasikal <[hidden email]>
Enviado por: "SPSSX(r) Discussion" <[hidden email]>
15/10/2007 08:04
Por favor, responda a
yanfa tuasikal <[hidden email]>


Para
[hidden email]
cc

Asunto
[SPSSX-L] random group sampling






I have 96 respondens. I want to devide them into 3 groups, each group will
get different treatment. if I give number 1 - 96 each responden, can I
randomised them, so I can get 32 each group, and each responden will be in
each group randomly? How I can perform this by using SPSS for windows?
Thank you for your help.
--
View this message in context:
http://www.nabble.com/random-group-sampling-tf4624635.html#a13207234
Sent from the SPSSX Discussion mailing list archive at Nabble.com.


>>> Error in line 4 of spssx-l.mailtpl: unknown formatting command <<<
 -> .................... <-

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