I have 180×4 matrix that is sorted by two columns. There are 5 levels or variable A and 6 levels of variable B (30 groups total). Variables C and D are just responses. I would like to sample from each group with replacement. E.g. This would mean that if had a loop with 30 iterations, I would select a sample from each of the 30 groups. If I had 60 iterations, I would select 2 samples from each group.
MATLAB: How to select every nth number of trials and put them in a separate column
binningsample with replacement
Best Answer