提示詞庫 / Prompt Library
本頁由 tools/build-prompts.R 依 prompts/entries/*.yaml 自動產生,請勿手動修改本頁內容—— 要修改條目請改對應的 yaml 檔後重新執行 build 腳本。
This page is generated by tools/build-prompts.R from prompts/entries/*.yaml. Do not edit this page by hand – edit the corresponding YAML entry and rerun the build script instead.
遺漏值先分流再處理Triage missing data before you treat it
analysis: guider | design: none | stat_goal: screen | persona: explainer
情境Scenario
摘要顯示某些變項有遺漏值,想知道這個比例要不要緊、先該做什麼、以及哪些決定 AI 不能替你做。
The summary shows missing values in some variables. You want to know whether that level of missingness matters, what to do first, and which decisions an AI cannot make for you.
送出前必做Prerequisites
- 勾選所有你關心的變項再送出(摘要裡的「遺漏」欄是 AI 唯一看得到的線索)
- Tick every variable you care about before you submit (the “Missing” column in the summary is the only clue the AI can see).
提示詞Prompt
摘要裡 {var_a} 遺漏 {pct_a}%、{var_b} 遺漏 {pct_b}%。
請用初學者聽得懂的方式回答:
1. 這個遺漏比例算不算嚴重?
2. 我該先在 jamovi 用哪個分析看遺漏是否集中在某些組別(請給逐字選單路徑)?
3. 哪些處理方式(例如刪除或插補)的選擇需要我自己根據研究設計決定、你無法替我判斷?
The summary shows {var_a} has {pct_a}% missing and {var_b} has {pct_b}% missing.
In beginner-friendly terms, please answer:
1. Is this level of missingness serious?
2. Which jamovi analysis (exact menu path) lets me see whether missingness clusters by group?
3. Which treatment decisions (e.g. deletion vs. imputation) depend on my research design, so you cannot make them for me?
期望回覆要素Expected elements
- 明確說明它看不到遺漏的「型態」(MCAR/MAR/MNAR 無法從摘要判斷)
- 建議 Exploration ▸ Descriptives(Split by)或 Frequencies 之類真實路徑觀察分佈
- 把「刪除 vs. 插補」的決定交回使用者,並說明依據
- Clearly states it cannot see the “pattern” of missingness (MCAR/MAR/MNAR cannot be judged from the summary alone)
- Suggests a real menu path such as Exploration ▸ Descriptives (Split by) or Frequencies to inspect the distribution
- Hands the “deletion vs. imputation” decision back to you, and explains the reasoning
查核點Check
- path: 路徑逐字核對
- number: 遺漏比例與 Descriptives 的 Missing 欄一致
- cross-check: 換 consultant persona 再問一次,兩次的「交回使用者決定」清單是否一致
- path: Check the menu path word-for-word
- number: The missingness percentage matches the Missing column in Descriptives
- cross-check: Ask again with the consultant persona, and check whether the two “decisions handed back to you” lists agree
判準Stop criteria
- solved: 回覆明確承認摘要的極限且建議的觀察步驟可執行
- reopen: 回覆直接替你選了插補方法而未說明前提 → 記為「過度自信」案例,進 spot-the-error 練習
- solved: The reply clearly acknowledges the summary’s limits and the suggested inspection step is actionable.
- reopen: The reply picks an imputation method for you outright without stating its assumptions -> log it as an “overconfidence” case and use it in the spot-the-error exercise.
延伸閱讀Links
- psyteachr quant-fun ch.11 Screening data(CC BY-SA 4.0)
實測記錄Tested with
- 2026-09-09 | gemini | gemini-flash-latest | pass | zh 版實測。explainer 見 data/missing-data-triage_dawtry2015_zhTW_explainer.omv,consultant 見同名 _consultant.omv,兩份皆 promptLang=zh,僅 role 不同,問題文字 sha1 相同(475e98ea),為乾淨的單變項比較。expected 3/3 全中,未被提問誘導——問「算不算嚴重」時直接答「不算嚴重,非常輕微」。path 與 number 查核通過(Descriptives 顯示 4 筆遺漏有 3 筆集中於 Political_Preference 第 5 組;刪除後餘 301 筆與教材一致)。cross-check 通過:兩個 persona 交回使用者的決定清單核心一致(遺漏機制、刪除 vs. 插補),consultant 另多給一項資料合理性檢查。
- 2026-09-08 | gemini | gemini-flash-latest | pass | en 版實測,兩個 persona 的證據見 data/missing-data-triage_dawtry2015_en_{explainer,consultant}.omv。expected 3/3,同樣未被誘導。cross-check 通過,清單核心一致;consultant 另建議以 Frequencies ▸ Contingency Tables ▸ Independent Samples 檢定遺漏是否與組別關聯,該路徑存在。
混合設計 ANOVA 前的資料整形Reshaping data for a mixed ANOVA
analysis: rtutor | design: mixed | stat_goal: compare-k | persona: tutor
情境Scenario
資料是寬格式:每位受試者一列,兩個時間點各一欄(事前預測與事後實際),另有一個兩水準的組別欄。想在 Rj 裡先確認長寬轉換是否正確,再回 jamovi 跑混合設計 ANOVA。
Data is in wide format: one row per participant, one column for each of two time points (a prediction beforehand and the actual rating afterwards), plus a two-level group column. You want to verify a long-format reshape in Rj before running the mixed ANOVA in jamovi.
送出前必做Prerequisites
- 確認 Rj 已安裝(否則 R tutor 會改教 Syntax Mode)
- 兩個時間點欄名記下來
- Confirm Rj is installed (otherwise the R tutor will teach Syntax Mode instead).
- Write down the two time-point column names.
提示詞Prompt
資料 data 有 {id}、{group} 與兩個時間點欄 {t1}、{t2}。
請依下列規則引導我,不要直接給完整解答:
1. 待填處寫成開頭的變數指派、值放字串佔位符,引導我用 base R 或 rj_environment 裡有的套件轉成長格式。
2. 印出每個受試者 × 時間點的列數,讓我自己核對。
3. 不要幫我跑 ANOVA。
data has {id}, {group}, and two time columns {t1}, {t2}.
Please guide me under these rules, without giving the full solution:
1. Put every blank I need to fill in as a variable assignment at the top of
the script with a string placeholder as its value, and guide me to reshape
to long format using base R or packages already in rj_environment.
2. Print the row count per subject x time point so I can verify it myself.
3. Do not run the ANOVA for me.
期望回覆要素Expected elements
- 只用
data,不出現 read.csv / install.packages(R tutor 的硬規則) - 程式碼在填入欄名前即可通過語法檢查;待填處是開頭的變數指派,不是寫在運算式裡的註解
- 長格式列數 = n 受試者 × 2
- 有一行驗證輸出(table 或 nrow)
- Uses only
data, with no read.csv / install.packages (a hard rule for the R tutor) - The code passes a syntax check before the column names are filled in; blanks are variable assignments at the top, not comments placed inside expressions
- The long-format row count equals n subjects x 2
- Includes one line of verification output (a table or nrow)
查核點Check
- code-read: 逐行讀:有無 setwd/檔案路徑/未列在 rj_environment 的套件
- code-run: 先原樣貼進 Rj 執行,確認沒有語法錯誤(此時應只因欄名是佔位符而報找不到欄位);再填入真實欄名重跑,確認 nrow 等於 n × 2。任何錯誤訊息都原文貼回下一次問題
- cross-check: 回 jamovi 用 ANOVA ▸ Repeated Measures ANOVA 跑寬格式原資料,比對描述統計是否與長格式一致
- code-read: Read line by line for setwd, file paths, or packages not listed in rj_environment
- code-run: First paste it into Rj unchanged and confirm there is no syntax error (it should fail only because the placeholders are not real column names); then fill in the real names, rerun, and confirm nrow equals n x 2. Paste any error message back verbatim in the next question
- cross-check: Go back to jamovi and run ANOVA ▸ Repeated Measures ANOVA on the original wide-format data, then compare the descriptive statistics against the long-format ones
判準Stop criteria
- solved: code-run 列數正確且 cross-check 描述統計一致
- reopen: 程式碼有語法錯誤、列數不對、或用了環境沒有的套件 → 把錯誤訊息貼回、換 consultant 要完整版
- solved: The code-run row count is correct and the cross-check descriptive statistics agree.
- reopen: The code has a syntax error, the row count is wrong, or it uses a package not available in the environment -> paste the error message back and ask the consultant persona for the full solution.
延伸閱讀Links
實測記錄Tested with
- 2026-09-08 | gemini | gemini-flash-latest | fail | 【修正前的提示詞】zh 版,證據 data/mixed-anova-setup_zhang2014_v1_fail_zhTW.omv。code-run 失敗:貼進 Rj 得
:23:1: unexpected symbol。根因是當時的提示詞要求「只給程式骨架與 TODO 註解」,模型因此把註解寫進 c() 括號內(cols = c(# TODO: …)),R 的 # 吃掉整行剩餘內容連同右括號,運算式無法收尾。code-read 無紅旗:library(tidyverse) 確實存在於本機 Rj 套件庫。 - 2026-09-08 | gemini | gemini-flash-latest | fail | 【修正前的提示詞】en 版,證據 data/mixed-anova-setup_zhang2014_v1_fail_en.omv。同一根因,錯誤位置
:21:1,另有 table(data_long$# TODO: …)。此失效模式可重現,已列為 spot-the-error 題材。 - 2026-09-09 | gemini | gemini-flash-latest | pass | 修正後重測,zh 版,證據 data/mixed-anova-setup_zhang2014_v2_fix_zhTW.omv。expected 4/4:只用 data、無 read.csv/install.packages;待填處為開頭的變數指派(target_cols 等)且值為字串佔位符,填值前即可 parse;長格式 304 列(152 × 2);有 table() 驗證輸出。check 三項齊備:code-read 無紅旗,code-run 在 Rj 零錯誤且每格為 1,cross-check 的 anovaRM 已跑(within = Time[T1,T2]、between = Condition)。判定依據為當次貼入 Rj 的程式碼與其執行結果,非 .omv 內顯示的回覆(見 data/README.md 的 submit 重跑陷阱)。
- 2026-09-09 | gemini | gemini-flash-latest | pass | 修正後重測,en 版,證據 data/mixed-anova-setup_zhang2014_v2_fix_en.omv。expected 4/4,待填處為 id_col / time_cols / time_col_name / score_col_name 四個開頭指派(此為當次貼入 Rj 執行的那份程式碼;.omv 現存的回覆是第三個樣本,其變數名為 id_var / time_cols / time_name / score_name)。Rj 執行零錯誤、304 列、每格為 1,anovaRM 同上。附帶觀察:該檔因 submit 重跑共產生三個回覆樣本(變數名分別為 id_col / time_cols / id_var),三者皆符合修正後的格式規範,為提示詞修正穩健的旁證。判定依據同 zh 版。
兩組比較前該檢查什麼What to check before a two-group comparison
analysis: guider | design: between | stat_goal: compare-2 | persona: consultant
情境Scenario
資料集有一個連續結果變項與一個兩水準分組變項,想知道該用哪個 t 檢定、以及前提不符時的替代方案。
Your data has one continuous outcome and one two-level grouping variable. You want to know which t-test to use, and what to do if its assumptions are not met.
送出前必做Prerequisites
- 已在 Exploration ▸ Descriptives 勾選 Split by 分組變項,看過兩組的 n、mean、sd
- 兩組 n 與 sd 記下來(AI 也會收到,但你要能核對)
- You have ticked Split by the grouping variable under Exploration ▸ Descriptives and looked at both groups’ n, mean, and sd.
- Write down both groups’ n and sd (the AI will also receive them, but you need to be able to check them).
提示詞Prompt
{outcome} 是連續變項,{group} 有兩組(n 分別為 {n1}、{n2})。
請回答以下三件事:
1. 該用哪一個 t 檢定?Welch 與 Student 的選擇依據是什麼?
2. 我應該在 jamovi 的 Assumption Checks 勾選哪些項目(給逐字選單路徑)?
3. 若前提不符,請給一個非參數替代方案,並引用該分析的逐字選單路徑。
{outcome} is continuous; {group} has two levels (n = {n1}, {n2}).
Please answer all three:
1. Which t-test should I run? How do I choose between Welch and Student?
2. Which Assumption Checks boxes should I tick in jamovi (give the exact menu path)?
3. If assumptions fail, what non-parametric alternative should I use, with its exact menu path?
期望回覆要素Expected elements
- 指名 T-Tests ▸ Independent Samples T-Test(逐字路徑)
- 提到 Welch 為預設較穩健、或以變異數同質性為選擇依據
- 列出 Assumption Checks 內的 Normality 與 Homogeneity(Levene)
- 給出 Mann-Whitney U 作為替代且路徑正確
- Names T-Tests ▸ Independent Samples T-Test (the exact menu path)
- Mentions that Welch is the more robust default, or bases the choice on homogeneity of variance
- Lists Normality and Homogeneity (Levene) under Assumption Checks
- Gives Mann-Whitney U as the alternative with the correct menu path
查核點Check
- path: 回覆中每條 “Analyses ▸ …” 路徑在你的 jamovi 選單裡點得到
- number: 回覆引用的 n 與你在 Descriptives 看到的一致
- assumption: 你自己跑 Assumption Checks,結果與回覆的預期一致或不一致都記下
- path: Every “Analyses ▸ …” path in the reply is clickable in your jamovi menu
- number: The n cited in the reply matches what you saw in Descriptives
- assumption: Run Assumption Checks yourself, and note whether the result matches or contradicts what the reply expects
判準Stop criteria
- solved: 四個 expected 全命中且 path 查核零錯 → 依建議執行
- reopen: 任一路徑點不到,或回覆未提 Assumption Checks → 換 explainer persona 重問一次;仍失敗則改查 lsj-book 第 11 章
- solved: All four expected elements are hit and the path check has zero errors -> proceed with the suggestion.
- reopen: Any path cannot be clicked, or the reply omits Assumption Checks -> switch to the explainer persona and ask again; if it still fails, check lsj-book chapter 11 instead.
延伸閱讀Links
實測記錄Tested with
- 2026-09-08 | gemini | gemini-flash-latest | pass | zh 版實測(data/ttest-assumptions_zwaan2018_zhTW.omv)。expected 4/4:逐字路徑、Welch 與 Student 的判準、Assumption Checks 的 Normality 與 Homogeneity、Mann-Whitney U 替代皆命中。path 與 assumption 查核通過;模型以 > 而非 ▸ 作分隔,視為命中。
- 2026-09-08 | gemini | gemini-flash-latest | pass | en 版實測(data/ttest-assumptions_zwaan2018_en.omv)。expected 4/4,另給出 Kruskal-Wallis 作為第二條替代路徑,實跑存在。