skills/61-phdemotions-research-methods/skills/process-model/SKILL.md
Implement Hayes PROCESS mediation and moderation models transparently via lavaan and bruceR, with bootstrap CIs, index of moderated mediation, Johnson-Neyman regions of significance, and APA-formatted output that matches familiar PROCESS tables. Maps model numbers (1-24) to inspectable lavaan syntax instead of black-box macros. Use when the user says "PROCESS model," "mediation," "moderated mediation," "conditional indirect effect," "Hayes model," "indirect effect," "moderation," or when /analyze encounters a mediation/moderation hypothesis. Triggers on "PROCESS," "mediation," "moderation," "indirect effect," "Hayes."
npx skillsauth add brycewang-stanford/Awesome-Agent-Skills-for-Empirical-Research process-modelInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You translate the PROCESS model the researcher has in mind into transparent, reproducible lavaan code. Researchers in business and marketing think in "Model 4" and "Model 14" — your job is to give them exactly that, but with inspectable code instead of a black-box SPSS macro.
Every indirect effect gets bootstrap CIs. Every moderation gets a Johnson-Neyman plot. Every model produces output that looks like the PROCESS tables researchers know, but backed by lavaan syntax they can read and modify.
Follow _shared/project-discovery.md to find the project.
Read:
data/processed/Read references/principles.md, references/criteria.md, and references/hayes-models.md.
Determine:
Map to the lavaan syntax from references/hayes-models.md.
Present the model specification to the researcher for confirmation before running.
Before fitting:
Primary approach (lavaan): Write explicit lavaan syntax that the researcher can read, inspect, and modify. This is the key value — transparency over convenience.
library(lavaan)
# Example: Model 4 (simple mediation)
model_4 <- '
# Direct effects
M ~ a*X + covariate
Y ~ b*M + c_prime*X + covariate
# Indirect effect
indirect := a*b
total := c_prime + a*b
'
fit <- sem(model_4, data = df, se = "bootstrap", bootstrap = 5000)
Verification approach (bruceR): Run the same model via bruceR::PROCESS() to verify results match. This provides the familiar PROCESS-style output tables.
library(bruceR)
PROCESS(df, y = "Y", x = "X", meds = "M", covs = "covariate",
mod = NULL, model = 4, boot = 5000)
Python approach: Use semopy for the lavaan-equivalent syntax. Note that Python's SEM ecosystem is less mature — R is preferred for PROCESS models.
For mediation models (4, 6, 80, 81, etc.):
For moderation models (1, 2, 3):
For moderated mediation (7, 8, 14, 15, etc.):
All figures follow _shared/apa-formatting.md.
Save to output/figures/.
Produce tables that match the familiar PROCESS output structure:
Save to output/tables/process-results.html + .docx.
Print:
Follow _shared/next-steps.md — suggest /robustness or /visualize next.
Clear and translational. You bridge two worlds: the researcher who thinks in "Model 14" and the methodologist who thinks in "lavaan syntax." You make the model transparent without making it intimidating. You produce output that looks familiar but is fully reproducible.
tools
Recommend AND run open-source AI tools, agents, Claude Code / Codex skills, and MCP servers for any stage of a literature review — searching, reading, extracting, synthesizing, screening, citation-checking, and paper writing. Use when the user asks "what tool should I use to..." OR "install/run/use <tool> to ..." for research/lit-review work: automating a survey or related-work section, PDF→Markdown extraction for LLMs (MinerU/marker/docling), PRISMA / systematic review (ASReview), citation-backed Q&A over PDFs (PaperQA2), wiring papers into Claude/Cursor via MCP (arxiv/paper-search/zotero servers), or chatting with a Zotero library. Ships a launcher (scripts/litrun.py) that installs each tool in an isolated venv and runs it. Curated catalog of 70+ vetted projects. 支持中英文(用于「文献综述工具选型」与「一键安装/运行」)。
development
Route empirical-research requests through the Auto-Empirical Research Skills catalog when this whole repository is installed as one skill in Codex, CodeBuddy, Claude Code, or another IDE. Use to choose and load the right vendored AERS skill for causal inference, econometrics, replication, data acquisition, manuscript writing, peer review and referee responses, citation checking, de-AIGC editing, or full empirical-paper workflows without reading the entire repository at once.
documentation
Use when the project collects primary data or runs a field, lab, or survey experiment, before the intervention begins — write the pre-analysis plan, size the sample from a power calculation, and register with the AEA RCT Registry. Apply after the design is chosen in aer-identification and before any outcome data are seen.
tools
Guide economists to authoritative data sources with explicit, confirmed data specifications before retrieval; interfaces with Playwright MCP to navigate portals and extract real data, not articles about data.