AI for Data Analysis in Research: A Step-by-Step Guide
摘要
SciSpace 发布一份 AI 辅助科研数据分析的分步指南,把流程拆成写分析简报、确认数据可否处理、评估质量、记录清洗、探索、选方法、检查代码与输出、解释结果、报告并披露 AI 使用等步骤。
摘要由模型根据原文撰写,以原文为准。
正文 · 原文
In short: Using AI for research data analysis works in nine steps: write an analysis brief, confirm the data may be processed, assess quality, clean with a logged plan, explore, run a method that fits the question, inspect and validate the code and output, interpret carefully, and report with verified figures. AI does the computation in minutes; you stay responsible for the method, the checks and the conclusions.
AI can analyze a dataset in minutes. It can clean the file, write the code, select a model, calculate the statistics, and produce charts. The harder part is knowing whether it chose the right method and whether the result can be trusted.
Drawing on Dr. Lyndon Walker’s webinar and a practical data-analysis session, this guide shows how to move from raw data to results you can reproduce and defend. It covers how to define the analysis, protect sensitive data, assess and clean the dataset, choose an appropriate method, inspect the code, validate the output, and report the findings.
Watch the webinar
Key moments:
- 1:27 Can you put research data into ChatGPT? Data governance and ethics
- 3:33 Rules for using AI in data analysis: verify, prompt well, use domain knowledge
- 13:11 Uploading a CSV to SciSpace Agent for analysis
- 21:03 Why you must still verify AI statistical analysis
- 26:53 How to write a detailed AI prompt for statistical analysis
- 30:17 Is the analysis transparent? Code, data, plots and report
- 31:08 Using AI for data analysis without uploading confidential data
- 35:01 What AI should do vs what the researcher does
The AI-assisted data analysis process at a glance
Step | What you need to do |
|---|---|
1. Define the analysis brief | State the question, study design, variables, and how much freedom the AI has. |
2. Check data permissions | Confirm whether the data may be processed by an external system. |
3. Assess data quality | Identify missing values, inconsistent formats, duplicates, and possible errors. |
4. Clean the data | Approve transformations and preserve a complete record of every change. |
5. Explore the dataset | Examine distributions, group characteristics, missingness, and possible patterns. |
6. Run an appropriate method | Choose a model that fits the question, variables, sample, and study design. |
7. Inspect and validate | Review the code, assumptions, diagnostics, calculations, and alternative models. |
8. Interpret the findings | Separate statistical output from scientific or practical meaning. |
9. Create figures and report results | Use verified outputs to create tables, charts, and manuscript sections. |
10. Preserve reproducibility and disclose AI use | Retain the analysis record and report material AI assistance. |
1. Define the research question and analysis brief
Do not begin with “Analyze my data.” Begin with the question the analysis must answer.
State:
- The population or sample
- The outcome
- The intervention, exposure, or predictors
- The groups or comparisons
- The unit of analysis
- The study design
- Whether the work is exploratory or confirmatory
- The output you need
A useful starting sentence is:
I want to determine whether [intervention, exposure, or predictor] is associated with [outcome] in [population], using data from [study design or source].
Then clarify the purpose. Are you trying to describe a sample, compare groups, estimate an association, test a hypothesis, build a prediction model, or examine change over time?
The same dataset can support many analyses. They do not all answer the same research question.
Decide how much analytical freedom the AI has
Walker describes three approaches:
Approach | What you specify | Best use | Main risk |
|---|---|---|---|
Exploratory | The research question and general context | Discovering patterns or possible analytical approaches | The system may choose a method you cannot properly evaluate |
Guided | The question, variables, design, and boundaries | Allowing the system to select a method within clear constraints | The selected method still requires review |
Prescriptive | The exact model, variables, diagnostics, and outputs | Registered, predefined, or statistician-led analysis | An inappropriate specified model will still be executed |
Walker explains that exploratory prompting can be useful when examining possible patterns or models. It is also riskier when the researcher lacks enough statistical knowledge to recognize an unsuitable approach.
Build the prompt around four elements
Element | What to include |
|---|---|
Goal | The question or decision the analysis must address |
Context | Study design, population, variables, and research background |
Source | Dataset, data dictionary, protocol, or relevant methods literature |
Expectations | Required analyses, diagnostics, tables, plots, code, and report format |
Example analysis prompt
Goal: Determine whether the treatment is associated with a greater reduction in systolic blood pressure than control.
Context: This is a 90-day, two-group study with measurements taken before and after treatment.
Source: I have attached the anonymized dataset and a data dictionary defining each variable.
Expectations: First assess data quality. Then report descriptive statistics, examine baseline balance, calculate change scores, select an appropriate primary comparison, check assumptions, and report effect estimates with confidence intervals. Return the complete code and diagnostic plots. Do not interpret statistical significance as clinical importance without reporting the effect size and uncertainty.
2. Decide whether the data can be processed
Data analysis begins with permission, not computation.
Before uploading research data, check:
- Ethics or institutional review board approval
- Participant consent
- Institutional policy
- Data-use agreements
- Funder or collaborator restrictions
- Identifiable or sensitive information
- Approved storage locations
- Restrictions on external or international processing
Walker warns that researchers can breach ethical, contractual, or legal obligations by sending data to an external system when that use was not approved. The researcher, not the AI tool, remains responsible.
Choose the correct route
Data situation | Appropriate approach |
|---|---|
Open or public data | Use it after confirming the source and terms of use |
Anonymized data approved for external processing | Use it under the approved institutional workflow |
Restricted or sensitive data | Do not upload the real observations |
Unclear permissions | Consult your ethics, privacy, or data-governance contact |
Data that must remain on an approved system | Generate code externally and execute it locally |
Use synthetic data when the real data must remain local
Create a dummy dataset with:
- The same variable names
- The same data types
- Similar category structures
- A small number of fictional observations
- None of the real participant data
SciSpace can write and test the analysis on the synthetic dataset. You can then export the code and run it locally on the protected data.
Another option is to provide only the variable names, data types, study design, required method, and desired outputs. Walker recommends both approaches for restricted data.
3. Assess data quality before changing anything
Ask the AI to inspect the dataset before asking it to clean it.
In the SciSpace demonstration, the presenter uploads an uncleaned dataset of job postings and first requests a data-quality assessment covering:
- Rows, columns, and apparent data types
- Missing values and empty records
- Inconsistent text formatting
- Mixed units and salary formats
- Exact and logical duplicates
- Invalid ratings
- Unrealistic values
- Suspicious dates
- Issues that could prevent valid analysis
The prompt explicitly asks for a report before any cleaning is performed.
The Agent writes and executes Python code, then identifies problems including contaminated company names, logical duplicates, inconsistent salary formats, missing-value encodings, and text-encoding issues.
Why assessment comes first
An unusual value is not automatically an error.
A very high measurement may be a valid extreme observation. Two similar rows may represent repeated measurements rather than duplicates. 999 may be an actual value or a missing-data code.
The researcher must understand the variable before approving a correction.
Data-quality prompt
Assess this dataset without altering it. Report:
- Structure and variable types
- Missing values and missing-value codes
- Exact and possible logical duplicates
- Invalid categories or impossible values
- Inconsistent units and formats
- Possible outliers
- Date or sequence problems
- Variables that require clarification
- Issues that would prevent valid analysis
Return an executive summary, examples of each problem, and a prioritized cleaning plan. Do not modify the file yet.
4. Clean the data with a plan you approve
Cleaning changes your data, so every change should be planned, approved and logged. In a SciSpace webinar, Marija Đukić (University of Belgrade) asked the agent for a data cleaning plan before touching the file, starting from the prompt in the agent gallery's data cleaning plan template and changing only the topic and the number of respondents. The plan covered:
- Format standards for numbers, dates and times
- Logical consistency, for example no university students younger than about 17
- Duplicates, both exact and partial, with methods to detect and remove them
- Missing data, with thresholds for action
- Outliers, with methods to detect them and a protocol for handling them
- Naming conventions for variables and versioned files, so the analysis can be repeated
As a rule of thumb from that plan, a variable with less than 5% missing values can usually be handled with standard imputation or deletion, while one with more than 40% missing may need to be excluded. Decide with your supervisor and report what you did.
Keep a cleaning log with the original value, the new value, the rule applied and who approved it. Never overwrite the raw file.
Key moments: 2:48 the 5 steps of data analysis · 9:17 sharing research data with AI tools · 31:18 a data cleaning plan with AI · 37:28 exploratory analysis of a CSV · 41:43 choosing charts and statistical tests · 48:40 analysing private data safely with a synthetic dataset
5. Explore the dataset
Exploration shows what the data can and cannot support before you commit to a model. Ask for a profile first, not conclusions:
Act as an experienced data analyst and researcher in [field]. Examine the dataset and:
1. Profile the dataset and each variable.
2. Identify missing values, outliers and data-quality issues.
3. Calculate descriptive statistics for all variables.
4. Identify notable patterns, trends and anomalies, and potential relationships.
5. Suggest suitable statistical analyses and possible research questions or hypotheses.
Check the profile against what you know. In the webinar demo on a 50,000-student dataset, the agent correctly reported 16 variables and no missing values, and flagged outliers in fewer than 0.7% of rows that were still plausible values.
Treat any hypothesis suggested at this stage as exploratory. If you test it on the same data that suggested it, say so in your report.
6. Run a method that fits the question
The method follows from the research question, the type of outcome variable, the number of groups and the study design, not from what the software offers. Our guide on how to choose a statistical test has a decision table.
A useful prompt asks the AI to justify its choice for each research question:
Analyse the dataset to answer the research questions below. For each question, recommend the most appropriate visualisation and statistical test, explain why, list the assumptions to check, and describe how the result should be interpreted.
In the webinar, the research questions were first suggested by the agent and then refined with domain knowledge before any test was run. That order matters: the questions are yours to own.
7. Inspect and validate the output
Dr. Walker's rule is that AI statistical output must always be verified before you rely on it. Before you accept a result, check:
- The code. Read what was run. SciSpace shows the code, data, plots and report, so each step can be traced.
- The sample. Is the number of cases in each analysis what you expect? Unexplained drops usually mean filtering or missing data.
- The assumptions. Normality, equal variances, independence, linearity or proportional hazards, depending on the method.
- The numbers. Do the values in the summary match the tables and the code output?
- Robustness. Does a reasonable alternative model or a sensitivity analysis change the conclusion?
- Reproducibility. Can you rerun the exported code locally and get the same result?
8. Interpret the findings
Statistical output is not yet a finding. Separate what the numbers show from what they mean:
- Report effect sizes and confidence intervals, not only p-values.
- A statistically significant result can be too small to matter in practice.
- An association is not a cause unless the study design supports a causal claim.
- State the limitations: sample, measurement, missing data and any exploratory analyses.
Use your domain knowledge here. AI can describe a pattern; it cannot tell you whether it is plausible in your field.
9. Create figures and report the results
Build figures only from verified output, and choose the chart for the question: comparisons, distributions, relationships or change over time. Then report:
- The software, packages and versions used, and where the code can be found
- Every cleaning and exclusion decision from your log
- The exact tests, models and assumptions checked
- How AI was used, in line with your journal's policy. See how to disclose AI use in research papers.
SciSpace agents for each step
- Data Dictionary Generator: document every variable before analysis (steps 1–3).
- Data Cleaning agent: profile, clean and deduplicate research data with a change log (steps 3–4).
- Chart Maker: pick the right chart for your data and create it from a CSV (step 9).
Related guides
Frequently asked questions
注意转载授权 · 阅读原文
来源:SciSpace · scispace.com
引用原文
SciSpace. AI for Data Analysis in Research: A Step-by-Step Guide[EB/OL]. (2026-11-10)[访问日期]. https://scispace.com/guides/ai-for-data-analysis-in-research-a-step-by-step-guide.