Return to Generative AI User Guide

A Quick Guide for Using “Data Analysis” in ChatGPT 4

Explore how to use ChatGPT 4 ‘s ‘Data Analysis’ feature effectively. This guide covers code organization, error checking, data visualization, and language translation, maximizing the likelihood of accurate and efficient results.

⚠️ GenAI models can provide false or inaccurate answers. For information on using GenAI in your research, visit our quick guide.

Access: You need the ChatGPT Plus plan in order to use this feature. 
In this guide: 

Code Organization, Commenting, Explanation, and Error Checking

1.

Copy and paste your code to “Data Analysis” or upload your code using the file attachment icon in the prompt box. Then provide simply prompts such as:

  • “Please help me better organize the code.”
  • “Please comment on the code.”
  • “Please point out any errors in the code.”
  • “Please tell me how to fix the errors in the code.”

2.

When you ask “Data Analysis” to organize and comment on the code, it will output a code snippet along with explanations. You can also ask it to provide a download link, as below:

Examples

A.

Commenting on the code

B.

Explaining a piece of code

Data Visualization and Exploration

ChatGPT can generate summary statistics and visualize data and even recommend data visualization.

1.

Upload your dataset clicking the 🔗 next to the prompt box.

2.

Prompt ChatGPT with an appropriate task:

  • “Please clean up the data, remove duplicates, highlight missing values, then summarize.”
  • “Please provide summary statistics of the dataset.”
  • “Please plot the data as a histogram.”

3.

You can request recommendations for statistical tests or visualizations. For example:

  • “Please plot the data in two ways and explain to me why you chose these two ways.”
  • “What statistical analyses do you recommend to understand the effect of online bullying on academic performance?”

Examples

A.

Simple file uploading.

B.

Carry out simple analysis.

C.

Explicitly prompt for conducting and plotting specific analysis.

D.

Request suggestions for analysis.

Writing Code and Translating Between Different Coding Languages

1.

Prompt ChatGPT to generate code for a specific analysis. For example:

  • “Please create a function to find the diagonal of a matrix in Python.”

2.

Provide ChatGPT with your existing code, then prompt with the translation you want. For example:

  • “Please translate this piece of R code to Python.”

Examples

A.

Generating a piece of web scraping code in Python

B.

Translating Python to R code

Additional Resources

  • See our quick guide for GenAI in Coding, for researchers with little programming experience to learn coding with an AI assistant’s help, assuming a chosen programming language like Python, JavaScript, or C++.
  • See our quick guide for using Custom GPTs in ChatGPT 4, which allows users to create custom version of ChatGPT for specific tasks.
  • See our resource hub for other examples of GenAI uses in research and further resources.