StudentLife Stress Study

Author

Michael Chen

Setup

library(ggplot2)

stress_ema <- readRDS(
  "studentlife_data/dataset_rds/EMA/Stress.Rds"
)

stress_scale <- readRDS(
  "studentlife_data/dataset_rds/survey/PerceivedStressScale.Rds"
)

Data Cleaning

# Load stress EMA data
stress_ema <- readRDS(
  "~/studentlife_data/dataset_rds/EMA/Stress.Rds"
)

# Keep only valid stress responses
stress_clean <- stress_ema[
  stress_ema$null %in% c("1", "2", "3", "4", "5"),
]

# Convert response to numeric
stress_clean$stress <- as.numeric(stress_clean$null)

# Reverse the scale so higher = more stress
stress_clean$stress_score <- 6 - stress_clean$stress

# Convert Unix timestamp to date/time
stress_clean$datetime <- as.POSIXct(
  stress_clean$timestamp,
  origin = "1970-01-01",
  tz = "America/New_York"
)

# Remove unnecessary columns
stress_clean$null <- NULL
stress_clean$timestamp <- NULL
pss_score <- function(x) {
  c(
    "Never" = 0,
    "Almost never" = 1,
    "Sometime" = 2,
    "Fairly often" = 3,
    "Very often" = 4
  )[as.character(x)]
}

stress_scale$Q1_score <- pss_score(stress_scale$Q1)
stress_scale$Q2_score <- pss_score(stress_scale$Q2)
stress_scale$Q3_score <- pss_score(stress_scale$Q3)
stress_scale$Q4_score <- pss_score(stress_scale$Q4)
stress_scale$Q5_score <- pss_score(stress_scale$Q5)
stress_scale$Q6_score <- pss_score(stress_scale$Q6)
stress_scale$Q7_score <- pss_score(stress_scale$Q7)
stress_scale$Q8_score <- pss_score(stress_scale$Q8)
stress_scale$Q9_score <- pss_score(stress_scale$Q9)
stress_scale$Q10_score <- pss_score(stress_scale$Q10)

stress_scale$Q4_score <- 4 - stress_scale$Q4_score
stress_scale$Q5_score <- 4 - stress_scale$Q5_score
stress_scale$Q7_score <- 4 - stress_scale$Q7_score
stress_scale$Q8_score <- 4 - stress_scale$Q8_score

stress_scale$PSS_total <- rowSums(
  stress_scale[, paste0("Q", 1:10, "_score")],
  na.rm = TRUE
)

head(stress_scale[, c("uid", "type", "PSS_total")])
# A tibble: 6 × 3
  uid   type  PSS_total
  <fct> <fct>     <dbl>
1 0     pre          24
2 1     pre          15
3 2     pre          21
4 3     pre          17
5 4     pre          21
6 5     pre           7
ggplot(stress_scale, aes(x = PSS_total)) +
  geom_histogram(
    binwidth = 2,
    color = "black"
  ) +
  labs(
    title = "Distribution of Perceived Stress Scores",
    x = "PSS Total Score",
    y = "Number of Participants"
  ) +
  theme_minimal()

summary(stress_scale$PSS_total)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
   3.00   14.00   18.00   18.47   23.00   34.00 
hist(stress_scale$PSS_total)

Introduction

[placeholder]

Stress is a common experience that can affect individuals’ mental well-being, behavior, academic performance, and daily routines. Although stress can be difficult to measure directly, changes in everyday behaviors and physiological patterns may provide useful information about an individual’s level of perceived stress. Understanding these relationships could help identify factors that are associated with higher stress and reveal patterns that may not be apparent from a single measurement.

This study uses the StudentLife dataset to investigate how behavioral and contextual factors relate to perceived stress over time. Rather than examining stress at only one point in time, the longitudinal nature of the dataset allows patterns to be analyzed across approximately ten weeks. The primary objective is to determine which measurable factors are associated with higher perceived stress and whether these factors can be used to predict differences in stress between individuals. Statistical analysis and machine-learning techniques will be used to evaluate these relationships.

Data Collection

The data used in this study comes from the StudentLife study conducted at Dartmouth College. The study followed 48 university students over a 10-week academic term while collecting information about their daily activities and well-being. Participants’ smartphones were used to passively collect behavioral and contextual data throughout the study, allowing researchers to observe patterns in participants’ daily lives without requiring them to manually record every activity.

The collected data included measures related to physical activity, mobility, sleep, phone usage, and social behavior. Participants also periodically completed surveys assessing psychological and behavioral factors, including perceived stress, mood, and other aspects of well-being. This combination of passive sensing and self-reported information provides both objective behavioral measurements and subjective measures of participants’ experiences.

Findings and Insights