AllenDowney/ThinkStats2

Exercise 9.2: Make null hypothesis model for resampling

Closed this issue · 0 comments

What is the difference in randomly choosing the data from pooled data
And
Reshuffling the pooled data and then dividing it into two groups ??

In the code provided as solution the pooled data is again randomly chosen, which makes the model similar to the previous one we did for the chapter 9.

resampling model:

def RunModel(self):
 
        group1 = np.random.choice(**self.pool**, self.n, replace=True)
        group2 = np.random.choice(**self.pool**, self.m, replace=True)
        return group1, group2

pooled null hypothesis model:

def RunModel(self):
  np.random.shuffle(self.pool)
  data = self.pool[:self.n], self.pool[self.n:]
return data

Can somebody please clarify ?