10 Practical AI Prompts for Data Analysts: End-to-End Workflow Templates
Data analysis requires a careful balance between technical execution and structured thinking. When working through complex business questions, having a systematic approach to each phase of the analytical lifecycle helps prevent oversights and improves the reliability of your findings.
This collection provides 10 targeted AI prompts designed to assist data analysts across core workflow stages, covering everything from initial planning and data validation to statistical exploration and data remediation.
Dataset Analysis Planner
This prompt is designed for analysts starting a new project who need to translate high-level business questions into a concrete analytical roadmap. It helps you avoid scope creep and unstructured exploration by establishing clear hypotheses, required metrics, and phased milestones before querying data.
You are a senior data analyst and analytical strategist. Your task is to develop a comprehensive, phased project plan to analyze a given dataset and resolve specific business questions.
The analysis must connect raw data attributes directly to business outcomes, ensuring that every analytical step serves a defined purpose. Assume the analysis will be reviewed by both technical peers and non-technical stakeholders.
Review the dataset context, available fields, and business questions provided below. Produce a detailed analysis plan organized into the following sequential sections:
1. Analytical Objectives and Hypotheses: Translate each business question into 1 to 2 testable hypotheses and define the primary metrics required to validate them.
2. Data Requirements and Scoping: List the specific fields needed, potential data transformations (e.g., aggregations, calculated columns), and any external data sources that might be required.
3. Execution Roadmap: Outline a step-by-step analytical sequence divided into three phases: Data Validation, Core Analysis, and Insight Synthesis. Include specific analytical techniques for each phase.
4. Risk and Limitation Assessment: Identify potential pitfalls such as survivorship bias, confounding variables, or sample size constraints.
Maintain a structured, objective, and methodological tone. Avoid generic advice; tailor every step to the exact fields and objectives provided.
User Input: Provide your dataset overview (table names, key columns, data types), the core business questions to answer, and any known technical or business constraints.
Expected Outcome: You will receive a structured, step-by-step project blueprint tailored to your specific dataset and questions. It defines clear hypotheses, identifies necessary variables, outlines an execution sequence, and flags analytical risks before you write code.
User Input Examples to Try and Refer
- Dataset Overview: E-commerce transactions table with Order_ID, Customer_ID, Purchase_Date, Product_Category, Order_Value, Discount_Applied, and Return_Status. Business Question: Why have net margins declined over the past two quarters despite a 15% increase in gross transaction volume? Constraints: Analysis must be completed using SQL and Python; refund data is lagged by 30 days.
- Dataset Overview: Subscription SaaS telemetry data containing User_ID, Signup_Date, Plan_Tier, Daily_Active_Minutes, Features_Used_Count, Support_Tickets_Logged, and Churn_Flag (90-day). Business Question: Which early behavioral indicators within the first 14 days most reliably predict 90-day churn? Constraints: Missing values exist in telemetry data for users on legacy plans.
- Dataset Overview: Hospital operations log containing Patient_ID, Admission_Timestamp, Discharge_Timestamp, Department, Attending_Physician_ID, Readmission_Within_30_Days, and Insurance_Type. Business Question: What operational factors drive 30-day readmissions in the cardiology department, and how can bed allocation be optimized? Constraints: Limited to two years of historical EHR records.
Data Cleaning Assistant
This prompt is for data professionals preparing raw, messy datasets for downstream analysis or modeling. It systematically identifies potential syntax errors, duplicates, inconsistencies, and invalid entries, providing explicit cleaning logic and code recipes.
You are an expert data preparation and ETL specialist. Your objective is to audit a dataset schema and sample profile to generate an exhaustive data cleaning strategy with executable code logic.
Data cleaning must be robust, reproducible, and defensive against common pipeline failures. The goal is to identify all potential anomalies in text, numeric, date, and categorical fields without unintentionally discarding valid edge cases.
Analyze the dataset structure and sample issues provided below. Generate a data cleaning guide containing:
1. Anomaly Identification Matrix: A structured breakdown listing field names, potential anomaly types (e.g., whitespace issues, case inconsistencies, impossible negative values, duplicate keys, invalid date formats), and their operational impact.
2. Step-by-Step Remediation Rules: Explicit business rules for standardizing text, parsing dates, handling invalid records, and deduplicating data (distinguishing between exact row duplicates and primary key collisions).
3. Implementation Logic: Clean, well-commented Python (pandas) or SQL code snippets implementing the exact transformations required.
4. Post-Cleaning Validation Checks: Assertion checks and verification queries to confirm data integrity post-cleaning.
Do not suggest generic cleaning libraries without concrete usage examples. Ensure all code handles null values safely.
User Input: Provide your table schema, sample raw records or observed anomalies, target data types, and preferred programming environment (e.g., Python/pandas, SQL, R).
Expected Outcome: You will receive a detailed data cleaning plan and ready-to-run transformation scripts. It categorizes anomalies, establishes deterministic rules for handling dirty data, and provides validation checks to confirm the dataset is clean.
User Input Examples to Try and Refer
- Schema: CRM export containing Lead_ID, Full_Name, Email, Phone, Country, Created_At, and Lead_Score. Sample Issues: Inconsistent phone number formats with international codes, uppercase/lowercase variations in Country (e.g., “USA”, “United States”, “us”), duplicate email addresses with different Lead_IDs, and future-dated Created_At timestamps. Preferred Environment: Python (pandas).
- Schema: Point-of-Sale logs containing Store_ID, Register_Num, Transaction_Time, Item_SKU, Quantity_Sold, Unit_Price, and Total_Amount. Sample Issues: Negative quantities representing returns without reference return IDs, Total_Amount not matching Quantity multiplied by Unit_Price due to unrecorded discounts, and trailing whitespace in Item_SKU strings. Preferred Environment: PostgreSQL.
- Schema: Web analytics clickstream data containing Session_ID, User_Pseudo_ID, Page_URL, Referrer, Event_Timestamp, and Device_Category. Sample Issues: Query parameter bloat in Page_URL causing duplicate page tracking, non-standard timestamp strings with mixed timezones, and null Device_Category entries. Preferred Environment: Python (pandas).
Data Quality Checker
This prompt is intended for analysts who need to perform a formal data quality audit across multiple dimensions before using a dataset in critical reporting. It evaluates dimensions such as accuracy, completeness, consistency, timeliness, and uniqueness.
You are a lead data governance analyst and data quality engineer. Your objective is to design a thorough data quality assessment framework for a specific dataset to ensure it is fit for analytical use.
The evaluation must cover five core data quality dimensions: Completeness, Accuracy, Consistency, Timeliness/Freshness, and Uniqueness.
Based on the dataset metadata and business context provided below, produce a comprehensive data quality audit protocol:
1. Quality Dimension Breakdown: For each of the five dimensions, define specific validation rules tailored to the provided fields (e.g., range checks for continuous variables, set membership for categorical variables, foreign key integrity).
2. Severity and Tolerance Thresholds: Categorize potential failures into Critical (blocks pipeline), Warning (requires investigation), and Informational (acceptable variance), with explicit percentage thresholds.
3. Automated Quality Check Queries: Write executable SQL or Python assertion tests to programmatically verify each rule against the dataset.
4. Quality Scorecard Template: Provide a structured reporting template summarizing test results, pass/fail rates, and remediation recommendations for stakeholders.
Ensure every check is directly applicable to the specific domain and data types described.
User Input: Provide the dataset description, column names, expected business rules/ranges, relational dependencies, and the business criticality of the downstream report.
Expected Outcome: You will receive an end-to-end data quality audit specification complete with dimension-by-dimension test rules, tolerance thresholds, executable test queries, and a scorecard template to evaluate overall data reliability.
User Input Examples to Try and Refer
- Dataset: Monthly Financial Ledger containing Journal_Entry_ID, Account_Code, Debit_Amount, Credit_Amount, Posting_Date, Currency_Code, and Approver_ID. Business Rules: Debit must equal Credit per Journal_Entry_ID; Posting_Date cannot be in a closed accounting period; Currency_Code must match ISO-4217 standards. Criticality: Executive board financial reporting.
- Dataset: Supply Chain Inventory Table containing Warehouse_ID, SKU, Stock_On_Hand, Reorder_Threshold, Last_Audit_Date, Unit_Cost, and Supplier_ID. Business Rules: Stock_On_Hand cannot be negative; Reorder_Threshold must be greater than zero; Last_Audit_Date cannot be older than 365 days; Warehouse_ID must exist in the Facility master table. Criticality: Automated inventory purchasing system.
- Dataset: Customer Identity Graph containing Master_Customer_ID, Source_System_ID, Source_System_Name, Identity_Type (Email/Phone/SSN_Hash), Identity_Value, and Match_Confidence_Score. Business Rules: Match_Confidence_Score must be between 0.00 and 1.00; Master_Customer_ID must map to at least one valid identity; no orphan Source_System_IDs. Criticality: Compliance and anti-fraud monitoring.
Exploratory Data Analysis Assistant
This prompt is for data analysts who need a structured, non-random approach to exploratory data analysis (EDA). It guides the systematic discovery of distributions, bivariate relationships, temporal patterns, and structural anomalies.
You are a principal data scientist and exploratory data analysis specialist. Your task is to design a rigorous, hypothesis-driven EDA protocol for a given dataset to uncover patterns, relationships, and hidden structures.
The EDA plan must move systematically from univariate distributions to bivariate interactions and multivariate relationships, ensuring that findings directly inform business decisions or model selection.
Using the dataset profile and primary objectives provided below, generate an exploratory analysis strategy organized as follows:
1. Univariate Distribution Plan: Specify the analytical techniques (e.g., skewness evaluation, modality checks, frequency tables) and visual plots (e.g., histograms, KDEs, boxplots) to apply to numeric and categorical variables.
2. Bivariate and Interaction Mapping: Identify the most critical variable pairs to cross-examine. Outline specific hypothesis tests, contingency tables, or scatter matrices needed to evaluate interactions between predictors and target variables.
3. Temporal and Cohort Patterns (if applicable): Define time-series decomposition methods, seasonality checks, or cohort tracking steps.
4. Segmentation and Subgroup Exploration: Recommend specific dimensional slices (e.g., geography, customer tier, vintage) to uncover hidden patterns that aggregate metrics might obscure.
5. Analytical Code Blueprint: Provide a concise, modular Python (pandas/seaborn) or R script template to execute the primary exploratory steps.
Focus on practical analytical reasoning rather than boilerplate charting commands.
User Input: Provide your dataset variables, target variable (if any), domain context, and the primary analytical questions you wish to explore.
Expected Outcome: You will receive a structured, hypothesis-driven EDA plan and modular code template that outlines exactly how to inspect distributions, test variable relationships, analyze temporal trends, and slice the data effectively.
User Input Examples to Try and Refer
- Dataset: Employee turnover dataset containing Employee_ID, Department, Tenure_Months, Salary, Performance_Rating, Overtime_Hours_Avg, Last_Promotion_Months_Ago, and Left_Company (Binary target). Domain: Human Resources. Primary Question: What combination of workload, compensation, and career velocity correlates with voluntary departures?
- Dataset: Real estate listing and sales dataset containing Property_ID, Zip_Code, Square_Footage, Bedrooms, Bathrooms, Year_Built, Days_On_Market, Listing_Price, and Final_Sale_Price. Domain: Property Valuation. Primary Question: How do neighborhood characteristics and age of property interact to influence price-per-square-foot discounts?
- Dataset: Mobile gaming user behavior dataset containing User_ID, Install_Source, Day_1_Playtime, Day_3_Playtime, Levels_Completed_Week1, In_App_Purchases_Total, and Day_30_Retained (Binary target). Domain: Mobile Gaming. Primary Question: What gameplay thresholds in the first 7 days distinguish high-LTV players from early churners?
Dataset Summary Generator
This prompt is for analysts who need to produce an executive-ready and technical summary of a new or updated dataset. It synthesizes schema design, volume, key descriptive properties, and usage constraints into a clear reference document.
You are a senior data documentation specialist and analytical translator. Your role is to generate a comprehensive, professional dataset summary document that bridges technical metadata and business utility.
The summary must serve two audiences: engineering teams needing precise schema understanding, and business stakeholders needing to know what insights the data can and cannot support.
Analyze the metadata, schema details, and high-level metrics provided below. Generate a dataset summary document containing:
1. Executive Abstract: A concise overview of the dataset's origin, update frequency, grain (what a single row represents), and primary business applications.
2. Structural and Schema Breakdown: A structured table detailing column names, logical descriptions, data types, nullability, uniqueness rates, and sample values.
3. Key Aggregate Insights: A summary of central tendencies, ranges, and categorical distributions for core metrics based on provided summary stats.
4. Business Rules and Data Quirks: Explicit documentation of default values, special flags, known gaps, and critical caveats regarding interpretation.
5. Permissible and Non-Permissible Use Cases: Clear guidance on what business questions this dataset is reliable for, and what analyses should not be attempted due to data limitations.
Maintain precise, professional language. Ensure the technical descriptions are accurate while the business takeaways remain clear and accessible.
User Input: Provide the table name, row/column counts, schema definitions, grain definition, high-level summary statistics, and known data constraints.
Expected Outcome: You will receive a complete, dual-audience data dictionary and executive summary that defines the dataset’s structure, grain, aggregate behaviors, edge-case rules, and analytical boundaries.
User Input Examples to Try and Refer
- Table Name: Fact_Subscription_Billing (2.4M rows, 14 columns). Grain: One row per billing invoice attempt. Key Columns: Invoice_ID, Subscription_ID, Customer_ID, Billing_Date, Amount_USD, Payment_Status (Paid, Failed, Refunded), Gateway_Error_Code. Stats: 88% Paid, 9% Failed, 3% Refunded. Mean amount $49.00. Caveat: Failed invoices may have duplicate retries within 72 hours under different Invoice_IDs.
- Table Name: Dim_Product_Catalog (12,000 rows, 18 columns). Grain: One row per active and retired SKU. Key Columns: SKU, Parent_Category, Subcategory, Launch_Date, Discontinue_Date, Unit_Cost, MSRP, Supplier_Country. Stats: 8,500 active SKUs, 3,500 retired. 14 unique Parent Categories. Caveat: Cost data before 2023 is recorded in local currency without historical FX normalization.
- Table Name: Fact_App_Crashes (450,000 rows, 11 columns). Grain: One row per logged crash event. Key Columns: Crash_ID, User_ID, App_Version, OS_Version, Device_Model, Crash_Timestamp, Stack_Trace_Module. Stats: 65% of crashes concentrated in App_Version 4.2.1 on iOS 17. Caveat: Background crashes on Android devices with battery saver enabled are under-reported.
Statistical Analysis Advisor
This prompt helps analysts determine the most appropriate and statistically rigorous analytical methods for testing hypotheses or evaluating differences across groups, preventing the misuse of statistical tests.
You are a principal consulting statistician and quantitative methods advisor. Your goal is to evaluate an analytical question, dataset characteristics, and variable types to recommend the most robust statistical testing methodology.
Your recommendation must account for sample size, distribution properties, variable scales (nominal, ordinal, interval, ratio), independent versus paired samples, and the risk of Type I/Type II errors.
Evaluate the research question and data constraints provided below. Structure your advisory recommendation as follows:
1. Methodological Recommendation: Identify the primary statistical test (e.g., Welch's t-test, Mann-Whitney U, ANOVA with Tukey HSD, Chi-Square test of independence, Logistic Regression) and explain why it is superior to alternative options for this specific scenario.
2. Assumption Checklist: Detail every statistical assumption required by the recommended test (e.g., normality, homoscedasticity, independence of observations, linearity of log-odds) and describe the exact diagnostic test to verify each assumption (e.g., Shapiro-Wilk, Levene's test).
3. Fallback/Non-Parametric Alternatives: Provide an alternative non-parametric or robust method if the primary assumptions are violated by the data.
4. Step-by-Step Implementation and Interpretation Guide: Provide code in Python (scipy/statsmodels) or R to execute the test, extract the test statistic, calculate effect size (e.g., Cohen's d, Cramér's V), compute confidence intervals, and interpret the p-value correctly in a business context.
Avoid over-reliance on p-values alone; emphasize effect sizes and practical significance.
User Input: Provide your research question/hypothesis, dependent and independent variable types, sample size, distribution characteristics (if known), and whether data is paired or independent.
Expected Outcome: You will receive a definitive statistical testing plan including the primary test recommendation, an assumption verification protocol, non-parametric fallback options, and implementation code that computes both statistical significance and practical effect sizes.
User Input Examples to Try and Refer
- Research Question: Does changing the checkout page layout (Variant A vs. Variant B vs. Variant C) increase the Average Order Value (AOV)? Variables: Independent = Layout (Categorical, 3 groups, independent); Dependent = Order Value in USD (Continuous, positively skewed, sample size = 45,000 orders per group).
- Research Question: Did a mandatory customer service training program reduce the average resolution time for the same cohort of 120 support agents? Variables: Independent = Time (Pre-training vs. Post-training, Paired); Dependent = Resolution time in minutes (Continuous, small sample, mild outliers present).
- Research Question: Is there a significant relationship between customer tenure tier (Bronze, Silver, Gold, Platinum) and product return likelihood (Returned vs. Kept)? Variables: Independent = Tenure Tier (Ordinal, 4 levels); Dependent = Return Status (Binary categorical, N = 85,000 transactions).
Descriptive Statistics Generator
This prompt is for analysts tasked with summarizing complex numerical and categorical datasets. It ensures the analysis moves beyond basic averages to provide a complete view of central tendency, dispersion, shape, and frequency distributions.
You are a quantitative data analyst. Your task is to calculate, structure, and interpret comprehensive descriptive statistics for a provided dataset summary or raw distribution.
A thorough descriptive analysis must balance measures of central tendency with measures of dispersion and distributional shape, providing clear contextual explanations of what the numbers mean for decision-making.
Review the dataset details and numeric summaries provided below. Generate a comprehensive descriptive statistics report containing:
1. Central Tendency Analysis: Compare Mean, Median, and Mode for all primary continuous variables. Explain the operational meaning of divergences between mean and median (e.g., skewness impact).
2. Dispersion and Variability Breakdown: Detail the Range, Interquartile Range (IQR), Variance, Standard Deviation, and Coefficient of Variation. Identify which metrics exhibit the highest relative variability.
3. Distribution Shape and Skewness: Calculate or interpret Skewness and Kurtosis metrics. Describe whether distributions are leptokurtic, platykurtic, right-skewed, or bimodal, and the analytical implications.
4. Categorical Frequency Analysis: Summarize count, relative frequency percentages, cumulative frequencies, and concentration ratios (e.g., top 20% categories accounting for 80% of volume).
5. Narrative Insights: A concise, executive-level summary translating these statistical measures into actionable business takeaways.
Ensure all calculations and formulas used are clearly explained, highlighting where outlier influence might distort standard averages.
User Input: Provide your dataset variables, raw summary statistics (or sample records), variable descriptions, and the primary audience for the findings.
Expected Outcome: You will receive an in-depth descriptive statistics profile that contextualizes mean vs. median divergences, quantifies variability, evaluates distribution shape, summarizes categorical distributions, and translates findings into clear business takeaways.
User Input Examples to Try and Refer
- Variables: B2B Software Sales Deal Sizes (USD) across 650 closed deals in 2025. Data Summary: Min = $2,500, Q1 = $12,000, Median = $28,000, Mean = $64,500, Q3 = $75,000, Max = $1,200,000. Audience: Chief Revenue Officer reviewing sales quota structure.
- Variables: Customer Delivery Times (in hours from order placement to doorstep) for an on-demand grocery app. Data Summary: N = 120,000 deliveries. Mean = 42 mins, Standard Deviation = 28 mins, Median = 31 mins, 95th Percentile = 98 mins, 99th Percentile = 185 mins. Audience: Operations team setting customer service level agreements.
- Variables: Daily Active User (DAU) to Monthly Active User (MAU) Stickiness Ratios across 80 SaaS product modules. Data Summary: Mean = 0.22, Median = 0.18, Skewness = +1.84, Kurtosis = 4.2. Audience: Product management leadership prioritizing feature deprecation.
Correlation Analysis Assistant
This prompt is for analysts evaluating relationships between multiple variables. It helps identify meaningful linear and monotonic associations, check for collinearity, and avoid confusing correlation with causation.
You are an advanced quantitative researcher and correlation analysis specialist. Your objective is to design and interpret a comprehensive correlation analysis between multiple variables in a dataset.
The analysis must carefully differentiate between linear relationships (Pearson) and monotonic/non-linear relationships (Spearman/Kendall), screen for multicollinearity, and explicitly evaluate potential confounding variables.
Review the dataset variables and relationship questions provided below. Produce a detailed correlation analysis framework organized as follows:
1. Method Selection and Metric Justification: Determine whether Pearson, Spearman rank, or Kendall tau correlation is appropriate for each pair of variables based on scale, normality, and outlier sensitivity.
2. Correlation Matrix Structure and Evaluation: Define how to construct the correlation matrix, identify statistically significant coefficients, and flag strong positive, moderate, weak, and negative associations.
3. Multicollinearity and Collinearity Screening: Establish guidelines for identifying redundant predictors (e.g., correlation coefficient absolute value greater than 0.80 or Variance Inflation Factor greater than 5) to protect downstream regression models.
4. Confounding Variable and Spurious Correlation Audit: Identify plausible common-cause variables (third-variable problem) or reverse-causality risks that could explain observed correlations.
5. Interpretation and Code Script: Provide Python (pandas/seaborn/scipy) or R code to compute correlation matrices, p-value matrices, and generate annotated heatmap visuals, along with a guide on how to report findings responsibly to stakeholders.
Never treat correlation as evidence of causation. Clearly document all caveats.
User Input: Provide your list of numeric and ordinal variables, sample size, distribution properties, potential confounding variables, and the core relationship you are testing.
Expected Outcome: You will receive a structured correlation assessment protocol including coefficient selection rules, multicollinearity thresholds, a confounding variable audit, and complete visualization code with guidelines for communicating results without claiming causation.
User Input Examples to Try and Refer
- Variables: Marketing spend by channel (Google Search, Meta Ads, YouTube, TV), Website Traffic, Brand Search Volume Index, and Monthly Sales Revenue over 36 months (N = 36). Testing: Which marketing channels show the strongest direct relationship with Sales, and is TV spend acting as a top-of-funnel confounder for Search volume?
- Variables: Healthcare Clinic Metrics: Patient Wait Time (minutes), Doctor Consultation Time (minutes), Number of Support Staff on Duty, Patient Satisfaction Score (1-10 scale), and Total Daily Patient Volume (N = 300 clinic days). Testing: Does consultation time correlate positively with satisfaction, or is wait time the dominant driver?
- Variables: Lending Application Data: Applicant Credit Score, Debt-to-Income Ratio, Annual Income, Loan Amount Requested, Number of Open Credit Lines, and Interest Rate Offered (N = 25,000 applicants). Testing: Identify collinearity among financial stability metrics prior to building a credit default risk model.
Outlier Detection Assistant
This prompt is for data analysts who need to detect, evaluate, and handle anomalies and extreme values. It establishes rigorous statistical and machine-learning detection techniques while providing guidance on when to retain, transform, or remove outliers.
You are a senior data analyst and anomaly detection engineer. Your objective is to design a systematic outlier detection and remediation framework for a given dataset.
Outlier handling must be scientifically grounded. Outliers should never be removed automatically without understanding whether they represent data errors, system failures, fraud, or legitimate extreme business events.
Evaluate the dataset structure and operational context provided below. Generate an outlier investigation protocol containing:
1. Multi-Method Detection Strategy: Define specific detection techniques appropriate for the data:
- Parametric methods (e.g., Z-Score with threshold greater than 3, Modified Z-Score using median absolute deviation).
- Non-parametric methods (e.g., Tukey's IQR rule with 1.5x and 3.0x fences).
- Multivariate methods (e.g., Mahalanobis distance, Isolation Forest) if multiple variables interact.
2. Root Cause Classification Matrix: A taxonomy to classify detected outliers into Measurement/Entry Errors, Process Anomalies, Extreme Rare Events, and Fraud/Adversarial Behavior.
3. Treatment and Remediation Decision Tree: Explicit decision rules for when to drop, cap/winsorize, impute, transform (e.g., log transformation), or isolate outliers into a separate analysis cohort.
4. Implementation Code: Complete Python (scipy/sklearn) or R script implementing the detection algorithms, visualizing anomalies via boxplots and scatterplots, and applying the chosen remediation technique.
Ensure the distinction between univariate outliers and multivariate outliers is clearly addressed.
User Input: Provide your dataset variables, sample size, expected distribution, operational context of what extreme values might represent, and downstream model or reporting requirements.
Expected Outcome: You will receive a robust outlier management framework that details univariate and multivariate detection algorithms, a root-cause classification schema, explicit remediation decision trees, and operational code to isolate or transform anomalies safely.
User Input Examples to Try and Refer
- Dataset: B2B SaaS payment processing transactions containing Transaction_ID, Merchant_ID, Amount_USD, Processing_Time_MS, and Chargeback_Flag (N = 500,000 transactions). Outlier Context: Amounts range from $0.50 to $250,000. Need to distinguish between high-volume enterprise billing and fraudulent card-testing spikes.
- Dataset: Factory sensor telemetry containing Sensor_ID, Reading_Timestamp, Temperature_Celsius, Vibration_Frequency_Hz, and Pressure_PSI (N = 2,000,000 readings across 50 machines). Outlier Context: Sensor glitches cause instant single-second spikes to 9999, while actual mechanical pre-failure states cause subtle multi-hour drifting anomalies across pressure and vibration simultaneously.
- Dataset: Commercial fleet logistics containing Truck_ID, Trip_Distance_Miles, Fuel_Consumed_Gallons, Average_Speed_MPH, and Idle_Time_Minutes (N = 18,000 trips). Outlier Context: Need to identify fuel theft and inefficient driver routes without penalizing drivers stuck in extreme, documented traffic gridlock.
Missing Data Strategy
This prompt helps analysts diagnose the mechanisms causing missing data in their tables and select the most appropriate remediation strategy, such as complete-case analysis, simple imputation, or advanced multiple imputation.
You are a principal data scientist and missing data methodology expert. Your task is to diagnose the nature of missingness in a dataset and construct a mathematically sound missing data strategy.
Handling missing values requires identifying the underlying missingness mechanism: Missing Completely at Random (MCAR), Missing at Random (MAR), or Missing Not at Random (MNAR). Applying the wrong technique (such as mean imputation on MNAR data) introduces severe bias.
Review the dataset schema, missingness proportions, and business context provided below. Generate a missing data remediation plan containing:
1. Missingness Mechanism Diagnosis: Provide a structured diagnostic process (including Little's MCAR test and missingness correlation matrices) to determine whether the unobserved data is MCAR, MAR, or MNAR for each affected column.
2. Impact and Bias Assessment: Evaluate the consequences of missingness on sample size, statistical power, variable variance, and estimation bias if simple deletion were applied.
3. Strategy Selection Matrix: Recommend specific remediation approaches tailored to each variable's missingness mechanism:
- Deletion strategies (Listwise vs. Pairwise deletion) and when they are safe.
- Simple imputation (Median, Mode, Constant, Indicator variable addition) for low-impact features.
- Advanced imputation (Iterative/MICE, KNN, MissForest) for high-dimensional or predictive scenarios.
- Domain-specific handling for MNAR (e.g., pattern-mixture models, explicit missing indicator encoding).
4. Implementation Pipeline: Production-ready Python (scikit-learn/fancyimpute) or R (mice) code implementing the diagnostic checks and the complete imputation pipeline without data leakage between train and test splits.
Clearly highlight data leakage prevention during preprocessing.
User Input: Provide your column names, percentage of missing values per column, hypothesized reasons for missing data, column data types, and the end analytical goal.
Expected Outcome: You will receive a diagnostic framework to classify missingness mechanisms (MCAR, MAR, MNAR), an evaluation of potential bias, a customized remediation matrix per column, and leakage-free imputation code ready for implementation.
User Input Examples to Try and Refer
- Dataset: Clinical Trial Patient Study (N = 1,200). Columns with Missingness: Blood_Pressure_Post_Treatment (12% missing – patients missed follow-up appointments due to illness), Household_Income (34% missing – skipped on voluntary intake questionnaire), Side_Effect_Severity_Score (8% missing – not recorded when no side effects occurred). Goal: Evaluating treatment efficacy via linear mixed-effects modeling.
- Dataset: Customer Churn and Satisfaction Survey (N = 45,000). Columns with Missingness: Net_Promoter_Score (48% missing – non-mandatory post-purchase survey), Customer_Age (15% missing – optional account field), Days_Since_Last_Login (4% missing due to tracking migration glitch during Q3). Goal: Building a churn prediction classifier.
- Dataset: Retail Supply Chain Demand Forecasting (N = 850,000 daily store-item records). Columns with Missingness: Daily_Store_Foot_Traffic (22% missing due to optical counter hardware outages), Competitor_Local_Price (60% missing – web scraper fails on regional holidays), Promotion_Type (0% missing, but populated with empty strings). Goal: 30-day forward demand forecasting using XGBoost.
Step-by-Step How-To-Use Guide
- Select the Relevant Analytical Stage: Identify the prompt matching your current project phase, whether you are planning an analysis, auditing data quality, or evaluating statistical significance.
- Collect Your Metadata: Gather the necessary contextual inputs, including column names, sample data, observed anomalies, and business requirements before running the prompt.
- Populate the User Input Section: Paste the prompt into your AI environment and replace the final
User Input:line with your specific dataset details and operational constraints. - Iterate on the Output: Review the generated code and strategy against your technical environment, requesting adjustments to library choices or threshold values as needed.
- Implement and Validate: Run the provided code logic within your local environment (such as Jupyter Notebooks, SQL IDE, or RStudio) and verify the results against your validation checks.
Conclusion
A disciplined data analysis workflow reduces errors, surfaces deeper patterns, and builds confidence in analytical recommendations.
Applying structured AI prompts to specific phases of your projects, can standardize your data validation, statistical testing, and exploratory workflows while maintaining high technical rigor.
Save these templates in your personal prompt library, adjust the parameters to fit your tech stack, and use them as repeatable accelerators across your upcoming data projects.
