Using randsample to randomize rows
2 views (last 30 days)
I have 36 households. I want to study combinations of households. PR represents how many households that are combined. To make other calculations
feasible, I sample the data using randsample. However, when I increase PR to 9 or more, the number of combinations become to great for me to sample like this. Can I integrate the sampling with nchoosek somehow, or is there another way?
nHousehold =36;9 or
PR=7 ; %Number of Households that are to be selected
Hcombos=nchoosek(1:nHousehold,PR); %Number of combinations
y = randsample(length(Hcombos(:,1)),2);