shifting the mean of an array for bootstrap hypothesis testing
I am trying to understand a textbook exercise I am doing. I have an array of data
force_b = array([0.172, 0.142, 0.037, 0.453, 0.355, 0.022, 0.502,
0.273, 0.72 ,0.582, 0.198, 0.198, 0.597, 0.516, 0.815, 0.402, 0.605, 0.711, 0.614, 0.468])
with the mean = 0.4191000000000001
I have another mean of 0.55
and I have to shift the data of the array above so that I get an array with the mean of 0.55
The solution in the exercise is
translated_force_b = force_b - np.mean(force_b) + 0.55
Basically, I take one value of force b subtract the mean of all force b values and then add the mean I am interested in? Rinse, repeat for the whole array?
I do not get the logic on how to get there. I want to understand why you go this way. Why adding the mean I am interested in to each value gets me to the overall mean I am interested in.
Please help me understand: Is that an approach I can use for all kind of mean shifts of arrays?
Topic mean bootstraping mean-shift
Category Data Science