
Prompt Pack
Prompt Pack: Sampling + Matching Prompts for M&E
Sampling and matching are areas where AI can support planning, checking, implementation and documentation. However, both require methodological judgment from the evaluator.
This tutorial provides a practical collection of AI prompts that M&E professionals can use alongside R, MatchIt, Stata and SPSS. The prompts cover sampling-frame review, sampling strategy, sample-size planning, random sampling, propensity-score matching, balance diagnostics, code review and methodological documentation.
The prompts follow the structured approach used in EvalCommunity’s PromptEval framework: define the role, task, context and expected output while asking AI to distinguish evidence from assumptions and avoid inventing information.
Important: AI should support the evaluator’s methodological work. It should not independently determine the sampling design, invent sample-size assumptions, or claim that matching establishes causality.
What You Will Learn
- Use AI to review a sampling frame.
- Develop a sampling strategy prompt.
- Identify potential sampling problems.
- Review sample-size calculations.
- Create prompts for random and stratified sampling.
- Use AI alongside R for random sampling.
- Use AI alongside
MatchItfor propensity-score matching. - Review matching diagnostics.
- Audit R, Stata and SPSS code.
- Document sampling and matching decisions.
- Recognize where AI assistance should stop and evaluator judgment should begin.
Why Use AI for Sampling and Matching?
Sampling and matching involve multiple technical decisions.
For sampling, you may need to consider:
- Target population
- Sampling frame
- Unit of selection
- Sampling method
- Stratification
- Clustering
- Sample size
- Expected response rate
- Non-response
- Replacement procedures
- Weighting
For matching, you may need to consider:
- Treatment definition
- Comparison group
- Pre-treatment covariates
- Propensity-score model
- Matching method
- Matching ratio
- Replacement
- Calipers
- Common support
- Covariate balance
- Estimand
- Unmatched observations
AI can help organize these decisions, identify missing information, explain code and review outputs. It should not make unsupported methodological decisions for you.
The AI-Assisted Sampling and Matching Workflow
Evaluation question
↓
Define target population
↓
Review sampling frame
↓
Choose sampling strategy
↓
Calculate / verify sample size
↓
Implement sampling
↓
Check the selected sample
↓
If observational:
define treatment and comparison
↓
Select appropriate pre-treatment covariates
↓
Run matching
↓
Check balance and overlap
↓
Review results
↓
Document decisionsAI can support several stages, but the evaluator remains responsible for the methodological choices.
Part 1: Sampling Prompts
Prompt 1: Review a Sampling Frame
Before selecting a sample, ask AI to inspect the structure of the sampling frame.
Act as a senior M&E sampling specialist.
I am preparing a sample for an evaluation.
Target population:
[describe population]
Sampling frame:
[paste description or anonymized summary]
Available variables:
[list variables]
Review the sampling frame and identify:
1. What appears to be the unit of selection
2. Whether the frame appears to cover the target population
3. Possible coverage gaps
4. Duplicate or overlapping units
5. Important variables that could support stratification
6. Potential sources of selection bias
7. Information missing before sampling can begin
Do not assume that the sampling frame is complete.
Clearly distinguish:
- information provided
- reasonable inference
- information requiring verification.Prompt 2: Develop a Sampling Strategy
Act as a senior M&E sampling specialist.
Evaluation purpose:
[describe evaluation]
Target population:
[describe population]
Sampling frame:
[describe frame]
Evaluation questions:
[list questions]
Geographic coverage:
[describe locations]
Available resources:
[describe constraints]
Proposed sample size:
[if known]
Develop 2–3 possible sampling strategies.
For each strategy provide:
- Sampling method
- Unit of selection
- Sampling frame required
- How participants would be selected
- Advantages
- Limitations
- Potential sources of bias
- Implementation requirements
- Implications for analysis
Do not select a final method automatically.
Identify decisions that require input from
the evaluation team.This approach encourages AI to compare alternatives rather than simply declaring one method to be the “best.”
Prompt 3: Compare Sampling Methods
Compare the following sampling approaches for my evaluation:
1. Simple random sampling
2. Stratified random sampling
3. Systematic sampling
4. Cluster sampling
Evaluation context:
[paste context]
Target population:
[paste population]
Sampling frame:
[paste information]
Compare the methods using:
- Representativeness
- Precision
- Implementation complexity
- Cost
- Geographic considerations
- Risk of sampling bias
- Data requirements
- Analysis implications
Do not recommend a method without explaining
the assumptions behind the recommendation.Prompt 4: Review a Sample-Size Calculation
AI can be useful as a second reviewer of a sample-size calculation.
Act as a quantitative evaluation reviewer.
Review the following sample-size calculation:
[insert formula, R code, Stata code, SPSS output,
or calculation]
Identify:
1. The statistical formula being used
2. Each input parameter
3. Whether the parameters appear internally consistent
4. The assumed confidence level
5. The assumed margin of error or effect size
6. The assumed prevalence or variance, if relevant
7. The expected response rate
8. Any design effect
9. Any finite population correction
10. Potential coding or calculation errors
Do not invent missing parameters.
If an assumption is not provided,
state that it cannot be verified.Prompt 5: Sample-Size Sensitivity Analysis
Act as a quantitative M&E specialist.
I need to plan a survey sample.
Population size:
[N]
Expected response rate:
[%]
Confidence level:
[%]
Margin of error:
[%]
Expected proportion:
[%]
Design effect:
[if applicable]
Calculate the required sample under several
reasonable scenarios.
Show:
- Assumptions
- Initial sample size
- Adjustment for non-response
- Final proposed sample
- How the result changes under alternative assumptions
Do not describe any scenario as correct
unless the assumptions support that conclusion.Prompt 6: Review a Stratified Sampling Design
Act as an M&E sampling specialist.
I am considering stratified random sampling.
Target population:
[description]
Proposed strata:
[list strata]
Population size in each stratum:
[table]
Proposed sample size:
[table]
Review the design.
Check:
1. Whether the strata appear mutually exclusive
2. Whether they appear collectively exhaustive
3. Whether the proposed allocation is clear
4. Whether any stratum may be too small
5. Potential implementation problems
6. Implications for weighting
7. Implications for analysis
Do not assume proportional allocation is automatically
the best choice.
Identify decisions that require evaluator judgment.Prompt 7: Generate a Random-Sampling Plan
Act as an M&E sampling specialist.
I have a cleaned sampling frame containing:
ID:
[id variable]
Eligibility:
[eligibility variable]
Stratum:
[stratum variable, if applicable]
Target sample:
[n]
I need a reproducible random-sampling procedure.
Describe the procedure step by step.
Include:
- Eligibility filtering
- Duplicate handling
- Randomization
- Random seed
- Sample selection
- Replacement rules
- Reserve sample procedures
- Documentation requirements
Do not invent information about the sampling frame.Part 2: Random Sampling With R
AI can help write the R code, but the evaluator should verify it.
For example:
Write R code to select a reproducible simple random sample
of 250 eligible observations from a data frame called
sampling_frame.
Eligibility is indicated by:
eligible = 1
Use a fixed random seed.
Return:
1. The R code
2. A short explanation of each step
3. Code to verify the final sample size
4. Code to verify that all selected observations
were eligible
Do not modify the original sampling frame.A resulting workflow might look like:
set.seed(2026)
eligible_frame <- subset(
sampling_frame,
eligible == 1
)
sample_data <- eligible_frame[
sample(
nrow(eligible_frame),
size = 250,
replace = FALSE
),
]Check the final sample size:
nrow(sample_data)Check eligibility:
table(sample_data$eligible)A fixed seed makes the randomization reproducible when the same data, sampling procedure and relevant software conditions are maintained.
Prompt 8: Audit R Sampling Code
Review the following R sampling code.
Check for:
1. Syntax errors
2. Incorrect variable names
3. Incorrect eligibility filtering
4. Duplicate-selection problems
5. Incorrect sample size
6. Accidental sampling with replacement
7. Missing random seed
8. Reproducibility problems
9. Potential selection bias introduced by the code
Explain every issue.
Do not change the intended sampling design.
If the design itself is unclear, flag it rather than
assuming what the evaluator intended.Prompt 9: Check the Selected Sample
Review the following population and selected-sample
summary statistics.
Population:
[paste summary]
Selected sample:
[paste summary]
Assess:
- Sample composition
- Representation by key strata
- Differences between population and sample
- Possible selection problems
- Variables requiring additional investigation
Do not claim that the sample is representative
based only on descriptive similarity.
Clearly distinguish descriptive evidence
from representativeness claims.Part 3: Matching Prompts
Matching requires a different type of reasoning from sampling.
The central question is:
Can we construct a defensible comparison group using observed characteristics?
Prompt 10: Review Variables for Matching
Act as a causal-inference and M&E specialist.
Evaluation intervention:
[describe intervention]
Treatment variable:
[variable]
Outcome:
[outcome]
Available variables:
[list variables]
Identify which variables appear to be:
1. Potential pre-treatment confounders
2. Baseline outcome measures
3. Possible mediators
4. Possible post-treatment variables
5. Variables with unclear timing
6. Variables that may not belong in the matching model
For every variable, explain the reasoning.
Do not make assumptions about timing that are not
supported by the information provided.
Flag variables that require verification.Prompt 11: Design a Propensity-Score Matching Strategy
Act as a senior quantitative M&E evaluator.
Evaluation question:
[paste question]
Treatment:
[define treatment]
Comparison:
[define comparison]
Outcome:
[define outcome]
Available baseline covariates:
[list]
Describe a defensible propensity-score matching strategy.
Discuss:
- Target estimand
- Treatment definition
- Covariate selection
- Propensity-score model
- Matching method
- Matching ratio
- Replacement
- Potential caliper
- Common-support considerations
- Balance diagnostics
- Limitations
Do not claim that propensity-score matching
eliminates unmeasured confounding.
Separate methodological recommendations
from decisions that require evaluator judgment.Prompt 12: Generate MatchIt Code
Once the methodology has been decided:
Write R code using MatchIt for the following
pre-specified evaluation design.
Treatment variable:
treatment
Dataset:
psm_data
Covariates:
age
education
household_size
baseline_income
distance_km
Target estimand:
ATT
Matching method:
nearest neighbour
Ratio:
1:1
Replacement:
without replacement
Provide:
1. MatchIt code
2. Balance-diagnostic code
3. Propensity-score overlap diagnostics
4. Code to extract the matched dataset
Do not change the specified design.
Explain any MatchIt arguments that affect
the resulting sample.The key principle is: first specify the design, then ask AI to implement it.
Prompt 13: Review MatchIt Code
Review this MatchIt R script.
Check:
1. Treatment coding
2. Covariate selection
3. Post-treatment variables
4. Matching method
5. Estimand
6. Matching ratio
7. Replacement
8. Caliper settings
9. Balance diagnostics
10. Overlap diagnostics
11. Extraction of matched data
12. Potential interpretation errors
Identify both:
A. Programming problems
B. Methodological concerns
Do not change the evaluation design automatically.
Do not claim that matching establishes causality.Prompt 14: Review Matching Balance
Review the following propensity-score matching
balance diagnostics.
[Paste MatchIt summary]
For each covariate:
- Describe balance before matching
- Describe balance after matching
- Identify improvement or deterioration
- Identify remaining concerns
Then assess:
- Overall balance
- Important residual imbalance
- Whether overlap appears adequate
- Whether additional investigation is needed
Do not use a single threshold as an automatic
pass/fail rule.
Do not claim causal validity from balance alone.Prompt 15: Interpret a Love Plot
Review this Love plot from a propensity-score
matching analysis.
Explain:
1. What the unmatched values show
2. What the matched values show
3. Which variables improved most
4. Which variables remain imbalanced
5. Whether the matching procedure appears to have
improved observed comparability
Do not conclude that the evaluation is unbiased.
Explain what the plot cannot tell us about
unmeasured confounding.Prompt 16: Review Propensity-Score Overlap
Review this propensity-score overlap plot.
Identify:
- Areas of strong overlap
- Areas of limited overlap
- Potential common-support problems
- Groups that may be difficult to match
- Possible implications for the target population
Do not claim that overlap establishes causality.
If the plot is insufficient to determine something,
state that explicitly.Prompt 17: Review a Matching Specification
I have two matching specifications.
Specification A:
[paste]
Specification B:
[paste]
Compare them using:
- Covariate balance
- Common support
- Number of observations retained
- Number of observations discarded
- Matching assumptions
- Target estimand
- Interpretability
Do not select the specification based on
which produces the largest treatment effect.
Prioritize methodological defensibility and
alignment with the evaluation question.Prompt 18: Explain Matching Results for an Evaluation Report
Using only the matching results provided below,
draft a short methodological explanation for an
evaluation report.
Include:
- Why matching was used
- Treatment and comparison groups
- Covariates
- Matching method
- Estimand
- Balance findings
- Overlap findings
- Observations excluded
- Key limitations
Do not claim that matching proves causality.
Do not invent information that is not contained
in the output.
Flag missing information that should be added
by the evaluator.Part 4: Prompts for Stata and SPSS
The same principle applies if you are working outside R.
Prompt 19: Stata Matching Code Review
Act as a Stata and quantitative M&E specialist.
Review the following Stata propensity-score matching code:
[paste code]
Check:
- Syntax
- Treatment definition
- Covariates
- Propensity-score specification
- Matching method
- Matching ratio
- Common support
- Balance diagnostics
- Standard errors
- Interpretation
Identify programming errors separately from
methodological concerns.
Do not rewrite the evaluation design without
explaining why.Prompt 20: SPSS Matching Workflow Review
Act as an SPSS and quantitative M&E specialist.
I am conducting an observational evaluation
using propensity-score matching.
Review this SPSS workflow:
[paste syntax or describe procedure]
Check:
1. Treatment definition
2. Covariate selection
3. Propensity-score estimation
4. Matching procedure
5. Balance assessment
6. Common support
7. Missing data
8. Outcome analysis
9. Interpretation
Identify any steps that are missing or unclear.
Do not assume that software output demonstrates
causal validity.Part 5: AI-Assisted Diagnostic Prompts
Prompt 21: Full Matching Diagnostic Review
Act as an independent methodological reviewer
of an observational M&E analysis.
I will provide:
- Evaluation question
- Treatment definition
- Comparison definition
- Covariates
- Matching code
- MatchIt output
- Balance diagnostics
- Overlap diagnostics
- Matched sample size
- Outcome analysis
Review the complete workflow.
Separate your response into:
1. Data issues
2. Sampling issues
3. Matching issues
4. Balance issues
5. Overlap issues
6. Outcome-analysis issues
7. Interpretation issues
8. Reporting gaps
9. Important limitations
10. Questions requiring evaluator judgment
Do not assume that the analysis is causal merely
because propensity-score matching was used.
Do not invent missing information.Prompt 22: Identify Unsupported Claims
Review the following evaluation findings.
[insert findings]
Identify every statement that appears to:
- Overstate causality
- Treat association as impact
- Generalize beyond the analysed population
- Ignore uncertainty
- Ignore matching limitations
- Ignore unmatched observations
- Claim representativeness without evidence
For each issue:
1. Quote the problematic claim
2. Explain the problem
3. Suggest a more defensible wording
Do not change claims that are adequately supported.Part 6: Prompt for Reproducibility
Prompt 23: Create a Sampling and Matching Record
Create a reproducibility record for this evaluation.
Use only the information provided.
SAMPLING
- Target population
- Sampling frame
- Unit of selection
- Sampling method
- Stratification
- Sample size
- Random seed
- Response rate assumptions
- Replacement rules
MATCHING
- Treatment
- Comparison
- Outcome
- Covariates
- Matching method
- Matching ratio
- Replacement
- Caliper
- Estimand
- Balance diagnostics
- Overlap diagnostics
- Observations excluded
For every missing item, write:
"Not provided."
Do not infer or invent methodological decisions.Responsible Use of the Prompt Pack
The strongest use of these prompts is not:
“AI, design my evaluation.”
It is:
“AI, help me inspect, implement, test and document a design that I have deliberately specified.”
For sampling and matching, add this safeguard:
If the information provided is insufficient
to make a methodological judgment, do not guess.
State:
1. What information is missing
2. Why it matters
3. What decision cannot yet be made
4. What information should be collectedProtect Evaluation Data
Sampling and matching datasets can contain sensitive information.
Before using an AI system:
- Remove direct identifiers.
- Avoid unnecessary personal information.
- Use anonymized examples.
- Use aggregate summaries when raw data are unnecessary.
- Follow organizational data-protection requirements.
- Check donor requirements.
- Check whether the AI tool is approved for the type of data being processed.
A Simple AI + Sampling + Matching Workflow
1. Define the evaluation question
↓
2. Give AI the evaluation context
↓
3. Ask AI to identify missing information
↓
4. Define the sampling strategy
↓
5. Calculate and verify sample size
↓
6. Implement sampling in R / Stata / SPSS
↓
7. Audit the sampling code with AI
↓
8. Define treatment and comparison
↓
9. Identify appropriate pre-treatment covariates
↓
10. Pre-specify matching approach
↓
11. Implement matching
↓
12. Check balance and overlap
↓
13. Ask AI to review diagnostics
↓
14. Conduct outcome analysis
↓
15. Document decisions and limitationsThe Three Roles of AI
1. Technical Assistant
AI can help:
- Write R code.
- Explain
MatchIt. - Translate Stata syntax.
- Review SPSS syntax.
- Debug code.
- Explain statistical output.
2. Critical Reviewer
AI can help identify:
- Missing assumptions.
- Potential post-treatment variables.
- Balance problems.
- Overlap problems.
- Unsupported claims.
- Reporting gaps.
3. Documentation Assistant
AI can help turn code, output, decisions, diagnostics and limitations into reproducible methodological documentation.
The evaluator remains the decision-maker.
What AI Should Not Do
- Independently select a sampling design without sufficient context.
- Invent a sampling frame.
- Invent sample-size assumptions.
- Declare a sample representative without appropriate evidence.
- Choose matching covariates solely to improve balance.
- Search for a matching specification that produces a preferred effect.
- Hide discarded observations.
- Treat balance as proof of causality.
- Invent missing data.
- Fabricate statistical results.
- Remove inconvenient findings from the report.
Practical Exercise
Build an AI-Assisted Sampling and Matching Workflow
Use a fictional evaluation scenario.
Step 1
Write a short programme description.
Step 2
Define:
- Target population
- Evaluation question
- Treatment
- Comparison
- Outcome
Step 3
Create a fictional sampling frame.
Step 4
Use Prompt 1 to ask AI to review the frame.
Step 5
Use Prompt 2 to compare sampling strategies.
Step 6
Select a sampling approach based on the evaluation design.
Step 7
Use R, Stata or SPSS to implement the sampling.
Step 8
Ask AI to audit the code.
Step 9
Define the matching strategy.
Step 10
Use the relevant matching prompt to review your covariates.
Step 11
Run the matching procedure.
Step 12
Review balance and overlap.
Step 13
Give the diagnostic output to AI using Prompt 21.
Step 14
Ask AI to identify unsupported claims.
Step 15
Create a reproducibility record.
Final Quality Checklist
- Is the target population clearly defined?
- Is the sampling frame appropriate?
- Is the sampling unit clear?
- Is the sampling method documented?
- Are sample-size assumptions explicit?
- Is random selection reproducible?
- Is treatment clearly defined?
- Are matching covariates measured before treatment?
- Is the matching method documented?
- Is the estimand clear?
- Was covariate balance assessed?
- Was propensity-score overlap assessed?
- Were unmatched observations documented?
- Were sensitivity analyses considered where appropriate?
- Have AI-generated interpretations been checked against the actual output?
- Are causal claims consistent with the evaluation design?
- Has a human evaluator reviewed the final analysis?
Key Takeaways
- AI can make sampling and matching workflows more structured and reviewable.
- AI is particularly useful for code generation, code auditing, diagnostic interpretation and documentation.
- Sampling decisions should begin with the target population and sampling frame, not with an AI-generated sample size.
- Matching decisions should begin with the evaluation question and causal framework, not with whichever model produces the preferred result.
- Always distinguish observed evidence, inference and assumptions.
- Use R,
MatchIt, Stata or SPSS for the actual statistical procedures. - Use AI to help inspect and explain the results.
- Do not treat AI output as statistical evidence.
- Do not treat successful matching as proof of causality.
- The evaluator remains responsible for methodological judgment, interpretation and final reporting.
Further Resource
How to Use PromptEval — a practical EvalCommunity guide to structuring prompts for more reliable AI-assisted work.
