Generate all possible group scores based on combinations of individuals
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I want to compare actual group scores to hypothetical scores cosnidering all possible combinations of individuals.
I'd like to plot out the actual group scores to that of all possible combinations (i.e., Actual scores for groups vs possible scores of nCr groups) for each item.
Is there a function to generate possible groupings and plot their scores?
Thank you!
5 commentaires
David Goodmanson
le 15 Juin 2022
Hi Jeff,
good point, I had not considered group ID so either you would or would not have a factor of factorial(20).
Réponse acceptée
Jeff Miller
le 16 Juin 2022
Morgan, my point was that "all possible ways" is just too many in this case. By my calculations, if your computer could process one million different group assignments per second, it would still take about 3*(10^52) years to process all of the possible combinations.
A more practical approach is to generate many random group assignments and compare the plots for your actual data again what would happen with random divisions into groups. The code might look something like this:
nIterations = 100; % Increase to a very large number.
GroupAssignment = repmat(1:20,1,3); % 3 members in each of 20 groups.
for iIter=1:nIterations
RandomAssignment = randperm(60);
currentGroup = GroupAssignment(RandomAssignment);
% Now currentGroup(j) is the random group assignment of score j, j=1..60
% Do whatever computation you want for this random assignment of scores to groups,
% and save the result of that computation so that you can see what happens
% over many random groups.
end
% Now tabulate the results across all the random group assignments.
% You haven't looked at all of the possible ones, but if nIterations is
% large then you have probably looked at enough to get a good idea of what
% might happen by chance with other group assignments.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Logical dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!