Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Re: st: Sample question -- can't replicate my results from my laptop to desktop eventhough I set seed


From   Anna Gueorguieva <anna_i_g@yahoo.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Re: st: Sample question -- can't replicate my results from my laptop to desktop eventhough I set seed
Date   Thu, 22 Mar 2007 10:54:20 -0700 (PDT)

Dear Svend,
Thanks for your answer.

My problems are:
-the data was read in and then no further sorted. 
-don't have the original computer that I did the work on 

Here's the code for reading in:
insheet using "$lga\list of school_kaduna_with_construction.csv", clear

Any other ideas? 

Thank you all in advance.
Best,
Anna

Svend wrote
If the datasets on your two computers are sorted differently, different
observations may be sampled. Look at these results:
sysuse auto.dta, clear
set seed 12345
sort weight
sample 10, count
summarize price
sysuse auto.dta, clear
set seed 12345
sort displacement
sample 10, count
summarize price
Hope this helps

Anna wrote:
I drew a sample on my laptop using the following commands:
set seed  123456789
preserve
keep if iconst==1  /*sampling only construction sites*/
sample 30, count
I run my code on my desktop and I am getting different sites selected.
Any advice how to replicate it?


 
____________________________________________________________________________________
We won't tell. Get more on shows you hate to love 
(and love to hate): Yahoo! TV's Guilty Pleasures list.
http://tv.yahoo.com/collections/265 
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index