When you want to produce a random set of numbers - e.g.: randomly assigning cases to experimental treatments of group - one should set random number seed value if you want to get the same result.
Random generator is used by SAMPLE command to generate random samples and is used by several distribution functions (NORMAL, UNIFORM). Integer begins with SEED - large integer. At the start SEED is set to a value that may vary or may be fixed, depending on your current setting. The seed value changes each time a series of transformations contains one or more commands that use the random number generator.
To use the same random distribution within a session on in subsequent session, use SET SEED before each series of transformations that use the random number generator to explicitly set the seed value to a constant value.
[SPSS Syntax]
GET FILE = 'c:\file.sav'.
SET SEED = 123456789.
SAMPLE .1.
LIST.
SHOW SEED.
GET FILE = 'c:\file.sav'.
SET SEED = 123456789.
SAMPLE .1.
LIST.
[/SPSS Syntax]
Before the first sample is taken for the first time, the SET SEED is set. The LIST command causes data to be read and the generator number to be invoked once for each original case.
Friday 9 March 2007
Subscribe to:
Post Comments (Atom)
7 comments:
Do you have any advice on writing syntax in order to generate 2500 cases, with values ranging from 1 to 4 in spss?
I am a real novice with spss syntax so any advice you can offer would be greatly appreciated.
Thanks,
stace
jladyl@yahoo.com
stace,
Sure, no problem! you can contact me ilovespss -at- yahoo -dot- de.
normally generating 2500 cases is matter of loop function and generating cases from 1 to 4 is not a problem. You should only decide distribution of cases. SPSS by default uses NORM distribution so on 2500 cases you would have 1/4 of cases with value 1, 1/4 of 2, 1/4 of 3 and 1/4 of 4. which might be useless.
Thanks for such a great post and the review, I am totally impressed! Keep stuff like this coming.
Michael Jackson
Many women want Hardy clothing
. If you like vibrant fashion that is also edgy and sexy, you would certainly need to check out the ED Hardy Shoes
collection. Go for the sexy hardy shirt
and turn heads with your attitude and flamboyant style! Choose the beautiful ED Hardy Shoes
Looking forward to a master to answer this question!
View this article useful insights and support!
Have a look:
[b][url=http://www.newamytrade.com]Gucci shoes,cheap Gucci shoes,only 55USD[/url][/b]
If u want to order cheap
We offer the largest winter wear clothing collection in tht world for men, women and children, covering all forms of Overcoats, Jackets and Sweaters. Basic inner wear such as long johns in cotton, wool mix and accompanied by socks, shawls, gloves, shoes and even winter lip balm to ensure warm and complete fashionable winter attire. Combat the winter cold in warm style; our winter jackets and accessories are of top quality wool and leather, offered in various designs, texture and color.
We also carry a comprehensive selection of winter sports clothing and accessories from winter wear, underwear, sportwear, boots and caps to ski socks and sunglass. Hit the things in style.jerseys,cheap handbags,cheap winter coats,cheap shirts,cheap jewelry,
come here: [b][url=http://www.wearfoot.com]cheap oakley sunglasses, cheap tiffany jewelry, burberry ladies caots[/url][/b]
[url=http://www.handbags-zone.com]sell coach bags,buy designer handbags[/url]
Post a Comment