User asks for any statistical analysis, hypothesis testing, group comparison,
prediction, association, survival analysis, meta-analysis, causal inference,
power/sample size, or mentions R statistical packages.
bash {baseDir}/scripts/run-rstats.sh schema --data First time or errors: bash {baseDir}/scripts/run-rstats.sh doctor
Install by profile (only when needed):
| Profile | Script | Methods |
|---|---|---|
| --------- | -------- | --------- |
| Core | install-core.R | t-test, regression, ANOVA, chi-sq |
| Survival | install-survival.R | KM, Cox, competing risks, RMST |
| Missing | install-missing.R | MICE, MCAR test |
| Mixed | install-mixed.R | LMM, GLMM, GEE, ICC |
| Bayes | install-bayes.R | brms, Bayes factors |
| Causal | install-causal.R | PSM, IPTW, IV, DiD, RDD, TMLE |
| Meta | install-meta.R | meta-analysis, NMA |
| SEM | install-sem.R | SEM, CFA, lavaan |
| Diagnostic | install-diagnostic.R | ROC, kappa, alpha |
| Advanced | install-advanced.R | GAM, quantile, zero-inflated |
| Power | install-power.R | power/sample size |
{
"dataset_path": "<path>",
"analysis_type": "<type>",
"outcome": "<column>",
"predictors": ["<col1>"],
"hypothesis": "<plain language>",
"alpha": 0.05,
"seed": 42,
"output_dir": "<path>"
}
bash {baseDir}/scripts/run-rstats.sh analyze --spec For the complete 82-method table with user intent mapping,
see references/METHOD_TABLE.md.
Quick lookup — most common:
| Intent | analysis_type |
|---|---|
| -------- | -------------- |
| Compare 2 groups | ttest or wilcoxon |
| Compare 3+ groups | anova or kruskal |
| Categorical association | chisq or fisher |
| Predict continuous | linear_regression |
| Predict binary | logistic_regression |
| Survival curves | kaplan_meier |
| Survival regression | cox_regression |
| Meta-analysis | meta_analysis |
| Causal effect | propensity_match or did |
| Power/sample size | power_analysis |
wilcoxon over ttestequal_var: false)fisher over chisqEvery analysis MUST include:
Language: "associated with" / "evidence suggests" — NEVER "proves" / "causes"
See references/SPEC_REFERENCE.md for required/optional fields per analysis_type.
共 2 个版本