Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: "bsample" and "set seed" together do not work!

From   Daniele Pacifico <>
Subject   st: "bsample" and "set seed" together do not work!
Date   Fri, 17 Sep 2010 12:04:33 +0000 (GMT)

Dear Stata users,

I am working with the command "bsample"  and I discovered that the command "set 
seed #" stops "bsample" from drawing different samples from my data.. Here is an 

___start example___
clear all
set obs 1000
drawnorm x
local r=6

forvalues i=1/`r'{
  su x
  set seed 1234567890

___end example___

I had this problem because I am writing an ado file that sets a seed when it 
runs.. However, I discovered that the seed I define within my ado file 

creates the problem I have shown you above (i.e. I cannot use bsample with the 
command defined in my ado file).. Do you have any advise about it? How can I 
"unset" the seed so as to allow it to vary randomly again with bsample?

Thanks in advance for any help.



*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index