[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CTSPY8FXEWA8CXN788F24R":3,"skill-same:01M7CTSPY8FXEWA8CXN788F24R":94},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":31,"install":32,"resources":45},"01M7CTSPY8FXEWA8CXN788F24R","model-calibration-curve",null,"Use when assessing how well a survival model's predicted probabilities agree with observed outcomes by fitting a Cox model and generating bootstrap calibration curves at one or more prediction horizons from a clinical CSV file. NOT for: nomogram construction, univariate Cox screening, ROC analysis, or decision-curve analysis.","mrsonord2240\u002Fopenscience-specialists","mrsonord2240","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F76487430?v=4","01M7CTEM40S43GSJZ9A3YCCXZK","Samuel Nord","01M7CTEM4K69JD1GBYNHVJ9ZP4",2,"MIT","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fmodel-calibration-curve\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: model-calibration-curve\ndescription: \"Use when assessing how well a survival model's predicted probabilities agree with observed outcomes by fitting a Cox model and generating bootstrap calibration curves at one or more prediction horizons from a clinical CSV file. NOT for: nomogram construction, univariate Cox screening, ROC analysis, or decision-curve analysis.\"\nlicense: MIT\nskill-author: AIPOCH\n---\n\n# Model Calibration Curve\n\n## When to Use\n\nUse this skill when you need to:\n- validate a survival model with bootstrap calibration curves;\n- compare predicted and observed survival probabilities at multiple horizons;\n- export calibration statistics together with a PDF visualization.\n\nTypical user requests:\n- \"Generate 1-, 2-, and 3-year calibration curves for this prognosis model.\"\n- \"Check whether the Cox model built from age, gender, and risk is well calibrated.\"\n- \"Export calibration statistics and a calibration PDF from this clinical cohort.\"\n\n## When Not to Use\n\nDo not use this skill for:\n- nomogram construction;\n- univariate or multivariable Cox feature screening;\n- ROC, calibration-free discrimination, or decision-curve analysis;\n- non-survival endpoints or multiclass classification tasks.\n\n## When to Read External Files\n\n| Situation | File to Read | Purpose |\n|-----------|--------------|---------|\n| Need algorithm details | `references\u002Falgorithm.md` | Statistical method and formulas |\n| Need to run analysis | `scripts\u002Fmain.R` | Get the complete command |\n| Encounter errors | `references\u002Ftroubleshooting.md` | Find solutions |\n| Need CLI examples | `references\u002Fcli-guide.md` | Parameter usage examples |\n\n## Input Validation\n\nThis skill accepts:\n\n- A clinical CSV file with sample IDs as row names, survival time, event indicator, and pre-selected prognostic features\n- Requests to assess calibration of a survival (Cox) model via bootstrap resampling at one or more prediction horizons\n\nIf the user's request does not involve survival model calibration from a clinical CSV file — for example, asking to construct a nomogram, screen Cox features, generate an ROC curve, analyze a decision curve, or work with non-survival outcomes — do not proceed with this workflow. Instead respond:\n\n> \"model-calibration-curve is designed to validate survival model calibration by generating bootstrap calibration curves from a clinical CSV file. Your request appears to be outside this scope. Please use a nomogram-construction skill for nomogram building, a roc-diagnostic-performance skill for ROC analysis, or a decision-curve-analysis skill for DCA.\"\n\n---\n\n## Prerequisites\n\nR packages required: `rms`, `qs`, `openxlsx`, `optparse`.\n\nInstall with:\n```r\ninstall.packages(c(\"rms\", \"qs\", \"openxlsx\", \"optparse\"), repos = \"https:\u002F\u002Fcloud.r-project.org\")\n```\n\nOr run the bootstrap installer:\n```bash\nRscript scripts\u002Finstall_dependencies.R\n```\n\n> Note: `--help` requires `optparse` to be loaded. If the package check fires before option parsing, install `optparse` first, then run `--help`. The root fix (deferring heavy package checks until after argument parsing) must be applied in `scripts\u002Fmain.R`.\n\n---\n\n## Usage\n\n```bash\nRscript scripts\u002Fmain.R \\\n  --data_file .\u002Fclinical_data.csv \\\n  --features age,stage,risk \\\n  --years 1,2,3 \\\n  --output_dir .\u002Foutput\u002F\n```\n\n---\n\n## Arguments\n\n| Short | Long | Type | Default | Description |\n|-------|------|------|---------|-------------|\n| `-d` | `--data_file` | character | **required** | Clinical CSV file with sample IDs as row names |\n| `-f` | `--features` | character | **required** | Comma-separated model features used in the Cox model |\n| `-t` | `--time_col` | character | `futime` | Survival time column |\n| `-e` | `--event_col` | character | `fustat` | Event indicator column using 0\u002F1 encoding |\n| `-y` | `--years` | character | `1,2,3` | Prediction horizons in the same units as `time_col` |\n| `-b` | `--bootstrap_reps` | integer | `1000` | Bootstrap replications for `rms::calibrate()` |\n| `-o` | `--output_dir` | character | `.\u002Foutput\u002F` | Output directory |\n|  | `--overwrite` | flag | `FALSE` | Allow writing into a non-empty output directory |\n| `-s` | `--seed` | integer | `42` | Random seed for reproducibility |\n| `-T` | `--timeout_seconds` | integer | `0` | Elapsed time limit in seconds; `0` disables timeout |\n|  | `--plot_width` | double | `6` | PDF width in inches |\n|  | `--plot_height` | double | `6` | PDF height in inches |\n|  | `--font_family` | character | `sans` | PDF font family |\n|  | `--line_width` | double | `1.5` | Calibration curve line width |\n|  | `--colors` | character | `#0073C2,#EFC000,#868686,#CD534C,#7AA6DD` | Comma-separated colors for time-point curves |\n|  | `--plot_title` | character | `Calibration Curve` | Plot title |\n|  | `--base_cex` | double | `0.9` | Base text-size multiplier |\n\n---\n\n## Input Format\n\n### Clinical Data (`--data_file`)\n\nCSV file with row names as sample IDs and columns for model features, survival time, and event indicator.\n\n```csv\n\"\",age,gender,stage,futime,fustat,risk\n\"SAMPLE_001\",\">65\",\"Female\",\"StageI&II\",1.12,0,\"high\"\n\"SAMPLE_002\",\"\u003C=65\",\"Male\",\"StageIII&IV\",1.92,1,\"high\"\n\"SAMPLE_003\",\">65\",\"Male\",\"StageI&II\",4.47,1,\"low\"\n```\n\n**Requirements**\n- File extension must be `.csv`.\n- Row names must be unique sample IDs.\n- All requested features plus `time_col` and `event_col` must exist.\n- Survival time values must be finite numbers greater than `0`.\n- Event values must use `0\u002F1` encoding.\n- Complete-case filtering must leave at least 30 samples and at least 10 events.\n\n### Feature Selection (`--features`)\n\n- Comma-separated without line breaks: `age,gender,risk`\n- Character predictors are converted to factors before Cox fitting.\n- If every requested feature is absent after validation, the run stops.\n\n---\n\n## Output Files\n\n| File | Format | Description |\n|------|--------|-------------|\n| `data\u002Fcalibration_data.qs` | QS serialized object | Serialized calibration result bundle, including calibration objects and summary metadata |\n| `table\u002Fcalibration_statistics.xlsx` | Excel workbook (`.xlsx`) | Per-time-point means and overall model summary |\n| `plot\u002Fcalibration_curve.pdf` | PDF (`.pdf`) | Combined calibration curve visualization |\n| `session_info.txt` | Plain text (`.txt`) | Session information and run parameters |\n\n### `calibration_statistics.xlsx`\n\nWorkbook sheets:\n- `Time_Point_Stats`: predicted mean, observed mean, and bias-corrected mean for each calibration horizon.\n- `Model_Summary`: overall C-index, sample count, event count, selected features, and fitted formula.\n\n---\n\n## Workflow\n\n### Step 1: Validate Input\n- Confirm the clinical CSV exists and is readable.\n- Check that requested features, survival time, and event columns are present.\n- Remove incomplete rows across all required columns.\n\n### Step 2: Prepare Survival Modeling Data\n- Convert survival time and event columns to numeric.\n- Convert character predictors to factors.\n- Reject data with non-positive follow-up times, invalid event coding, too few samples, or too few events.\n\n### Step 3: Build Calibration Models\n- Fit a Cox proportional hazards model with the requested features.\n- Run `rms::calibrate()` for each prediction horizon using bootstrap resampling.\n- Compute the concordance index for the fitted model.\n\n### Step 4: Save Outputs\n- Serialize the calibration result bundle as `.qs`.\n- Export statistics to Excel.\n- Render a combined calibration PDF.\n- Record session metadata for reproducibility.\n\n---\n\n## Examples\n\n### Basic Calibration Analysis\n\n```bash\nRscript scripts\u002Fmain.R \\\n  --data_file clinical_data.csv \\\n  --features age,stage,risk \\\n  --output_dir .\u002Foutput\u002F\n```\n\n### Custom Horizons And Bootstrap Count\n\n```bash\nRscript scripts\u002Fmain.R \\\n  --data_file clinical_data.csv \\\n  --features age,gender,risk \\\n  --years 1,3,5 \\\n  --bootstrap_reps 1500 \\\n  --output_dir .\u002Fcustom_output\u002F\n```\n\n### Custom Plot Styling\n\n```bash\nRscript scripts\u002Fmain.R \\\n  --data_file clinical_data.csv \\\n  --features age,stage,risk \\\n  --plot_width 7 \\\n  --plot_height 6 \\\n  --line_width 2 \\\n  --colors \"#1B9E77,#D95F02,#7570B3\" \\\n  --plot_title \"Three-Horizon Calibration\" \\\n  --output_dir .\u002Fstyled_output\u002F\n```\n\n### With Bundled Test Data\n\n```bash\nRscript scripts\u002Fmain.R \\\n  --data_file tests\u002Fdata\u002Fsample_clinical_survival_data.csv \\\n  --features age,gender,risk \\\n  --bootstrap_reps 20 \\\n  --output_dir tests\u002Foutput\u002F \\\n  --overwrite\n```\n\n---\n\n## Error Handling\n\n| Error | Cause | Solution |\n|-------|-------|----------|\n| `SKILL_INVALID_PARAMETER` | Missing required argument, invalid numeric values, invalid event coding, insufficient complete cases, insufficient events, or failed model fitting | Check argument values, data validity, and event\u002Fsample counts |\n| `SKILL_FILE_NOT_FOUND` | Input CSV does not exist | Verify the path |\n| `SKILL_MISSING_COLUMNS` | Required feature\u002Ftime\u002Fevent columns are absent | Check column names and spelling |\n| `SKILL_EMPTY_DATA` | Input file is empty, complete-case filtering removed all rows, or no requested features remained | Check file content and requested feature names |\n| `SKILL_SAMPLE_MISMATCH` | Reserved for cross-file sample mismatch scenarios | Not expected for this single-file workflow |\n| `SKILL_PACKAGE_NOT_FOUND` | Required R package is missing | Install with: `Rscript -e \"install.packages(c('rms', 'qs', 'openxlsx'), repos='https:\u002F\u002Fcloud.r-project.org')\"` |\n\n**IF error persists**, READ: `references\u002Ftroubleshooting.md`\n\n---\n\n## Testing\n\n### Smoke Test With Included Data\n\n```bash\nRscript scripts\u002Fmain.R --help\n\nRscript scripts\u002Fmain.R \\\n  --data_file tests\u002Fdata\u002Fsample_clinical_survival_data.csv \\\n  --features age,gender,risk \\\n  --bootstrap_reps 20 \\\n  --output_dir tests\u002Foutput\u002F \\\n  --overwrite\n```\n\n### Automated Smoke Test Script\n\n```bash\nRscript tests\u002Frun_smoke_test.R\n```\n\nOptional shell wrapper:\n\n```bash\nbash tests\u002Frun_smoke_test.sh\n```\n\n### Expected Output\n\n```text\ntests\u002Foutput\u002F\n|-- data\u002Fcalibration_data.qs\n|-- plot\u002Fcalibration_curve.pdf\n|-- session_info.txt\n`-- table\u002Fcalibration_statistics.xlsx\n```\n\n---\n\n## References\n\n1. Harrell FE. *Regression Modeling Strategies*.\n2. Steyerberg EW et al. Assessing the performance of prediction models.\n3. Austin PC, Steyerberg EW. Graphical assessment of calibration for survival models.\n\n**For detailed algorithm**, READ: `references\u002Falgorithm.md`\n\n---\n\n## Implementation Checklist\n\n- [x] CLI parsing with `optparse`\n- [x] `set.seed()` for reproducibility\n- [x] Top-level CRAN dependency checks\n- [x] Session info recording\n- [x] Timeout parameter exposed as CLI option\n- [x] Relative-path `source()` usage via `get_script_dir()`\n- [x] Modular script structure in `scripts\u002F`\n- [x] Test data provided in `tests\u002Fdata\u002F`\n- [x] Error handling with `SKILL_*` codes\n- [x] Reference docs provided in `references\u002F`\n\n---\n\n*Last updated: 2026-04-27 | Version: 2.1.0*\n","# Model Calibration Curve\n\n## When to Use\n\nUse this skill when you need to:\n- validate a survival model with bootstrap calibration curves;\n- compare predicted and observed survival probabilities at multiple horizons;\n- export calibration statistics together with a PDF visualization.\n\nTypical user requests:\n- \"Generate 1-, 2-, and 3-year calibration curves for this prognosis model.\"\n- \"Check whether the Cox model built from age, gender, and risk is well calibrated.\"\n- \"Export calibration statistics and a calibration PDF from this clinical cohort.\"\n\n## When Not to Use\n\nDo not use this skill for:\n- nomogram construction;\n- univariate or multivariable Cox feature screening;\n- ROC, calibration-free discrimination, or decision-curve analysis;\n- non-survival endpoints or multiclass classification tasks.\n\n## When to Read External Files\n\n| Situation | File to Read | Purpose |\n|-----------|--------------|---------|\n| Need algorithm details | `references\u002Falgorithm.md` | Statistical method and formulas |\n| Need to run analysis | `scripts\u002Fmain.R` | Get the complete command |\n| Encounter errors | `references\u002Ftroubleshooting.md` | Find solutions |\n| Need CLI examples | `references\u002Fcli-guide.md` | Parameter usage examples |\n\n## Input Validation\n\nThis skill accepts:\n\n- A clinical CSV file with sample IDs as row names, survival time, event indicator, and pre-selected prognostic features\n- Requests to assess calibration of a survival (Cox) model via bootstrap resampling at one or more prediction horizons\n\nIf the user's request does not involve survival model calibration from a clinical CSV file — for example, asking to construct a nomogram, screen Cox features, generate an ROC curve, analyze a decision curve, or work with non-survival outcomes — do not proceed with this workflow. Instead respond:\n\n> \"model-calibration-curve is designed to validate survival model calibration by generating bootstrap calibration curves from a clinical CSV file. Your request appears to be outside this scope. Please use a nomogram-construction skill for nomogram building, a roc-diagnostic-performance skill for ROC analysis, or a decision-curve-analysis skill for DCA.\"\n\n---\n\n## Prerequisites\n\nR packages required: `rms`, `qs`, `openxlsx`, `optparse`.\n\nInstall with:\n```r\ninstall.packages(c(\"rms\", \"qs\", \"openxlsx\", \"optparse\"), repos = \"https:\u002F\u002Fcloud.r-project.org\")\n```\n\nOr run the bootstrap installer:\n```bash\nRscript scripts\u002Finstall_dependencies.R\n```\n\n> Note: `--help` requires `optparse` to be loaded. If the package check fires before option parsing, install `optparse` first, then run `--help`. The root fix (deferring heavy package checks until after argument parsing) must be applied in `scripts\u002Fmain.R`.\n\n---\n\n## Usage\n\n```bash\nRscript scripts\u002Fmain.R \\\n  --data_file .\u002Fclinical_data.csv \\\n  --features age,stage,risk \\\n  --years 1,2,3 \\\n  --output_dir .\u002Foutput\u002F\n```\n\n---\n\n## Arguments\n\n| Short | Long | Type | Default | Description |\n|-------|------|------|---------|-------------|\n| `-d` | `--data_file` | character | **required** | Clinical CSV file with sample IDs as row names |\n| `-f` | `--features` | character | **required** | Comma-separated model features used in the Cox model |\n| `-t` | `--time_col` | character | `futime` | Survival time column |\n| `-e` | `--event_col` | character | `fustat` | Event indicator column using 0\u002F1 encoding |\n| `-y` | `--years` | character | `1,2,3` | Prediction horizons in the same units as `time_col` |\n| `-b` | `--bootstrap_reps` | integer | `1000` | Bootstrap replications for `rms::calibrate()` |\n| `-o` | `--output_dir` | character | `.\u002Foutput\u002F` | Output directory |\n|  | `--overwrite` | flag | `FALSE` | Allow writing into a non-empty output directory |\n| `-s` | `--seed` | integer | `42` | Random seed for reproducibility |\n| `-T` | `--timeout_seconds` | integer | `0` | Elapsed time limit in seconds; `0` disables timeout |\n|  | `--plot_width` | double | `6` | PDF width in inches |\n|  | `--plot_height` | double | `6` | PDF height in inches |\n|  | `--font_family` | character | `sans` | PDF font family |\n|  | `--line_width` | double | `1.5` | Calibration curve line width |\n|  | `--colors` | character | `#0073C2,#EFC000,#868686,#CD534C,#7AA6DD` | Comma-separated colors for time-point curves |\n|  | `--plot_title` | character | `Calibration Curve` | Plot title |\n|  | `--base_cex` | double | `0.9` | Base text-size multiplier |\n\n---\n\n## Input Format\n\n### Clinical Data (`--data_file`)\n\nCSV file with row names as sample IDs and columns for model features, survival time, and event indicator.\n\n```csv\n\"\",age,gender,stage,futime,fustat,risk\n\"SAMPLE_001\",\">65\",\"Female\",\"StageI&II\",1.12,0,\"high\"\n\"SAMPLE_002\",\"\u003C=65\",\"Male\",\"StageIII&IV\",1.92,1,\"high\"\n\"SAMPLE_003\",\">65\",\"Male\",\"StageI&II\",4.47,1,\"low\"\n```\n\n**Requirements**\n- File extension must be `.csv`.\n- Row names must be unique sample IDs.\n- All requested features plus `time_col` and `event_col` must exist.\n- Survival time values must be finite numbers greater than `0`.\n- Event values must use `0\u002F1` encoding.\n- Complete-case filtering must leave at least 30 samples and at least 10 events.\n\n### Feature Selection (`--features`)\n\n- Comma-separated without line breaks: `age,gender,risk`\n- Character predictors are converted to factors before Cox fitting.\n- If every requested feature is absent after validation, the run stops.\n\n---\n\n## Output Files\n\n| File | Format | Description |\n|------|--------|-------------|\n| `data\u002Fcalibration_data.qs` | QS serialized object | Serialized calibration result bundle, including calibration objects and summary metadata |\n| `table\u002Fcalibration_statistics.xlsx` | Excel workbook (`.xlsx`) | Per-time-point means and overall model summary |\n| `plot\u002Fcalibration_curve.pdf` | PDF (`.pdf`) | Combined calibration curve visualization |\n| `session_info.txt` | Plain text (`.txt`) | Session information and run parameters |\n\n### `calibration_statistics.xlsx`\n\nWorkbook sheets:\n- `Time_Point_Stats`: predicted mean, observed mean, and bias-corrected mean for each calibration horizon.\n- `Model_Summary`: overall C-index, sample count, event count, selected features, and fitted formula.\n\n---\n\n## Workflow\n\n### Step 1: Validate Input\n- Confirm the clinical CSV exists and is readable.\n- Check that requested features, survival time, and event columns are present.\n- Remove incomplete rows across all required columns.\n\n### Step 2: Prepare Survival Modeling Data\n- Convert survival time and event columns to numeric.\n- Convert character predictors to factors.\n- Reject data with non-positive follow-up times, invalid event coding, too few samples, or too few events.\n\n### Step 3: Build Calibration Models\n- Fit a Cox proportional hazards model with the requested features.\n- Run `rms::calibrate()` for each prediction horizon using bootstrap resampling.\n- Compute the concordance index for the fitted model.\n\n### Step 4: Save Outputs\n- Serialize the calibration result bundle as `.qs`.\n- Export statistics to Excel.\n- Render a combined calibration PDF.\n- Record session metadata for reproducibility.\n\n---\n\n## Examples\n\n### Basic Calibration Analysis\n\n```bash\nRscript scripts\u002Fmain.R \\\n  --data_file clinical_data.csv \\\n  --features age,stage,risk \\\n  --output_dir .\u002Foutput\u002F\n```\n\n### Custom Horizons And Bootstrap Count\n\n```bash\nRscript scripts\u002Fmain.R \\\n  --data_file clinical_data.csv \\\n  --features age,gender,risk \\\n  --years 1,3,5 \\\n  --bootstrap_reps 1500 \\\n  --output_dir .\u002Fcustom_output\u002F\n```\n\n### Custom Plot Styling\n\n```bash\nRscript scripts\u002Fmain.R \\\n  --data_file clinical_data.csv \\\n  --features age,stage,risk \\\n  --plot_width 7 \\\n  --plot_height 6 \\\n  --line_width 2 \\\n  --colors \"#1B9E77,#D95F02,#7570B3\" \\\n  --plot_title \"Three-Horizon Calibration\" \\\n  --output_dir .\u002Fstyled_output\u002F\n```\n\n### With Bundled Test Data\n\n```bash\nRscript scripts\u002Fmain.R \\\n  --data_file tests\u002Fdata\u002Fsample_clinical_survival_data.csv \\\n  --features age,gender,risk \\\n  --bootstrap_reps 20 \\\n  --output_dir tests\u002Foutput\u002F \\\n  --overwrite\n```\n\n---\n\n## Error Handling\n\n| Error | Cause | Solution |\n|-------|-------|----------|\n| `SKILL_INVALID_PARAMETER` | Missing required argument, invalid numeric values, invalid event coding, insufficient complete cases, insufficient events, or failed model fitting | Check argument values, data validity, and event\u002Fsample counts |\n| `SKILL_FILE_NOT_FOUND` | Input CSV does not exist | Verify the path |\n| `SKILL_MISSING_COLUMNS` | Required feature\u002Ftime\u002Fevent columns are absent | Check column names and spelling |\n| `SKILL_EMPTY_DATA` | Input file is empty, complete-case filtering removed all rows, or no requested features remained | Check file content and requested feature names |\n| `SKILL_SAMPLE_MISMATCH` | Reserved for cross-file sample mismatch scenarios | Not expected for this single-file workflow |\n| `SKILL_PACKAGE_NOT_FOUND` | Required R package is missing | Install with: `Rscript -e \"install.packages(c('rms', 'qs', 'openxlsx'), repos='https:\u002F\u002Fcloud.r-project.org')\"` |\n\n**IF error persists**, READ: `references\u002Ftroubleshooting.md`\n\n---\n\n## Testing\n\n### Smoke Test With Included Data\n\n```bash\nRscript scripts\u002Fmain.R --help\n\nRscript scripts\u002Fmain.R \\\n  --data_file tests\u002Fdata\u002Fsample_clinical_survival_data.csv \\\n  --features age,gender,risk \\\n  --bootstrap_reps 20 \\\n  --output_dir tests\u002Foutput\u002F \\\n  --overwrite\n```\n\n### Automated Smoke Test Script\n\n```bash\nRscript tests\u002Frun_smoke_test.R\n```\n\nOptional shell wrapper:\n\n```bash\nbash tests\u002Frun_smoke_test.sh\n```\n\n### Expected Output\n\n```text\ntests\u002Foutput\u002F\n|-- data\u002Fcalibration_data.qs\n|-- plot\u002Fcalibration_curve.pdf\n|-- session_info.txt\n`-- table\u002Fcalibration_statistics.xlsx\n```\n\n---\n\n## References\n\n1. Harrell FE. *Regression Modeling Strategies*.\n2. Steyerberg EW et al. Assessing the performance of prediction models.\n3. Austin PC, Steyerberg EW. Graphical assessment of calibration for survival models.\n\n**For detailed algorithm**, READ: `references\u002Falgorithm.md`\n\n---\n\n## Implementation Checklist\n\n- [x] CLI parsing with `optparse`\n- [x] `set.seed()` for reproducibility\n- [x] Top-level CRAN dependency checks\n- [x] Session info recording\n- [x] Timeout parameter exposed as CLI option\n- [x] Relative-path `source()` usage via `get_script_dir()`\n- [x] Modular script structure in `scripts\u002F`\n- [x] Test data provided in `tests\u002Fdata\u002F`\n- [x] Error handling with `SKILL_*` codes\n- [x] Reference docs provided in `references\u002F`\n\n---\n\n*Last updated: 2026-04-27 | Version: 2.1.0*\n",{"name":5,"license":15,"description":7,"skill-author":24},"AIPOCH","main","e0956dc9606356ab78468936b502e55a365282e2","specialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fmodel-calibration-curve",0,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists","https:\u002F\u002Fgithub.com\u002Fmrsonord2240","2026-10-12 03:19:04",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add mrsonord2240\u002Fopenscience-specialists --skill model-calibration-curve",{"tool":38,"command":39},"bunx","bunx skills add mrsonord2240\u002Fopenscience-specialists --skill model-calibration-curve",{"tool":41,"command":42},"pnpm","pnpm dlx skills add mrsonord2240\u002Fopenscience-specialists --skill model-calibration-curve","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fmodel-calibration-curve\u002FSKILL.md",true,[46,52,56,60,66,70,74,78,84,90],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"references\u002Falgorithm.md","REFERENCE","参考文档",3108,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fmodel-calibration-curve\u002Freferences\u002Falgorithm.md",{"path":53,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":54,"sourceHtmlUrl":55},"references\u002Fcli-guide.md",2193,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fmodel-calibration-curve\u002Freferences\u002Fcli-guide.md",{"path":57,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":58,"sourceHtmlUrl":59},"references\u002Ftroubleshooting.md",2736,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fmodel-calibration-curve\u002Freferences\u002Ftroubleshooting.md",{"path":61,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":64,"sourceHtmlUrl":65},"scripts\u002Ffunctions.R","SCRIPT","脚本",5495,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fmodel-calibration-curve\u002Fscripts\u002Ffunctions.R",{"path":67,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":68,"sourceHtmlUrl":69},"scripts\u002Fmain.R",4673,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fmodel-calibration-curve\u002Fscripts\u002Fmain.R",{"path":71,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":72,"sourceHtmlUrl":73},"scripts\u002Frun_analysis.R",4603,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fmodel-calibration-curve\u002Fscripts\u002Frun_analysis.R",{"path":75,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":76,"sourceHtmlUrl":77},"scripts\u002Futils.R",4510,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fmodel-calibration-curve\u002Fscripts\u002Futils.R",{"path":79,"resourceType":80,"resourceTypeDesc":81,"sizeBytes":82,"sourceHtmlUrl":83},"tests\u002Fdata\u002Fsample_clinical_survival_data.csv","ASSET","资产文件",43139,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fmodel-calibration-curve\u002Ftests\u002Fdata\u002Fsample_clinical_survival_data.csv",{"path":85,"resourceType":86,"resourceTypeDesc":87,"sizeBytes":88,"sourceHtmlUrl":89},"tests\u002Frun_smoke_test.R","OTHER","其他",1904,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fmodel-calibration-curve\u002Ftests\u002Frun_smoke_test.R",{"path":91,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":92,"sourceHtmlUrl":93},"tests\u002Frun_smoke_test.sh",127,"https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Fclinical-prediction-model-specialist\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fmodel-calibration-curve\u002Ftests\u002Frun_smoke_test.sh",[95,103,110,117,124,131],{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":99,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":19},"01M7CW36A6QAGWFE2C008M1XPG","bio-workflows-metabolomics-pipeline","Orchestrates the untargeted LC-MS metabolomics pipeline end-to-end (xcms 4.x feature extraction, QC\u002Fdrift\u002Fnormalization, confidence-stratified annotation, permutation-validated statistics, background-aware pathway mapping), naming what each stage decides and where it silently fails. Use when running a full LC-MS metabolomics study from raw mzML to enriched pathways and needing the honest handoffs between stages. Each stage defers to its component skill for parameters and traps; for stable-isotope flux (a separate branch, not this untargeted flow) see metabolomics\u002Fisotope-tracing.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Funtargeted-metabolomics-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-workflows-metabolomics-pipeline\u002FSKILL.md",[],[],{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":99,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":19},"01M7CW2Y18623NA2S1Y30FRQW1","bio-metabolomics-xcms-preprocessing","Programmatic untargeted LC-MS feature extraction in R with the modern xcms 4.x MsExperiment\u002FXcmsExperiment API, taking raw mzML to a feature table via CentWave peak detection, retention-time alignment, peak-density correspondence, gap-filling, CAMERA redundancy collapse, and built-in QC feature filtering. Use when converting centroided LC-MS runs into a features-by-samples matrix and deciding centWave\u002Fgrouping\u002Falignment parameters. For drift correction and QC\u002FCV filtering execution see metabolomics\u002Fnormalization-qc; for metabolite identification see metabolomics\u002Fmetabolite-annotation; for the MS-DIAL GUI alternative with MS2Dec deconvolution see metabolomics\u002Fmsdial-preprocessing; for downstream statistics see metabolomics\u002Fstatistical-analysis.","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Funtargeted-metabolomics-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-metabolomics-xcms-preprocessing\u002FSKILL.md",[],[],{"skillNo":111,"name":112,"nameZh":6,"description":113,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":99,"licenseFileUrl":6,"sourceHtmlUrl":114,"categories":115,"keywords":116,"publishedAt":19},"01M7CW2M364HVWPNQEKE2WP4PP","bio-metabolomics-statistical-analysis","Decision-grade statistical analysis for metabolomics intensity tables. Covers transformation and scaling (Pareto vs unit-variance as a hidden hypothesis), unsupervised structure (PCA\u002FHCA for QC), permutation-validated PLS-DA\u002FOPLS-DA (R2 vs Q2, double CV, VIP as heuristic), univariate testing (Welch\u002FMann-Whitney\u002FANOVA\u002FLMM with covariate adjustment), and dependence-aware multiple testing. Use when testing which metabolites differ, building or validating a discriminant model, choosing a scaling, or correcting many correlated tests. For sample-wise normalization\u002Fdrift correction see metabolomics\u002Fnormalization-qc; for ML classifiers and selection-inside-CV leakage see machine-learning\u002Fbiomarker-discovery and machine-learning\u002Fmodel-validation; for pathway interpretation see metabolomics\u002Fpathway-mapping; for design\u002Fpower\u002Fmultiplicity regime see experimental-design\u002Fmultiple-testing.","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Funtargeted-metabolomics-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-metabolomics-statistical-analysis\u002FSKILL.md",[],[],{"skillNo":118,"name":119,"nameZh":6,"description":120,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":99,"licenseFileUrl":6,"sourceHtmlUrl":121,"categories":122,"keywords":123,"publishedAt":19},"01M7CW2BCBF851WYE03Z8XPEDQ","bio-metabolomics-pathway-mapping","Maps metabolomics results to biological pathways via over-representation (ORA), metabolite-set enrichment (MSEA\u002FQEA), mummichog\u002FPSEA on raw m\u002Fz peaks, and network-diffusion enrichment (FELLA), with correct background-set construction and honest interpretive ceilings. Use when interpreting differential metabolites or an untargeted LC-MS feature table in pathway context, choosing ORA vs MSEA vs mummichog vs topology, or setting the reference\u002Fbackground set. For annotation confidence levels feeding ORA see metabolomics\u002Fmetabolite-annotation; for gene-set concepts see pathway-analysis\u002Fgo-enrichment and pathway-analysis\u002Fgsea; for joint gene+metabolite pathways see multi-omics-integration\u002Fmofa-integration.","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Funtargeted-metabolomics-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-metabolomics-pathway-mapping\u002FSKILL.md",[],[],{"skillNo":125,"name":126,"nameZh":6,"description":127,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":99,"licenseFileUrl":6,"sourceHtmlUrl":128,"categories":129,"keywords":130,"publishedAt":19},"01M7CW21NSZMCPMF7D9CHJM718","bio-metabolomics-normalization-qc","Designs QC, corrects signal drift, removes batch effects, filters features, normalizes samples, and imputes missing values for untargeted LC-MS\u002FGC-MS metabolomics, framing each step as a measurement model that can create or erase biological signal. Use when processing a peak\u002Ffeature table before statistical analysis, choosing a drift-correction or sample-normalization method, deciding QC RSD vs D-ratio filtering, or handling left-censored missing values. The feature table is produced by metabolomics\u002Fxcms-preprocessing or metabolomics\u002Fmsdial-preprocessing; transformation\u002Fscaling for modeling defers to metabolomics\u002Fstatistical-analysis; cross-study design issues link to experimental-design\u002Fbatch-design.","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Funtargeted-metabolomics-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-metabolomics-normalization-qc\u002FSKILL.md",[],[],{"skillNo":132,"name":133,"nameZh":6,"description":134,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":99,"licenseFileUrl":6,"sourceHtmlUrl":135,"categories":136,"keywords":137,"publishedAt":19},"01M7CW1SWVM0NYHVE6Q7MA3G7R","bio-metabolomics-msdial-preprocessing","Runs the MS-DIAL preprocessing workflow (peak picking, MS2Dec spectral deconvolution, alignment, gap-filling) and imports the alignment-result table into R or Python with honest filtering. Use when preprocessing LC-MS DDA\u002FDIA (SWATH) or GC-MS raw data with MS-DIAL, deciding MS-DIAL vs XCMS, configuring the MSDIALCUI console run, or parsing an MS-DIAL export into a clean feature matrix. For programmatic R peak detection and the feature-table-as-artifact framing see metabolomics\u002Fxcms-preprocessing; for lipid annotation mode see metabolomics\u002Flipidomics; for MSI-level confidence honesty see metabolomics\u002Fmetabolite-annotation; for drift correction and QC see metabolomics\u002Fnormalization-qc.","https:\u002F\u002Fgithub.com\u002Fmrsonord2240\u002Fopenscience-specialists\u002Fblob\u002Fmain\u002Fspecialists\u002Funtargeted-metabolomics-analyst\u002Fversions\u002F1.0.0\u002Fpackage\u002Fskills\u002Fbio-metabolomics-msdial-preprocessing\u002FSKILL.md",[],[]]