Randomization / allocation / 随机化分组
randomization_allocateRandomization / allocation / 随机化分组 | USE WHEN: produce a reproducible randomization list: simple, block, stratified, or minimization, with a fixed seed | ALIASES: 随机分组, 随机数字表, 区组随机, 分层随机, 最小化法, randomization, random allocation, 分组名单, seed | RETURNS: 分组结果表
Example tool call
This call uses example arguments supplied in the tool’s input schema.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"seed": 20261107,
"groups": [
"干预组",
"对照组"
],
"method": "block",
"block_size": 4,
"n_subjects": 60
},
"name": "randomization_allocate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| seed | No | 随机种子(固定才可复现) | |
| groups | Yes | 分组名称数组,如 ["干预组","对照组"](**必须是数组,不是数字**)。组数由数组长度决定;两组以上会按区组/分层规则分配。 | |
| method | No | simple 简单 / block 区组 / stratified 分层 / minimization 最小化 | |
| strata | No | 分层因素 {因素名: [各水平…]},仅 method=stratified 时使用,如 {"中心": ["A","B"], "分期": ["I","II"]}。 | |
| factors | No | 最小化法的预后因素及权重 {因素名: 权重},仅 method=minimization 时使用。 | |
| block_size | No | 区组长度(block 方法用) | |
| covariates | No | 基线协变量 {因素名: [各例取值…]},用于随机后自动做均衡性检验(返回 balance_report)。长度须等于 n_subjects。 | |
| n_subjects | Yes | 总样本量,如 60 | |
| n_per_stratum | No | 每个层内例数,仅 method=stratified 时使用;不传按 n_subjects/层数 均分。 | |
| covariate_types | No | 协变量类型 {因素名: "continuous"|"categorical"},配合 covariates 使用。 |