Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • bsample result not robust after innocuous data manipulation?

    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!

  • #2
    I woujld not characterize sorting and subsetting your data as innocuous when a random sample is to be drawn from it, as bootstrap does.

    I do not find it surprising at all that a random selection of observations from a dataset depends on the order of the observations within the dataset. Presumably it is picking integers between 1 and c(N) in order to choose observations, so if the observations are ordered differently and the sequence of random numbers is the same (as the set seed will ensure), then different observations will be chosen. How could it possibly be otherwise?

    I similarly do not find it surprising that excluding observations using the if clause produces a different selection than dropping observations from the dataset. I

    Comment


    • #3
      Is there a way to keep the result robust under these simple manipulation, conditional on the same dataset?

      Thanks!

      Comment

      Working...
      X