Computational_Statistics
Computational_Statistics copied to clipboard
Better sampling method?
Assingning articles/topics to students leaves the door to articles not being selected. Probably assigning students to articles/topics is a better way to uniformly distribute themes. Maybe creating a "most uniform" list of articles/topics and assigning students to an index of the list solves the problem.
If you can make a proposal, I'll take a look
Students <- c("Aldo", "Caio", "Danilo", "Eduardo",
"FelipeA", "FelipeC", "Fredson", "Gabriela",
"Isaque", "Tomás", "Wellington")
Methods <- c("RS", "IS", "GS", "MH")
set.seed(777)
each.method <- sample((c(1:length(Students)) %% length(Methods)) + 1)
res <- tibble::tibble(
student = Students,
method = Methods[each.method]
)
Here's my proposal:
- Change unholy seed.
- Create a sequential list of indexes, e.g, if there are four topics and eleven students the list is (1,2,3,4,1,2,3,4,1,2,3).
- Shuffle list and assign topics.
Every topic is guaranteed* to show up and topics are quite evenly distributed. The code remains basically the same.
* If, of course, there are more students than topics