按 R 中选定的组随机化样本
在我的数据集中,90 个人(样本)必须每人玩两种类型的游戏,总共四种类型:X
、Y
、Z
和W
。我想在 R 中随机化每个人将玩哪些游戏以及游戏顺序,以便遵循以下方式:
UA | 第一场比赛 | 第二场比赛 |
---|---|---|
人员 1 | 游戏 X | 游戏 W |
人员 2 | 游戏 W | 游戏 Y |
人员 3 | 游戏 Z | 游戏W |
因此,每个游戏必须由相同数量的人玩(即,每场游戏 30 人),并且游戏 W
必须由每个人玩。在 R 中是否有一种简单的方法可以做到这一点?
In my dataset, 90 people (samples) must each play two types of game, of a total of four types: X
, Y
, Z
and W
. I would like to randomize in R which games each person will play, as well as the game order, so that it follows this way:
UA | First game | Second game |
---|---|---|
Person 1 | Game X | Game W |
Person 2 | Game W | Game Y |
Person 3 | Game Z | Game W |
Thus, each game must be played by the same number of people (i.e., 30 people per game), and game W
must be played by everyone. Is there a simple way to do this in R?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)