Hi Stata users,

Currently I found the bsample is not returning robust results after some seemingly innocuous manipulation of the dataset. For instance,

Code:
use mydata.dta,clear
set seed 123
sort gender
bsample
sum income
Code:
use mydata.dta,clear
set seed 123
bsample
sum income
I have tried the two versions of codes when I first launched stata. It turns out that the mean of income changes. I am confused by the observation: bsample doesn't seem to be robust even with some innocuous manipulation of the dataset.

Another seemingly innocuous manipulation is the order of specifying 'if'. For instance,

Code:
keep if gender ==1
bsample
Code:
bsample if gender ==1
I have tried the built-in command bsqreg. The estimated standard error also changes under the above manipulation. Is this a bug of Stata? Is there a way to get robust bsample results? Thanks!