Question 2

This question asks us to access the CryptoCompare API, extract the last 100 days of BTC–USD daily OHLCV data, and find the maximum daily close price.

# Install if needed
# install.packages("jsonlite")

library(jsonlite)

# API URL for last 100 days of Bitcoin in USD
url <- "https://min-api.cryptocompare.com/data/v2/histoday?fsym=BTC&tsym=USD&limit=100"

# Read JSON data
btc_raw <- fromJSON(url)

# Extract data frame
btc_data <- btc_raw$Data$Data

# Maximum closing price
max_close <- max(btc_data$close, na.rm = TRUE)
max_close

Question 3

Project Title:

Factors Influencing College Graduate Earnings

1. Topic of Interest

This project explores how college characteristics—such as tuition, graduation rate, student debt, admission rate, and school type—relate to early-career earnings after graduation.

2. Research Questions

  • How does tuition cost relate to graduates’ early-career earnings?
  • Are schools with higher graduation rates associated with higher earnings?
  • Does higher student debt predict higher or lower earnings?
  • Do public and private schools differ in graduate earnings?
  • Which school characteristics best predict strong earnings?

3. Dataset + Extraction

We use the U.S. Department of Education College Scorecard dataset.
Download from: https://collegescorecard.ed.gov/data/

library(tidyverse)

# Load dataset
college <- read_csv("Most-Recent-Cohorts-Scorecard-Elements.csv")

# Select and clean relevant columns
college_clean <- college %>%
  select(INSTNM, STABBR, CONTROL, ADM_RATE, GRAD_RATE,
         COSTT4_A, DEBT_MDN, MD_EARN_WNE_P6) %>%
  mutate(
    ADM_RATE = as.numeric(ADM_RATE),
    GRAD_RATE = as.numeric(GRAD_RATE),
    COSTT4_A = as.numeric(COSTT4_A),
    DEBT_MDN = as.numeric(DEBT_MDN),
    MD_EARN_WNE_P6 = as.numeric(MD_EARN_WNE_P6)
  ) %>%
  filter(
    !is.na(ADM_RATE),
    !is.na(GRAD_RATE),
    !is.na(COSTT4_A),
    !is.na(DEBT_MDN),
    !is.na(MD_EARN_WNE_P6)
  )

# Summary stats
summary(college_clean)

# Correlation matrix
college_clean %>%
  select(ADM_RATE, GRAD_RATE, COSTT4_A, DEBT_MDN, MD_EARN_WNE_P6) %>%
  cor(use = "complete.obs")

4. Visualization

library(ggplot2)

ggplot(college_clean, aes(x = COSTT4_A, y = MD_EARN_WNE_P6)) +
  geom_point(alpha = 0.3) +
  labs(title = "Tuition vs Graduate Earnings",
       x = "Tuition Cost (Annual)",
       y = "Median Earnings")