ll-23-24
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Sandbox versus GPT-4: Problem Sets in R ![alt text](https://files.slack.com/files-pri/T0HTW3H0V-F068GHG1X7B/statistical_analysis_r_diagram.webp?pub_secret=8710a4922b) prompt used: "a diagram of statistical analysis using R" ## description GPT-4, which is one of the tools available through the Harvard AI Sandbox, can perform data analysis, including in R. You can use AI to generate practice problems that help students learn how to use R for data analysis. Students can also ask GPT to help them understand the steps they'd need to take to complete these problem sets in R. ## activity 1. Log into chatGPT using the Harvard AI Sandbox ![alt text](https://files.slack.com/files-pri/T0HTW3H0V-F0612HG51ND/video_to_gif__6_..gif?pub_secret=4e1c91c9ce) 3. Log into chat-GPT directly through OpenAI in another window. 4. Before entering your prompt, remember: * If you only hit Enter or Return, this will automatically submit your prompt. * You can also add three ticks (''') to indicate a paragraph break if you prefer 5. In the Sandbox window, ask the following sequence of questions. * Can you give me some practice problems to help me get better using R for data analysis? * Can you suggest some problems using the built-in data sets? * Can you walk me through the steps for one of the suggested problems that involves a time series? * Note: The Sandbox will not be able to show you the output for each step due to its lack of the data analytics plugin. * but one possible use-case here is to use the Sandbox almost as a tutor bot that will *not* give students the answer (since it can't!) ![alt text](https://files.slack.com/files-pri/T0HTW3H0V-F068GJL4SKB/screenshot_2023-11-30_at_4.20.40_pm.png?pub_secret=bf82164f3d) 6. In the GPT-4 window, ask the same sequence of questions. 7. For further analysis, stay in the GPT-4 window. Ask it to: * Walk you through the steps for one of the suggested problems that involves a time series. * Note: GPT-4 can do this well because it has the data analytics plugin that the sandbox lacks By comparing the responses from both tools, you'll be able to see the difference in capabilities. --- ## TRANSCRIPT OF ACTIVITY EXAMPLE: ### GPT 4 1. Can you give me some practice problems to help me get better using R for data analysis? ![alt text](https://files.slack.com/files-pri/T0HTW3H0V-F0683SJAFJ7/screen_shot_2023-11-30_at_4.21.02_pm.png?pub_secret=8de5deaf91) 2. Can you suggest some problems using the built-in data sets? ![alt text](https://files.slack.com/files-pri/T0HTW3H0V-F06812U7JPP/screen_shot_2023-11-30_at_4.25.42_pm.png?pub_secret=74b62d22b2) ![alt text](https://files.slack.com/files-pri/T0HTW3H0V-F067PEM49M5/screen_shot_2023-11-30_at_4.26.27_pm.png?pub_secret=44b017f4f1) 3. Can you walk me through the steps for the 'airquality' dataset? ![alt text](https://files.slack.com/files-pri/T0HTW3H0V-F068GLXC0TB/screen_shot_2023-11-30_at_4.34.25_pm.png?pub_secret=1a862eba10) ![alt text](https://files.slack.com/files-pri/T0HTW3H0V-F067XCXP2BG/screen_shot_2023-11-30_at_4.34.42_pm.png?pub_secret=b4118df6e5) ![alt text](https://files.slack.com/files-pri/T0HTW3H0V-F06814DH8Q5/screen_shot_2023-11-30_at_4.34.50_pm.png?pub_secret=cbdca988ae) 4. Can you show me the output for each step so I can follow along? ![alt text](https://files.slack.com/files-pri/T0HTW3H0V-F068SUN6Y4Q/screenshot_2023-11-30_at_4.56.08_pm.png?pub_secret=e55754169c) ![alt text](https://files.slack.com/files-pri/T0HTW3H0V-F067PK7E1QX/screenshot_2023-11-30_at_4.56.21_pm.png?pub_secret=2346cd7ddb) ![alt text](https://files.slack.com/files-pri/T0HTW3H0V-F068SUNLGKA/screenshot_2023-11-30_at_4.56.27_pm.png?pub_secret=a1530df520) ### Sandbox * USER: * I am a professor teaching a statistics course focusing on the use of R. These are my requests: * Can you give me some practice problems to help me get better using R for data analysis? * Can you suggest some problems using the built-in data sets? * Can you walk me through the steps for one of the suggested problems that involves a time series? * AI: * Of course, I'd be happy to help. Here are some practice problems you can use to improve your skills in R for data analysis: * Load the "mtcars" dataset in R and perform a linear regression analysis. The goal is to predict mpg (miles per gallon) using the variables of cyl (number of cylinders), hp (horsepower), and wt (weight). * Use the "iris" dataset in R to perform a clustering analysis. Try to group the iris species based on sepal length and width, and petal length and width. * With the "airquality" dataset, perform a time series analysis on the daily average temperature. * Use the "USArrests" dataset to create a correlation matrix and visualize it using a heatmap. * Use the "mtcars" dataset again, but this time perform a logistic regression. The goal is to predict am (transmission type) using the variables of mpg and hp. * Now, let's walk through the steps for the time series analysis problem using the "airquality" dataset: * Load the "airquality" dataset: data("airquality") * Convert the dataset into a time series object. Since the data is recorded from May to September (5 months), we have a frequency of 153 (31 days in May, June, July, and August, plus 30 days in September): temp_ts <- ts(airquality$Temp, start = c(1973, 5), frequency = 153) * Plot the time series data: plot(temp_ts, main = "Daily Temperature Time Series", xlab = "Time", ylab = "Temperature") * Decompose the time series data into its components (trend, seasonal, and random): temp_decomp <- decompose(temp_ts) * Plot the decomposed time series data: plot(temp_decomp) * Forecast the future values using an ARIMA model. First, determine the best parameters (p, d, q) for the ARIMA model using the auto.arima() function from the "forecast" package. Then, use these parameters to fit the model: library(forecast); temp_arima <- auto.arima(temp_ts); forecast_temp <- forecast(temp_arima) * Plot the forecasted values: plot(forecast_temp) * Remember to interpret your results at each step. For example, in the decomposition step, you might observe a clear upward trend in temperature over the months, or a specific pattern repeating itself every month (seasonality). In the forecasting step, you might observe how the model expects the temperature to change in the future. ![alt text](https://files.slack.com/files-pri/T0HTW3H0V-F067PF1S7V5/screen_recording_to_gif__1_..gif?pub_secret=54a0c1309d)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully