Examining the relationship between frequency of sleep hygiene behaviors and MUSE-S sleep score

Author
Affiliation

Danica Lyktey

Published

November 3, 2025

Abstract

Mental ill-health is a rising problem, specifically among university students. It has been shown that quality sleep and good sleep hygiene practices can act as protective factors against mental ill-health, while poor sleep quality and poor sleep hygiene practices can act as risk factors for mental ill-health. However, there is not much established research on the relationship between the variables, especially utilizing objective, non-self-report measures of sleep quality. This study aims to explore that relationship in a sample of college students at a public education institution in New York enrolled in high-stress research programs. The primary research question this study aims to address is: What is the relationship between frequency of sleep hygiene behaviors and MUSE-S sleep score? Participants completed a pre-assessment survey, using a 12-item version of the 19-item Sleep Hygiene Questionnaire (Gellis & Lichstein, 2009). They then wore a MUSE-S sleep headband for 7 nights, using a daily survey to self-report their sleep score as a measure of sleep quality. They then completed the post-assessment to examine self-reported sleep hygiene over the participation period. No significant association was found between select sleep hygiene behaviors and sleep score, going against the theory driving the study. The small sample size of this study and the limited scope of students in a specific program at a specific university limit the generalizability of these results and indicate areas for improvement in future studies that may lead to different results.

Keywords

sleep hygiene, MUSE headband, sleep score, college students, lifestyle mental health

1 Results

1.1 Load

library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr     1.1.4     ✔ readr     2.1.5
✔ forcats   1.0.1     ✔ stringr   1.5.2
✔ ggplot2   4.0.0     ✔ tibble    3.3.0
✔ lubridate 1.9.4     ✔ tidyr     1.3.1
✔ purrr     1.1.0     
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(psych)

Attaching package: 'psych'

The following objects are masked from 'package:ggplot2':

    %+%, alpha
library(knitr)
library(tibble)
library(dplyr)
library(tidyr)
library(scales)     # for number formatting like comma()

Attaching package: 'scales'

The following objects are masked from 'package:psych':

    alpha, rescale

The following object is masked from 'package:purrr':

    discard

The following object is masked from 'package:readr':

    col_factor
library(english)    # to convert numbers to words

Attaching package: 'english'

The following object is masked from 'package:scales':

    ordinal
library(stringr)    # for text functions like str_c()

#source: Importing Data Once (Hei & McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/import-once.html
# question: but will this mess with my lab results?

rm(list = ls())

#source: Quarto Markdown Document (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/codechunks.html

1.2 Import

1.2.1 Day 1 & 7

library(readxl)
# Import Excel file
day17data <- read_excel(
    "10.20.2025.day17data.team2.clean.xlsx",
    col_names = TRUE)
New names:
• `` -> `...1`
day17data[day17data == -99] <- NA
day17data[day17data == -50] <- NA

#source: Importing Data Once (Hei & McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/import-once.html
#explanation: all -99 and -50 data will be treated as missing data

1.2.2 Daily

library(readxl)
# Import Excel file
dailydata <- read_excel(
    "10.20.2025.dailydata.team2.clean.xlsx",
    col_names = TRUE)
New names:
• `HEARTRATE` -> `HEARTRATE...39`
• `HEARTRATE` -> `HEARTRATE...43`
dailydata[dailydata == -99] <- NA
dailydata[dailydata == -50] <- NA

#source: Importing Data Once (Hei & McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/import-once.html
#explanation: all -99 and -50 data will be treated as missing data

1.3 Tidy

1.3.1 Convert Long to Wide for Day 1 & 7 Surveys

library(tidyr)

## Convert to wide format
wide_17data <- day17data %>%
  pivot_wider(
    id_cols = PASSWORD,
    names_from = SURVEYDAY, 
    values_from = c(`SH _8`, `SH_9`, `SH_10`, `SH _11`, `SH _12`, `SH _13`, `SH _14`, `SH _15`, `SH_16`, `SH _17`, `SH_18`, `SH _19`), 
    names_glue = "{.value}_T{SURVEYDAY}" 
  )
Warning: Values from `SH _11`, `SH _12`, `SH _13`, `SH _14`, `SH _15`, `SH _17`, `SH
_19`, `SH _8`, `SH_10`, `SH_16`, `SH_18` and `SH_9` are not uniquely
identified; output will contain list-cols.
• Use `values_fn = list` to suppress this warning.
• Use `values_fn = {summary_fun}` to summarise duplicates.
• Use the following dplyr code to identify duplicates.
  {data} |>
  dplyr::summarise(n = dplyr::n(), .by = c(PASSWORD, SURVEYDAY)) |>
  dplyr::filter(n > 1L)
#source: Tidying your Data (McCarty et. al., 2025): https://shanemccarty.github.io/FRIplaybook/tidyr.html

1.3.2 Convert Long to Wide for Daily Survey

library(tidyr)

## Convert to wide format
wide_dailydata <- dailydata %>%
  pivot_wider(
    id_cols = PASSWORD,
    names_from = DAY,
    values_from = c(SLEEPSCORE), 
    names_glue = "{.value}_T{DAY}" 
  )
Warning: Values from `SLEEPSCORE` are not uniquely identified; output will contain
list-cols.
• Use `values_fn = list` to suppress this warning.
• Use `values_fn = {summary_fun}` to summarise duplicates.
• Use the following dplyr code to identify duplicates.
  {data} |>
  dplyr::summarise(n = dplyr::n(), .by = c(PASSWORD, DAY)) |>
  dplyr::filter(n > 1L)
#source: Tidying your Data (McCarty et. al., 2025): https://shanemccarty.github.io/FRIplaybook/tidyr.html

1.4 Import

1.4.1 Clean Daily Data

library(readxl)
# Import Excel file
wide_dailydata_clean <- read_excel(
    "wide_dailydata_clean.xlsx",
    col_names = TRUE)

#source: Importing Data Once (Hei & McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/import-once.html
#explanation: all -99 and -50 data will be treated as missing data

1.5 Tidy

1.5.1 Remove Spaces from Variable Names for Wide 1/7 Data

names(wide_17data) <- gsub(" ", "", names(wide_17data))

#source: Wickham, Hadley & Grolemund, Garrett. R for Data Science (2e) — Chapter 12: “Tibbles.”

1.6 Transform

1.6.1 Create Composite Scores for SH T1 and T2

library(psych)
SH_T1_keys <- list(
  SLEEPHYGIENE_T1 = c("SH_8_T1", "SH_9_T1", "SH_10_T1", "SH_11_T1", "SH_12_T1", "SH_13_T1", "SH_14_T1", "SH_15_T1", "SH_16_T1", "SH_17_T1", "SH_18_T1", "SH_19_T1")
)

#source: Creating Composite Scorex from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html
#explanation: create keys for scoring
library(psych)
SH_T2_keys <- list(
  SLEEPHYGIENE_T2 = c("SH_8_T2", "SH_9_T2", "SH_10_T2", "SH_10_T2", "SH_12_T2", "SH_13_T2", "SH_14_T2", "SH_15_T2", "SH_16_T2", "SH_17_T2", "SH_18_T2", "SH_19_T2")
)

#source: Creating Composite Scorex from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html
#explanation: create keys for scoring
library(readxl)
library(dplyr)

#| label: join-datasets

# source: https://dplyr.tidyverse.org/reference/mutate-joins.html

#day17data ## primary - Day 1/7
#wide_dailydata_clean ## secondary - daily


# Select only the variables you need from secondary dataset, then join
combined <- wide_17data %>%
  left_join(
    wide_dailydata_clean %>% select("PASSWORD", "SLEEPSCORE_T1", "SLEEPSCORE_T2", "SLEEPSCORE_T3", "SLEEPSCORE_T4", "SLEEPSCORE_T5", "SLEEPSCORE_T6", "SLEEPSCORE_T7"),
    by = "PASSWORD"
  )
combined <- combined %>%
  mutate(across(starts_with("SH_"), ~ map_dbl(., ~ ifelse(is.null(.x), NA, .x))))

#source: https://dcl-prog.stanford.edu/list-columns.html
#explanation: was having some trouble with the score items and I ran a summary and saw that it was because my columns were consisiting of lists and not numeric vectors, so I looked up some sources and it told me to run this code — I hope that is okay!
names(combined) <- gsub(" ", "", names(combined))

#source: Wickham, Hadley & Grolemund, Garrett. R for Data Science (2e) — Chapter 12: “Tibbles.”
library(psych)
# Using scoreItems() - recommended: SH_T1

SH_T1_scores <- scoreItems(SH_T1_keys, combined)

#source: Creating Composite Scores from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html
library(psych)
# Using scoreItems() - recommended: SH_T2

SH_T2_scores <- scoreItems(SH_T2_keys, combined)

#source: Creating Composite Scores from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html
library(psych)
# Extract
composite_T1_scores <- SH_T1_scores$scores

#source: Creating Composite Scores from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html
library(psych)
# Extract
composite_T2_scores <- SH_T2_scores$scores

#source: Creating Composite Scores from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html
# Add to dataframe
combined$SH_T1 <- composite_T1_scores[, "SLEEPHYGIENE_T1"]

#source: Creating Composite Scores from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html
# Add to dataframe
combined$SH_T2 <- composite_T2_scores[, "SLEEPHYGIENE_T2"]

#source: Creating Composite Scores from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html
scoreItems(keys = SH_T1_keys, items = combined)
Call: scoreItems(keys = SH_T1_keys, items = combined)

(Unstandardized) Alpha:
      SLEEPHYGIENE_T1
alpha            0.52

Standard errors of unstandardized Alpha:
      SLEEPHYGIENE_T1
ASE              0.12

Average item correlation:
          SLEEPHYGIENE_T1
average.r           0.084

Median item correlation:
SLEEPHYGIENE_T1 
          0.083 

 Guttman 6* reliability: 
         SLEEPHYGIENE_T1
Lambda.6            0.65

Signal/Noise based upon av.r : 
             SLEEPHYGIENE_T1
Signal/Noise             1.1

Scale intercorrelations corrected for attenuation 
 raw correlations below the diagonal, alpha on the diagonal 
 corrected correlations above the diagonal:
                SLEEPHYGIENE_T1
SLEEPHYGIENE_T1            0.52

 Average adjusted correlations within and between scales (MIMS)
[1] 0.08

 Average adjusted item x scale correlations within and between scales (MIMT)
[1] 0.4

 In order to see the item by scale loadings and frequency counts of the data
 print with the short option = FALSE
#source: Creating Composite Scores from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html
scoreItems(keys = SH_T2_keys, items = combined)
Call: scoreItems(keys = SH_T2_keys, items = combined)

(Unstandardized) Alpha:
      SLEEPHYGIENE_T2
alpha             0.7

Standard errors of unstandardized Alpha:
      SLEEPHYGIENE_T2
ASE             0.085

Average item correlation:
          SLEEPHYGIENE_T2
average.r            0.18

Median item correlation:
SLEEPHYGIENE_T2 
           0.17 

 Guttman 6* reliability: 
         SLEEPHYGIENE_T2
Lambda.6            0.84

Signal/Noise based upon av.r : 
             SLEEPHYGIENE_T2
Signal/Noise             2.4

Scale intercorrelations corrected for attenuation 
 raw correlations below the diagonal, alpha on the diagonal 
 corrected correlations above the diagonal:
                SLEEPHYGIENE_T2
SLEEPHYGIENE_T2             0.7

 Average adjusted correlations within and between scales (MIMS)
[1] 0.18

 Average adjusted item x scale correlations within and between scales (MIMT)
[1] 0.51

 In order to see the item by scale loadings and frequency counts of the data
 print with the short option = FALSE
#source: Creating Composite Scores from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html

1.6.2 Sleep Hygiene Items at T1 and T2

#| label: transform-SH_8_T1

combined <- combined %>% filter(!is.na(SH_8_T1)) %>%
  mutate(
    SH_8_T1 == case_when(
      SH_8_T1 == 0 ~ "0 Days",
      SH_8_T1 == 1 ~ "1 Day",
      SH_8_T1 == 2 ~ "2 Days",
      SH_8_T1 == 3 ~ "3 Days",
      SH_8_T1 == 4 ~ "4 Days",
      SH_8_T1 == 5 ~ "5 Days",
      SH_8_T1 == 6 ~ "6 Days",
      SH_8_T1 == 7 ~ "7 Days"
    )
    
  )

# source: https://fripublichealth.quarto.pub/zerosum/report-preview.html#introduction, r manual
combined <- combined %>% filter(!is.na(SH_8_T2)) %>%
  mutate(
    SH_8_T2 == case_when(
      SH_8_T2 == 0 ~ "0 Days",
      SH_8_T2 == 1 ~ "1 Day",
      SH_8_T2 == 2 ~ "2 Days",
      SH_8_T2 == 3 ~ "3 Days",
      SH_8_T2 == 4 ~ "4 Days",
      SH_8_T2 == 5 ~ "5 Days",
      SH_8_T2 == 6 ~ "6 Days",
      SH_8_T2 == 7 ~ "7 Days"
    )
    
  )

# source: https://fripublichealth.quarto.pub/zerosum/report-preview.html#introduction, r manual
combined <- combined %>% filter(!is.na(SH_9_T1)) %>%
  mutate(
    SH_9_T1 == case_when(
      SH_9_T1 == 0 ~ "0 Days",
      SH_9_T1 == 1 ~ "1 Day",
      SH_9_T1 == 2 ~ "2 Days",
      SH_9_T1 == 3 ~ "3 Days",
      SH_9_T1 == 4 ~ "4 Days",
      SH_9_T1 == 5 ~ "5 Days",
      SH_9_T1 == 6 ~ "6 Days",
      SH_9_T1 == 7 ~ "7 Days"
    )
    
  )

# source: https://fripublichealth.quarto.pub/zerosum/report-preview.html#introduction, r manual
combined <- combined %>% filter(!is.na(SH_9_T2)) %>%
  mutate(
    SH_9_T2 == case_when(
      SH_9_T2 == 0 ~ "0 Days",
      SH_9_T2 == 1 ~ "1 Day",
      SH_9_T2 == 2 ~ "2 Days",
      SH_9_T2 == 3 ~ "3 Days",
      SH_9_T2 == 4 ~ "4 Days",
      SH_9_T2 == 5 ~ "5 Days",
      SH_9_T2 == 6 ~ "6 Days",
      SH_9_T2 == 7 ~ "7 Days"
    )
    
  )

# source: https://fripublichealth.quarto.pub/zerosum/report-preview.html#introduction, r manual
combined <- combined %>% filter(!is.na(SH_10_T1)) %>%
  mutate(
    SH_10_T1 == case_when(
      SH_10_T1 == 0 ~ "0 Days",
      SH_10_T1 == 1 ~ "1 Day",
      SH_10_T1 == 2 ~ "2 Days",
      SH_10_T1 == 3 ~ "3 Days",
      SH_10_T1 == 4 ~ "4 Days",
      SH_10_T1 == 5 ~ "5 Days",
      SH_10_T1 == 6 ~ "6 Days",
      SH_10_T1 == 7 ~ "7 Days"
    )
    
  )

# source: https://fripublichealth.quarto.pub/zerosum/report-preview.html#introduction, r manual
combined <- combined %>% filter(!is.na(SH_10_T2)) %>%
  mutate(
    SH_10_T2 == case_when(
      SH_10_T2 == 0 ~ "0 Days",
      SH_10_T2 == 1 ~ "1 Day",
      SH_10_T2 == 2 ~ "2 Days",
      SH_10_T2 == 3 ~ "3 Days",
      SH_10_T2 == 4 ~ "4 Days",
      SH_10_T2 == 5 ~ "5 Days",
      SH_10_T2 == 6 ~ "6 Days",
      SH_10_T2 == 7 ~ "7 Days"
    )
    
  )

# source: https://fripublichealth.quarto.pub/zerosum/report-preview.html#introduction, r manual
combined <- combined %>% filter(!is.na(SH_11_T1)) %>%
  mutate(
    SH_11_T1 == case_when(
      SH_11_T1 == 0 ~ "0 Days",
      SH_11_T1 == 1 ~ "1 Day",
      SH_11_T1 == 2 ~ "2 Days",
      SH_11_T1 == 3 ~ "3 Days",
      SH_11_T1 == 4 ~ "4 Days",
      SH_11_T1 == 5 ~ "5 Days",
      SH_11_T1 == 6 ~ "6 Days",
      SH_11_T1 == 7 ~ "7 Days"
    )
    
  )

# source: https://fripublichealth.quarto.pub/zerosum/report-preview.html#introduction, r manual
combined <- combined %>% filter(!is.na(SH_11_T2)) %>%
  mutate(
    SH_11_T2 == case_when(
      SH_11_T2 == 0 ~ "0 Days",
      SH_11_T2 == 1 ~ "1 Day",
      SH_11_T2 == 2 ~ "2 Days",
      SH_11_T2 == 3 ~ "3 Days",
      SH_11_T2 == 4 ~ "4 Days",
      SH_11_T2 == 5 ~ "5 Days",
      SH_11_T2 == 6 ~ "6 Days",
      SH_11_T2 == 7 ~ "7 Days"
    )
    
  )

# source: https://fripublichealth.quarto.pub/zerosum/report-preview.html#introduction, r manual
combined <- combined %>% filter(!is.na(SH_12_T1)) %>%
  mutate(
    SH_12_T1 == case_when(
      SH_12_T1 == 0 ~ "0 Days",
      SH_12_T1 == 1 ~ "1 Day",
      SH_12_T1 == 2 ~ "2 Days",
      SH_12_T1 == 3 ~ "3 Days",
      SH_12_T1 == 4 ~ "4 Days",
      SH_12_T1 == 5 ~ "5 Days",
      SH_12_T1 == 6 ~ "6 Days",
      SH_12_T1 == 7 ~ "7 Days"
    )
    
  )

# source: https://fripublichealth.quarto.pub/zerosum/report-preview.html#introduction, r manual
combined <- combined %>% filter(!is.na(SH_12_T2)) %>%
  mutate(
    SH_12_T2 == case_when(
      SH_12_T2 == 0 ~ "0 Days",
      SH_12_T2 == 1 ~ "1 Day",
      SH_12_T2 == 2 ~ "2 Days",
      SH_12_T2 == 3 ~ "3 Days",
      SH_12_T2 == 4 ~ "4 Days",
      SH_12_T2 == 5 ~ "5 Days",
      SH_12_T2 == 6 ~ "6 Days",
      SH_12_T2 == 7 ~ "7 Days"
    )
    
  )

# source: https://fripublichealth.quarto.pub/zerosum/report-preview.html#introduction, r manual
combined <- combined %>% filter(!is.na(SH_13_T1)) %>%
  mutate(
    SH_13_T1 == case_when(
      SH_13_T1 == 0 ~ "0 Days",
      SH_13_T1 == 1 ~ "1 Day",
      SH_13_T1 == 2 ~ "2 Days",
      SH_13_T1 == 3 ~ "3 Days",
      SH_13_T1 == 4 ~ "4 Days",
      SH_13_T1 == 5 ~ "5 Days",
      SH_13_T1 == 6 ~ "6 Days",
      SH_13_T1 == 7 ~ "7 Days"
    )
    
  )

# source: https://fripublichealth.quarto.pub/zerosum/report-preview.html#introduction, r manual
combined <- combined %>% filter(!is.na(SH_13_T2)) %>%
  mutate(
    SH_13_T2 == case_when(
      SH_13_T2 == 0 ~ "0 Days",
      SH_13_T2 == 1 ~ "1 Day",
      SH_13_T2 == 2 ~ "2 Days",
      SH_13_T2 == 3 ~ "3 Days",
      SH_13_T2 == 4 ~ "4 Days",
      SH_13_T2 == 5 ~ "5 Days",
      SH_13_T2 == 6 ~ "6 Days",
      SH_13_T2 == 7 ~ "7 Days"
    )
    
  )

# source: https://fripublichealth.quarto.pub/zerosum/report-preview.html#introduction, r manual
combined <- combined %>% filter(!is.na(SH_14_T1)) %>%
  mutate(
    SH_14_T1 == case_when(
      SH_14_T1 == 0 ~ "0 Days",
      SH_14_T1 == 1 ~ "1 Day",
      SH_14_T1 == 2 ~ "2 Days",
      SH_14_T1 == 3 ~ "3 Days",
      SH_14_T1 == 4 ~ "4 Days",
      SH_14_T1 == 5 ~ "5 Days",
      SH_14_T1 == 6 ~ "6 Days",
      SH_14_T1 == 7 ~ "7 Days"
    )
    
  )

# source: https://fripublichealth.quarto.pub/zerosum/report-preview.html#introduction, r manual
combined <- combined %>% filter(!is.na(SH_14_T2)) %>%
  mutate(
    SH_14_T2 == case_when(
      SH_14_T2 == 0 ~ "0 Days",
      SH_14_T2 == 1 ~ "1 Day",
      SH_14_T2 == 2 ~ "2 Days",
      SH_14_T2 == 3 ~ "3 Days",
      SH_14_T2 == 4 ~ "4 Days",
      SH_14_T2 == 5 ~ "5 Days",
      SH_14_T2 == 6 ~ "6 Days",
      SH_14_T2 == 7 ~ "7 Days"
    )
    
  )

# source: https://fripublichealth.quarto.pub/zerosum/report-preview.html#introduction, r manual
combined <- combined %>% filter(!is.na(SH_15_T1)) %>%
  mutate(
    SH_15_T1 == case_when(
      SH_15_T1 == 0 ~ "0 Days",
      SH_15_T1 == 1 ~ "1 Day",
      SH_15_T1 == 2 ~ "2 Days",
      SH_15_T1 == 3 ~ "3 Days",
      SH_15_T1 == 4 ~ "4 Days",
      SH_15_T1 == 5 ~ "5 Days",
      SH_15_T1 == 6 ~ "6 Days",
      SH_15_T1 == 7 ~ "7 Days"
    )
    
  )

# source: https://fripublichealth.quarto.pub/zerosum/report-preview.html#introduction, r manual
combined <- combined %>% filter(!is.na(SH_15_T2)) %>%
  mutate(
    SH_15_T2 == case_when(
      SH_15_T2 == 0 ~ "0 Days",
      SH_15_T2 == 1 ~ "1 Day",
      SH_15_T2 == 2 ~ "2 Days",
      SH_15_T2 == 3 ~ "3 Days",
      SH_15_T2 == 4 ~ "4 Days",
      SH_15_T2 == 5 ~ "5 Days",
      SH_15_T2 == 6 ~ "6 Days",
      SH_15_T2 == 7 ~ "7 Days"
    )
    
  )

# source: https://fripublichealth.quarto.pub/zerosum/report-preview.html#introduction, r manual
combined <- combined %>% filter(!is.na(SH_16_T1)) %>%
  mutate(
    SH_16_T1 == case_when(
      SH_16_T1 == 0 ~ "0 Days",
      SH_16_T1 == 1 ~ "1 Day",
      SH_16_T1 == 2 ~ "2 Days",
      SH_16_T1 == 3 ~ "3 Days",
      SH_16_T1 == 4 ~ "4 Days",
      SH_16_T1 == 5 ~ "5 Days",
      SH_16_T1 == 6 ~ "6 Days",
      SH_16_T1 == 7 ~ "7 Days"
    )
    
  )

# source: https://fripublichealth.quarto.pub/zerosum/report-preview.html#introduction, r manual
combined <- combined %>% filter(!is.na(SH_16_T2)) %>%
  mutate(
    SH_16_T2 == case_when(
      SH_16_T2 == 0 ~ "0 Days",
      SH_16_T2 == 1 ~ "1 Day",
      SH_16_T2 == 2 ~ "2 Days",
      SH_16_T2 == 3 ~ "3 Days",
      SH_16_T2 == 4 ~ "4 Days",
      SH_16_T2 == 5 ~ "5 Days",
      SH_16_T2 == 6 ~ "6 Days",
      SH_16_T2 == 7 ~ "7 Days"
    )
    
  )

# source: https://fripublichealth.quarto.pub/zerosum/report-preview.html#introduction, r manual
combined <- combined %>% filter(!is.na(SH_17_T1)) %>%
  mutate(
    SH_17_T1 == case_when(
      SH_17_T1 == 0 ~ "0 Days",
      SH_17_T1 == 1 ~ "1 Day",
      SH_17_T1 == 2 ~ "2 Days",
      SH_17_T1 == 3 ~ "3 Days",
      SH_17_T1 == 4 ~ "4 Days",
      SH_17_T1 == 5 ~ "5 Days",
      SH_17_T1 == 6 ~ "6 Days",
      SH_17_T1 == 7 ~ "7 Days"
    )
    
  )

# source: https://fripublichealth.quarto.pub/zerosum/report-preview.html#introduction, r manual
combined <- combined %>% filter(!is.na(SH_17_T2)) %>%
  mutate(
    SH_17_T2 == case_when(
      SH_17_T2 == 0 ~ "0 Days",
      SH_17_T2 == 1 ~ "1 Day",
      SH_17_T2 == 2 ~ "2 Days",
      SH_17_T2 == 3 ~ "3 Days",
      SH_17_T2 == 4 ~ "4 Days",
      SH_17_T2 == 5 ~ "5 Days",
      SH_17_T2 == 6 ~ "6 Days",
      SH_17_T2 == 7 ~ "7 Days"
    )
    
  )

# source: https://fripublichealth.quarto.pub/zerosum/report-preview.html#introduction, r manual
combined <- combined %>% filter(!is.na(SH_18_T1)) %>%
  mutate(
    SH_18_T1 == case_when(
      SH_18_T1 == 0 ~ "0 Days",
      SH_18_T1 == 1 ~ "1 Day",
      SH_18_T1 == 2 ~ "2 Days",
      SH_18_T1 == 3 ~ "3 Days",
      SH_18_T1 == 4 ~ "4 Days",
      SH_18_T1 == 5 ~ "5 Days",
      SH_18_T1 == 6 ~ "6 Days",
      SH_18_T1 == 7 ~ "7 Days"
    )
    
  )

# source: https://fripublichealth.quarto.pub/zerosum/report-preview.html#introduction, r manual
combined <- combined %>% filter(!is.na(SH_18_T2)) %>%
  mutate(
    SH_18_T2 == case_when(
      SH_18_T2 == 0 ~ "0 Days",
      SH_18_T2 == 1 ~ "1 Day",
      SH_18_T2 == 2 ~ "2 Days",
      SH_18_T2 == 3 ~ "3 Days",
      SH_18_T2 == 4 ~ "4 Days",
      SH_18_T2 == 5 ~ "5 Days",
      SH_18_T2 == 6 ~ "6 Days",
      SH_18_T2 == 7 ~ "7 Days"
    )
    
  )

# source: https://fripublichealth.quarto.pub/zerosum/report-preview.html#introduction, r manual
combined <- combined %>% filter(!is.na(SH_19_T1)) %>%
  mutate(
    SH_19_T1 == case_when(
      SH_19_T1 == 0 ~ "0 Days",
      SH_19_T1 == 1 ~ "1 Day",
      SH_19_T1 == 2 ~ "2 Days",
      SH_19_T1 == 3 ~ "3 Days",
      SH_19_T1 == 4 ~ "4 Days",
      SH_19_T1 == 5 ~ "5 Days",
      SH_19_T1 == 6 ~ "6 Days",
      SH_19_T1 == 7 ~ "7 Days"
    )
    
  )

# source: https://fripublichealth.quarto.pub/zerosum/report-preview.html#introduction, r manual
combined <- combined %>% filter(!is.na(SH_19_T2)) %>%
  mutate(
    SH_19_T2 == case_when(
      SH_19_T2 == 0 ~ "0 Days",
      SH_19_T2 == 1 ~ "1 Day",
      SH_19_T2 == 2 ~ "2 Days",
      SH_19_T2 == 3 ~ "3 Days",
      SH_19_T2 == 4 ~ "4 Days",
      SH_19_T2 == 5 ~ "5 Days",
      SH_19_T2 == 6 ~ "6 Days",
      SH_19_T2 == 7 ~ "7 Days"
    )
    
  )

# source: https://fripublichealth.quarto.pub/zerosum/report-preview.html#introduction, r manual

1.6.3 Remove NAs

combined[combined == "NA"] <- NA

#source: https://stackoverflow.com/questions/3357743/replacing-character-values-with-na-in-a-data-frame

1.6.4 Create Composite Score for Sleep Scores

library(psych)
SLEEPSCORE_keys <- list(
  SLEEPSCORE = c("SLEEPSCORE_T2", "SLEEPSCORE_T3", "SLEEPSCORE_T4", "SLEEPSCORE_T5", "SLEEPSCORE_T6", "SLEEPSCORE_T7")
)

#source: Creating Composite Scorex from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html
#explanation: create keys for scoring
#note: remove T1 because all NAs
combined[unlist(SLEEPSCORE_keys)] <- lapply(combined[unlist(SLEEPSCORE_keys)], function(x) as.numeric(as.character(x)))

#source: https://r4ds.hadley.nz/data-transform.html
#explanation: listed as scaharcter vectors, so scoreitems wouldn't run until I fixed this
library(psych)
# Using scoreItems() - recommended: SLEEPSCORE

SLEEPSCORE_scores <- scoreItems(SLEEPSCORE_keys, combined)
Number of categories should be increased  in order to count frequencies. 
#source: Creating Composite Scores from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html
library(psych)
# Extract
composite_SLEEPSCORE_scores <- SLEEPSCORE_scores$scores

#source: Creating Composite Scores from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html
# Add to dataframe
combined$SLEEPSCORE <- composite_SLEEPSCORE_scores[, "SLEEPSCORE"]

#source: Creating Composite Scores from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html
scoreItems(keys = SLEEPSCORE_keys, items = combined)
Number of categories should be increased  in order to count frequencies. 
Call: scoreItems(keys = SLEEPSCORE_keys, items = combined)

(Unstandardized) Alpha:
      SLEEPSCORE
alpha       0.52

Standard errors of unstandardized Alpha:
      SLEEPSCORE
ASE         0.22

Average item correlation:
          SLEEPSCORE
average.r       0.15

Median item correlation:
SLEEPSCORE 
      0.16 

 Guttman 6* reliability: 
         SLEEPSCORE
Lambda.6       0.61

Signal/Noise based upon av.r : 
             SLEEPSCORE
Signal/Noise        1.1

Scale intercorrelations corrected for attenuation 
 raw correlations below the diagonal, alpha on the diagonal 
 corrected correlations above the diagonal:
           SLEEPSCORE
SLEEPSCORE       0.52

 Average adjusted correlations within and between scales (MIMS)
[1] 0.15

 Average adjusted item x scale correlations within and between scales (MIMT)
[1] 0.56

 In order to see the item by scale loadings and frequency counts of the data
 print with the short option = FALSE
#source: Creating Composite Scores from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html

1.6.5 Visualize Normality Histograms for SH T1 and T2 and Sleep Score

library(ggplot2)
ggplot(combined, mapping = aes(x = SH_T1)) +
  geom_histogram(binwidth = 1, color = "black")

# source: datacamp, ggplot2 cheat sheet
library(ggplot2)
ggplot(combined, mapping = aes(x = SH_T2)) +
  geom_histogram(binwidth = 1, color = "black")

# source: datacamp, ggplot2 cheat sheet
library(ggplot2)
ggplot(combined, mapping = aes(x = SLEEPSCORE)) +
  geom_histogram(binwidth = 1, color = "black")

# source: datacamp, ggplot2 cheat sheet

1.7 Visualize

1.7.1 SH T1 vs. SH T2

ggplot(data = combined,
       mapping = aes(
         x = SH_T1,
         y = SH_T2)) +
  geom_point(position = "jitter") +
  geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'

# source: datacamp

1.7.2 SH T1 vs. Sleep Score T2

ggplot(data = combined,
       mapping = aes(
         x = SH_T1,
         y = SLEEPSCORE_T2)) +
  geom_point(position = "jitter") +
  geom_smooth(method = "lm")
`geom_smooth()` using formula = 'y ~ x'
Warning: Removed 2 rows containing non-finite outside the scale range
(`stat_smooth()`).
Warning: Removed 2 rows containing missing values or values outside the scale range
(`geom_point()`).

# source: datacamp

1.7.3 SH T1 vs. Composite Sleep Score

ggplot(data = combined,
       mapping = aes(
         x = SH_T1,
         y = SLEEPSCORE)) +
  geom_point(position = "jitter")

# source: datacamp

1.7.4 SH T2 vs. Composite Sleep Score

ggplot(data = combined,
       mapping = aes(
         x = SH_T2,
         y = SLEEPSCORE)) +
  geom_point(position = "jitter")

# source: datacamp

1.8 Model

1.8.1 Descriptive Statistics for SH T1 and SH T2 and Sleep Score Composites

mean(combined$SH_T1)
[1] 2.480392
# source: datacamp
mean(combined$SH_T2)
[1] 1.695187
# source: datacamp
mean(combined$SLEEPSCORE)
[1] 71.73529
# source: datacamp
sd(combined$SH_T1)
[1] 0.6204903
# source: datacamp
sd(combined$SH_T2)
[1] 0.6679972
# source: datacamp
sd(combined$SLEEPSCORE)
[1] 7.112027
# source: datacamp
median(combined$SH_T1)
[1] 2.416667
# source: datacamp
median(combined$SH_T2)
[1] 1.727273
# source: datacamp
median(combined$SLEEPSCORE)
[1] 71.33333
# source: datacamp
range(combined$SH_T1)
[1] 1.500000 4.083333
# source: datacamp
range(combined$SH_T2)
[1] 0.8181818 3.1818182
# source: datacamp
range(combined$SLEEPSCORE)
[1] 59.66667 83.33333
# source: datacamp

1.9 Transform

1.9.1 Create Composite Scores for Activating SH Item

library(psych)
SH_T1_activating_keys <- list(
  SH_T1_activating = c("SH_8_T1", "SH_9_T1", "SH_10_T1", "SH_11_T1")
)

#source: Creating Composite Scorex from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html
#explanation: create keys for scoring
library(psych)
SH_T2_activating_keys <- list(
  SH_T2_activating = c("SH_8_T2", "SH_9_T2", "SH_10_T2", "SH_11_T2")
)

#source: Creating Composite Scorex from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html
#explanation: create keys for scoring
library(psych)
# Using scoreItems() - recommended: SH_T1_activating

SH_T1_activating_scores <- scoreItems(SH_T1_activating_keys, combined)

#source: Creating Composite Scores from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html
library(psych)
# Using scoreItems() - recommended: SH_T2_activating

SH_T2_activating_scores <- scoreItems(SH_T2_activating_keys, combined)

#source: Creating Composite Scores from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html
library(psych)
# Extract
composite_SH_T1_activating_scores <- SH_T1_activating_scores$scores

#source: Creating Composite Scores from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html
library(psych)
# Extract
composite_SH_T2_activating_scores <- SH_T2_activating_scores$scores

#source: Creating Composite Scores from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html
# Add to dataframe
combined$SH_T1_activating <- composite_SH_T1_activating_scores[, "SH_T1_activating"]

#source: Creating Composite Scores from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html
# Add to dataframe
combined$SH_T2_activating <- composite_SH_T2_activating_scores[, "SH_T2_activating"]

#source: Creating Composite Scores from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html

1.9.2 Create Composite Score for Nonsleep SH Item

library(psych)
SH_T1_nonsleep_keys <- list(
  SH_T1_nonsleep = c("SH_12_T1", "SH_13_T1", "SH_14_T1", "SH_15_T1")
)

#source: Creating Composite Scorex from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html
#explanation: create keys for scoring
library(psych)
SH_T2_nonsleep_keys <- list(
  SH_T2_nonsleep = c("SH_12_T2", "SH_13_T2", "SH_14_T2", "SH_15_T2")
)

#source: Creating Composite Scorex from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html
#explanation: create keys for scoring
library(psych)
# Using scoreItems() - recommended: SH_T1_nonsleep

SH_T1_nonsleep_scores <- scoreItems(SH_T1_nonsleep_keys, combined)
Warning in sqrt(corrected.var * item.var): NaNs produced
#source: Creating Composite Scores from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html
library(psych)
# Using scoreItems() - recommended: SH_T2_nonsleep

SH_T2_nonsleep_scores <- scoreItems(SH_T2_nonsleep_keys, combined)

#source: Creating Composite Scores from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html
library(psych)
# Extract
composite_SH_T1_nonsleep_scores <- SH_T1_nonsleep_scores$scores

#source: Creating Composite Scores from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html
library(psych)
# Extract
composite_SH_T2_nonsleep_scores <- SH_T2_nonsleep_scores$scores

#source: Creating Composite Scores from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html
# Add to dataframe
combined$SH_T1_nonsleep <- composite_SH_T1_nonsleep_scores[, "SH_T1_nonsleep"]

#source: Creating Composite Scores from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html
# Add to dataframe
combined$SH_T2_nonsleep <- composite_SH_T2_nonsleep_scores[, "SH_T2_nonsleep"]

#source: Creating Composite Scores from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html

1.9.3 Create Composite Score for Environment SH Item

library(psych)
SH_T1_enviro_keys <- list(
  SH_T1_enviro = c("SH_16_T1", "SH_17_T1", "SH_18_T1", "SH_19_T1")
)

#source: Creating Composite Scorex from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html
#explanation: create keys for scoring
library(psych)
SH_T2_enviro_keys <- list(
  SH_T2_enviro = c("SH_16_T2", "SH_17_T2", "SH_18_T2", "SH_19_T2")
)

#source: Creating Composite Scorex from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html
#explanation: create keys for scoring
library(psych)
# Using scoreItems() - recommended: SH_T1_enviro

SH_T1_enviro_scores <- scoreItems(SH_T1_enviro_keys, combined)

#source: Creating Composite Scores from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html
library(psych)
# Using scoreItems() - recommended: SH_T2_enviro

SH_T2_enviro_scores <- scoreItems(SH_T2_enviro_keys, combined)

#source: Creating Composite Scores from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html
library(psych)
# Extract
composite_SH_T1_enviro_scores <- SH_T1_enviro_scores$scores

#source: Creating Composite Scores from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html
library(psych)
# Extract
composite_SH_T2_enviro_scores <- SH_T2_enviro_scores$scores

#source: Creating Composite Scores from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html
# Add to dataframe
combined$SH_T1_enviro <- composite_SH_T1_enviro_scores[, "SH_T1_enviro"]

#source: Creating Composite Scores from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html
# Add to dataframe
combined$SH_T2_enviro <- composite_SH_T2_enviro_scores[, "SH_T2_enviro"]

#source: Creating Composite Scores from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html

1.9.4 Reliability Statistics for Activating, Nonsleep, And Environment SH Items

# View reliability statistics

scoreItems(keys = SH_T1_activating_keys, items = combined)
Call: scoreItems(keys = SH_T1_activating_keys, items = combined)

(Unstandardized) Alpha:
      SH_T1_activating
alpha             0.38

Standard errors of unstandardized Alpha:
      SH_T1_activating
ASE                0.3

Average item correlation:
          SH_T1_activating
average.r             0.13

Median item correlation:
SH_T1_activating 
            0.14 

 Guttman 6* reliability: 
         SH_T1_activating
Lambda.6             0.43

Signal/Noise based upon av.r : 
             SH_T1_activating
Signal/Noise             0.61

Scale intercorrelations corrected for attenuation 
 raw correlations below the diagonal, alpha on the diagonal 
 corrected correlations above the diagonal:
                 SH_T1_activating
SH_T1_activating             0.38

 Average adjusted correlations within and between scales (MIMS)
[1] 0.13

 Average adjusted item x scale correlations within and between scales (MIMT)
[1] 0.58

 In order to see the item by scale loadings and frequency counts of the data
 print with the short option = FALSE
#source: Creating Composite Scores from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html
# View reliability statistics

scoreItems(keys = SH_T2_activating_keys, items = combined)
Call: scoreItems(keys = SH_T2_activating_keys, items = combined)

(Unstandardized) Alpha:
      SH_T2_activating
alpha             0.69

Standard errors of unstandardized Alpha:
      SH_T2_activating
ASE               0.21

Average item correlation:
          SH_T2_activating
average.r             0.36

Median item correlation:
SH_T2_activating 
            0.31 

 Guttman 6* reliability: 
         SH_T2_activating
Lambda.6             0.72

Signal/Noise based upon av.r : 
             SH_T2_activating
Signal/Noise              2.2

Scale intercorrelations corrected for attenuation 
 raw correlations below the diagonal, alpha on the diagonal 
 corrected correlations above the diagonal:
                 SH_T2_activating
SH_T2_activating             0.69

 Average adjusted correlations within and between scales (MIMS)
[1] 0.36

 Average adjusted item x scale correlations within and between scales (MIMT)
[1] 0.7

 In order to see the item by scale loadings and frequency counts of the data
 print with the short option = FALSE
#source: Creating Composite Scores from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html
# View reliability statistics

scoreItems(keys = SH_T1_nonsleep_keys, items = combined)
Warning in sqrt(corrected.var * item.var): NaNs produced
Call: scoreItems(keys = SH_T1_nonsleep_keys, items = combined)

(Unstandardized) Alpha:
      SH_T1_nonsleep
alpha           -1.1

Standard errors of unstandardized Alpha:
      SH_T1_nonsleep
ASE             0.26

Average item correlation:
          SH_T1_nonsleep
average.r          -0.15

Median item correlation:
SH_T1_nonsleep 
         -0.09 

 Guttman 6* reliability: 
         SH_T1_nonsleep
Lambda.6         -0.081

Signal/Noise based upon av.r : 
             SH_T1_nonsleep
Signal/Noise          -0.52

Scale intercorrelations corrected for attenuation 
 raw correlations below the diagonal, alpha on the diagonal 
 corrected correlations above the diagonal:
               SH_T1_nonsleep
SH_T1_nonsleep           -1.1

 Average adjusted correlations within and between scales (MIMS)
[1] -0.15

 Average adjusted item x scale correlations within and between scales (MIMT)
[1] 0.35

 In order to see the item by scale loadings and frequency counts of the data
 print with the short option = FALSE
#source: Creating Composite Scores from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html
# View reliability statistics

scoreItems(keys = SH_T2_nonsleep_keys, items = combined)
Call: scoreItems(keys = SH_T2_nonsleep_keys, items = combined)

(Unstandardized) Alpha:
      SH_T2_nonsleep
alpha           -0.4

Standard errors of unstandardized Alpha:
      SH_T2_nonsleep
ASE             0.33

Average item correlation:
          SH_T2_nonsleep
average.r         -0.077

Median item correlation:
SH_T2_nonsleep 
         -0.16 

 Guttman 6* reliability: 
         SH_T2_nonsleep
Lambda.6          0.053

Signal/Noise based upon av.r : 
             SH_T2_nonsleep
Signal/Noise          -0.29

Scale intercorrelations corrected for attenuation 
 raw correlations below the diagonal, alpha on the diagonal 
 corrected correlations above the diagonal:
               SH_T2_nonsleep
SH_T2_nonsleep           -0.4

 Average adjusted correlations within and between scales (MIMS)
[1] -0.08

 Average adjusted item x scale correlations within and between scales (MIMT)
[1] 0.44

 In order to see the item by scale loadings and frequency counts of the data
 print with the short option = FALSE
#source: Creating Composite Scores from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html
# View reliability statistics

scoreItems(keys = SH_T1_enviro_keys, items = combined)
Call: scoreItems(keys = SH_T1_enviro_keys, items = combined)

(Unstandardized) Alpha:
      SH_T1_enviro
alpha         0.51

Standard errors of unstandardized Alpha:
      SH_T1_enviro
ASE           0.25

Average item correlation:
          SH_T1_enviro
average.r         0.21

Median item correlation:
SH_T1_enviro 
        0.14 

 Guttman 6* reliability: 
         SH_T1_enviro
Lambda.6         0.65

Signal/Noise based upon av.r : 
             SH_T1_enviro
Signal/Noise            1

Scale intercorrelations corrected for attenuation 
 raw correlations below the diagonal, alpha on the diagonal 
 corrected correlations above the diagonal:
             SH_T1_enviro
SH_T1_enviro         0.51

 Average adjusted correlations within and between scales (MIMS)
[1] 0.21

 Average adjusted item x scale correlations within and between scales (MIMT)
[1] 0.6

 In order to see the item by scale loadings and frequency counts of the data
 print with the short option = FALSE
#source: Creating Composite Scores from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html
# View reliability statistics

scoreItems(keys = SH_T2_enviro_keys, items = combined)
Call: scoreItems(keys = SH_T2_enviro_keys, items = combined)

(Unstandardized) Alpha:
      SH_T2_enviro
alpha         0.36

Standard errors of unstandardized Alpha:
      SH_T2_enviro
ASE            0.3

Average item correlation:
          SH_T2_enviro
average.r         0.12

Median item correlation:
SH_T2_enviro 
       0.019 

 Guttman 6* reliability: 
         SH_T2_enviro
Lambda.6         0.39

Signal/Noise based upon av.r : 
             SH_T2_enviro
Signal/Noise         0.57

Scale intercorrelations corrected for attenuation 
 raw correlations below the diagonal, alpha on the diagonal 
 corrected correlations above the diagonal:
             SH_T2_enviro
SH_T2_enviro         0.36

 Average adjusted correlations within and between scales (MIMS)
[1] 0.12

 Average adjusted item x scale correlations within and between scales (MIMT)
[1] 0.58

 In order to see the item by scale loadings and frequency counts of the data
 print with the short option = FALSE
#source: Creating Composite Scores from Multi-Item Measures (McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/composite.html

1.10 Model

1.10.1 Descriptive Statistics for 3 SH Example Items

mean(combined$SH_11_T1)
[1] 4.882353
# source: datacamp
mean(combined$SH_11_T2)
[1] 3.705882
# source: datacamp
mean(combined$SH_14_T1)
[1] 4.176471
# source: datacamp
mean(combined$SH_14_T2)
[1] 2.705882
# source: datacamp
mean(combined$SH_19_T1)
[1] 0.4705882
# source: datacamp
mean(combined$SH_19_T2)
[1] 1.058824
# source: datacamp
sd(combined$SH_11_T1)
[1] 2.027386
# source: datacamp
sd(combined$SH_11_T2)
[1] 2.284861
# source: datacamp
sd(combined$SH_14_T1)
[1] 2.505875
# source: datacamp
sd(combined$SH_14_T2)
[1] 2.143732
# source: datacamp
sd(combined$SH_19_T1)
[1] 1.06757
# source: datacamp
sd(combined$SH_19_T2)
[1] 1.886484
# source: datacamp
median(combined$SH_11_T1)
[1] 5
# source: datacamp
median(combined$SH_11_T2)
[1] 4
# source: datacamp
median(combined$SH_14_T1)
[1] 4
# source: datacamp
median(combined$SH_14_T2)
[1] 2
# source: datacamp
median(combined$SH_19_T1)
[1] 0
# source: datacamp
median(combined$SH_19_T2)
[1] 0
# source: datacamp
range(combined$SH_11_T1)
[1] 0 7
# source: datacamp
range(combined$SH_11_T2)
[1] 0 7
# source: datacamp
range(combined$SH_14_T1)
[1] 0 7
# source: datacamp
range(combined$SH_14_T2)
[1] 0 7
# source: datacamp
range(combined$SH_19_T1)
[1] 0 4
# source: datacamp
range(combined$SH_19_T2)
[1] 0 7
# source: datacamp

1.11 Visualize

Data was cleaned to remove any NAs, and only the relevant sleep hygiene and sleep score variables were included. To visualize change in the 3 sleep hygiene behaviors of interest from pre-assessment to post-assessment a violin plot was used (Figure 7). This plot shows the distribution of SH_11, SH_14, and SH_19, measured from 0 days to 7 days the week before assessment.

1.11.1 3 SH Items at T1 and T2

SHplotdata <- data.frame(
  Score = c(combined$SH_11_T1, combined$SH_11_T2,
            combined$SH_14_T1, combined$SH_14_T2,
            combined$SH_19_T1, combined$SH_19_T2),
  Group = rep(c("SH_11_T1", "SH_11_T2",
                "SH_14_T1", "SH_14_T2",
                "SH_19_T1", "SH_19_T2"),
              each = nrow(combined))
)

#source: r 4 data science manual
#explanation: this seemed like the easiest way to plot my data, as the way I had it in the wide format was confusing to me. let me know if there is a better way to go about this!
library(dplyr)
SHplotdata <- SHplotdata %>%
  mutate(
    SH = sub("_T[12]", "", Group),      # e.g., SH_11, SH_14, SH_19
    Time = sub(".*_T", "T", Group)      # T1 or T2
  ) %>%
  mutate(
    Time = factor(Time, levels = c("T1", "T2")),
    SH = factor(SH, levels = c("SH_11", "SH_14", "SH_19"))
  )

#source: r 4 data science manual
library(ggplot2)
#| fig-cap: Figure 7. Violin plot of SH_11, SH_14, and SH_19 measured at T1 and T2
plot_3SH_changes <- ggplot(SHplotdata,
       aes(x = interaction(SH, Time),   # combination like "SH_11.T1", "SH_11.T2", etc.
           y = Score,
           fill = SH)) +
  geom_violin(trim = TRUE, position = position_nudge(x = 0.15)) +
  geom_boxplot(width = .1,
               outlier.shape = NA,
               position = position_nudge(x = -0.15)) +
  geom_point(position = position_nudge(x = -0.35),
             alpha = 0.6) +
  scale_fill_manual(values = c(
    "SH_11" = "#673888",
    "SH_14" = "#ef4f91",
    "SH_19" = "#c79dd7"
  )) +
  scale_x_discrete(labels = c(
    "SH_11.T1" = "SH_11 T1",
    "SH_11.T2" = "SH_11 T2",
    "SH_14.T1" = "SH_14 T1",
    "SH_14.T2" = "SH_14 T2",
    "SH_19.T1" = "SH_19 T1",
    "SH_19.T2" = "SH_19 T2"
  )) +
  labs(title = "Change in SH Scores from T1 to T2",
       x = "Condition × Time",
       y = "Score (0 Days to 7 Days)") +
  theme_minimal(base_size = 14)

# Print and save to the plots folder
print(plot_3SH_changes)

#source: Visualizing pre/post score (Sava, 2025): https://shanemccarty.github.io/FRIplaybook/violin.html
ggsave("plots/plot7_3SH.png", 
       plot = plot_3SH_changes,
       width = 10, height = 8, dpi = 300)

1.12 Model

Though demographics were not assessed for this report, all participants were undergraduate students at Binghamton University, with the majority of students being 1st- or 2nd-year First-year Research Immersion program students, and the rest being 3rd- or 4th-year peer mentors for the FRI program. Thus, this sample is reflective of Binghamton undergraduate students in the FRI program. Composite sleep score collected by the MUSE over 7 days was correlated with 3 sleep hygiene behaviors (SH_11, SH_14, and SH_19) at both pre- and post-assessment. SH_11 (“Worried, planned, or thought about important matters at bedtime” (Gellis & Lichstein, 2009)) at pre-assessment a Pearson correlation showed no statistically significant relationship with composite sleep score, suggesting that sleep score was not correlated with SH_11_T1 in this sample (r = -.02, p = .928). At post-assessment, a similar non-significant result was found (r = -.29, p = .256). SH_14 (“Lounged around in bed” (Gellis & Lichstein, 2009)) at pre-assessment a Pearson correlation showed no statistically significant relationship with composite sleep score, suggesting that sleep score was not correlated with SH_14_T1 in this sample (r = -.07, p = .790). At post-assessment, a similar non-significant result was found (r = .01, p = .966). Finally, SH_19 (“Slept in a room that was too bright” (Gellis & Lichstein, 2009)) at pre-assessment a Pearson correlation showed no statistically significant relationship with composite sleep score, suggesting that sleep score was not correlated with SH_19_T1 in this sample (r = .14, p = .604). At post-assessment, a similar non-significant result was found (r = -.42, p = .093).

Thus, SH_11_T1 had a very weak negative correlation with sleep score (Figure 1), SH_11_T2 had a weak negative correlation with sleep score (Figure 2), SH_14_T1 had a very weak negative correlation with sleep score (Figure 3), SH_14_T2 had a very weak positive correlation with sleep score (Figure 4), SH_19_T1 had a weak positive correlation with sleep score, and finally (Figure 5), SH_19_T2 had a weak to moderate negative correlation with sleep score (Figure 6). However, because of the non-significant p-values of all of these correlations, and because all of their confidence intervals contain zero, we cannot reject the null hypothesis that sleep hygiene behaviors are not associated with sleep score, based on these 3 examples at 2 different time points.

1.12.1 3 SH Items at T1 and T2 vs. Composite Sleep Score

SH_11_T1_vs_SS <- ggplot(data = combined,
       mapping = aes(
         x = SH_11_T1,
         y = SLEEPSCORE)) + geom_point() +
  geom_smooth(method = "lm")

 # Print and save to the plots folder
print(SH_11_T1_vs_SS)
`geom_smooth()` using formula = 'y ~ x'

Figure 1. Scatterplot of SH_11 at Time 1 vs. composite sleep score
# source: Visualize in ggplot (Silhavy & McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/ggplot2.html
ggsave("plots/plot1_SH_11_T1_vs_SS.png", 
       plot = SH_11_T1_vs_SS,
       width = 10, height = 8, dpi = 300)
`geom_smooth()` using formula = 'y ~ x'
SH_11_T2_vs_SS <- ggplot(data = combined,
       mapping = aes(
         x = SH_11_T2,
         y = SLEEPSCORE)) + geom_point() +
  geom_smooth(method = "lm")

# Print and save to the plots folder
print(SH_11_T2_vs_SS)
`geom_smooth()` using formula = 'y ~ x'

Figure 2. Scatterplot of SH_11 at Time 2 vs. composite sleep score
# source: Visualize in ggplot (Silhavy & McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/ggplot2.html
ggsave("plots/plot2_SH_11_T2_vs_SS.png", 
       plot = SH_11_T2_vs_SS,
       width = 10, height = 8, dpi = 300)
`geom_smooth()` using formula = 'y ~ x'
SH_14_T1_vs_SS <- ggplot(data = combined,
       mapping = aes(
         x = SH_14_T1,
         y = SLEEPSCORE)) + geom_point() +
  geom_smooth(method = "lm")

# Print and save to the plots folder
print(SH_14_T1_vs_SS)
`geom_smooth()` using formula = 'y ~ x'

Figure 3. Scatterplot of SH_14 at Time 1 vs. composite sleep score
# source: Visualize in ggplot (Silhavy & McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/ggplot2.html
ggsave("plots/plot3_SH_14_T1_vs_SS.png", 
       plot = SH_14_T1_vs_SS,
       width = 10, height = 8, dpi = 300)
`geom_smooth()` using formula = 'y ~ x'
SH_14_T2_vs_SS <- ggplot(data = combined,
       mapping = aes(
         x = SH_14_T2,
         y = SLEEPSCORE)) + geom_point() +
  geom_smooth(method = "lm")

# Print and save to the plots folder
print(SH_14_T2_vs_SS)
`geom_smooth()` using formula = 'y ~ x'

Figure 4. Scatterplot of SH_14 at Time 2 vs. composite sleep score
# source: Visualize in ggplot (Silhavy & McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/ggplot2.html
ggsave("plots/plot4_SH_14_T2_vs_SS.png", 
       plot = SH_14_T2_vs_SS,
       width = 10, height = 8, dpi = 300)
`geom_smooth()` using formula = 'y ~ x'
SH_19_T1_vs_SS <- ggplot(data = combined,
       mapping = aes(
         x = SH_19_T1,
         y = SLEEPSCORE)) + geom_point() +
  geom_smooth(method = "lm")

# Print and save to the plots folder
print(SH_19_T1_vs_SS)
`geom_smooth()` using formula = 'y ~ x'

Figure 5. Scatterplot of SH_19 at Time 1 vs. composite sleep score
# source: Visualize in ggplot (Silhavy & McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/ggplot2.html
ggsave("plots/plot5_SH_19_T1_vs_SS.png", 
       plot = SH_19_T1_vs_SS,
       width = 10, height = 8, dpi = 300)
`geom_smooth()` using formula = 'y ~ x'
SH_19_T2_vs_SS <- ggplot(data = combined,
       mapping = aes(
         x = SH_19_T2,
         y = SLEEPSCORE)) + geom_point() +
  geom_smooth(method = "lm")

# Print and save to the plots folder
print(SH_19_T2_vs_SS)
`geom_smooth()` using formula = 'y ~ x'

Figure 6. Scatterplot of SH_19 at Time 2 vs. composite sleep score
# source: Visualize in ggplot (Silhavy & McCarty, 2025): https://shanemccarty.github.io/FRIplaybook/ggplot2.html
ggsave("plots/plot6_SH_19_T2_vs_SS.png", 
       plot = SH_19_T2_vs_SS,
       width = 10, height = 8, dpi = 300)
`geom_smooth()` using formula = 'y ~ x'

1.12.2 Calculate Correlations

#correlation_SS_vs_SH_11_T1
cor.test(combined$SH_11_T1, combined$SLEEPSCORE, method = 'pearson')

    Pearson's product-moment correlation

data:  combined$SH_11_T1 and combined$SLEEPSCORE
t = -0.091454, df = 15, p-value = 0.9283
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
 -0.4985941  0.4622834
sample estimates:
        cor 
-0.02360663 
#source: https://www.r-bloggers.com/2021/10/pearson-correlation-in-r/, https://www.onlinespss.com/pearson-correlation-in-r/
#correlation_SS_vs_SH_11_T2
cor.test(combined$SH_11_T2, combined$SLEEPSCORE, method = 'pearson')

    Pearson's product-moment correlation

data:  combined$SH_11_T2 and combined$SLEEPSCORE
t = -1.1808, df = 15, p-value = 0.2561
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
 -0.6773322  0.2198291
sample estimates:
       cor 
-0.2916291 
#source: https://www.r-bloggers.com/2021/10/pearson-correlation-in-r/, https://www.onlinespss.com/pearson-correlation-in-r/
#correlation_SS_vs_SH_14_T1 <- 
cor.test(combined$SH_14_T1, combined$SLEEPSCORE, method = 'pearson')

    Pearson's product-moment correlation

data:  combined$SH_14_T1 and combined$SLEEPSCORE
t = -0.27057, df = 15, p-value = 0.7904
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
 -0.5324993  0.4251959
sample estimates:
        cor 
-0.06969164 
#source: https://www.r-bloggers.com/2021/10/pearson-correlation-in-r/, https://www.onlinespss.com/pearson-correlation-in-r/
#correlation_SS_vs_SH_14_T2 <- 
cor.test(combined$SH_14_T2, combined$SLEEPSCORE, method = 'pearson')

    Pearson's product-moment correlation

data:  combined$SH_14_T2 and combined$SLEEPSCORE
t = 0.04382, df = 15, p-value = 0.9656
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
 -0.4718974  0.4892975
sample estimates:
       cor 
0.01131343 
#source: https://www.r-bloggers.com/2021/10/pearson-correlation-in-r/, https://www.onlinespss.com/pearson-correlation-in-r/
#correlation_SS_vs_SH_19_T1 <- 
cor.test(combined$SH_19_T1, combined$SLEEPSCORE, method = 'pearson')

    Pearson's product-moment correlation

data:  combined$SH_19_T1 and combined$SLEEPSCORE
t = 0.52935, df = 15, p-value = 0.6043
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
 -0.3692597  0.5784161
sample estimates:
      cor 
0.1354197 
#source: https://www.r-bloggers.com/2021/10/pearson-correlation-in-r/, https://www.onlinespss.com/pearson-correlation-in-r/
#correlation_SS_vs_SH_19_T2 <- 
cor.test(combined$SH_19_T2, combined$SLEEPSCORE, method = 'pearson')

    Pearson's product-moment correlation

data:  combined$SH_19_T2 and combined$SLEEPSCORE
t = -1.7942, df = 15, p-value = 0.09296
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
 -0.7495547  0.0755625
sample estimates:
       cor 
-0.4203488 
#source: https://www.r-bloggers.com/2021/10/pearson-correlation-in-r/, https://www.onlinespss.com/pearson-correlation-in-r/
#correlation_SS_vs_SH_T1
cor.test(combined$SH_T1, combined$SLEEPSCORE, method = 'pearson')

    Pearson's product-moment correlation

data:  combined$SH_T1 and combined$SLEEPSCORE
t = 0.59437, df = 15, p-value = 0.5611
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
 -0.3548249  0.5893646
sample estimates:
      cor 
0.1516898 
#source: https://www.r-bloggers.com/2021/10/pearson-correlation-in-r/, https://www.onlinespss.com/pearson-correlation-in-r/
#correlation_SS_vs_SH_T2
cor.test(combined$SH_T2, combined$SLEEPSCORE, method = 'pearson')

    Pearson's product-moment correlation

data:  combined$SH_T2 and combined$SLEEPSCORE
t = -0.65859, df = 15, p-value = 0.5201
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
 -0.5999445  0.3404349
sample estimates:
       cor 
-0.1676406 
#source: https://www.r-bloggers.com/2021/10/pearson-correlation-in-r/, https://www.onlinespss.com/pearson-correlation-in-r/

2 Discussion

The primary aim of this study was to examine whether behavioral sleep hygiene practices were associated with sleep quality among university students participating in a structured research program. Contrary to our hypothesis and the health promotion and prevention model — which suggests that engaging in health-supportive behaviors should protect against poor outcomes (Kia-Keating et al., 2011) — no significant correlations were found between sleep hygiene scores and objective sleep quality as measured by the MUSE-S headband. Thus, the null hypothesis could not be rejected, and behavioral sleep hygiene did not appear to influence sleep quality in this sample.

These findings must be interpreted in context. This study was conducted with a small, homogenous cohort from a single university program, limiting statistical power and variability in sleep hygiene behaviors. As such, the absence of a significant association does not necessarily indicate that sleep hygiene has no relationship with sleep quality; instead, it may reflect sampling limitations. Additionally, while the health promotion and prevention model would predict better sleep among individuals who engage in healthy sleep behaviors, the current results suggest that behavioral intentions or self-reported practices may not consistently translate into measurable physiological sleep outcomes in this population.

These findings should be understood in light of the broader public health context outlined in the introduction. As noted earlier, university students are experiencing rising rates of mental distress (Choudhry et al., 2016), and high-quality sleep is increasingly recognized as a protective factor for emotional well-being, cognitive functioning, and long-term mental health (Bodziony & Stetson, 2024; Palmer & Alfano, 2017). This study was designed to address the methodological gap in the literature by pairing a self-report sleep hygiene measure with the MUSE-S device in order to capture physiological sleep quality aligned with the NIMH’s RDoC framework (Michelini et. al., 2021). Although our hypothesis was not supported, the absence of a significant association between sleep hygiene and MUSE-S sleep score underscores the complexity of sleep as a health behavior and suggests that subjective perceptions of “good sleep habits” may not uniformly translate into measurable physiological benefits — at least within short observational periods among college students. Rather than contradicting the broader literature linking sleep and well-being, these findings may instead highlight the importance of both accurate self-monitoring and sufficient time for behavioral change to meaningfully influence biological sleep outcomes.

2.1 Physiological Vs. Self-Report Measures

A key feature of this study was the integration of an older, self-report sleep hygiene questionnaire with modern wearable sleep technology. The discrepancy between these measures may be due to several factors. Self-reported sleep hygiene relies on perception, recall accuracy, and subjective interpretation of habits, which may not fully capture the consistency or quality of sleep behaviors. Participants may overestimate their adherence due to social desirability or misjudge the quality of their routines. In contrast, the MUSE-S provides continuous, objective physiological data, capturing sleep duration and quality moment-to-moment. Therefore, it is plausible that while participants believed they engaged in strong sleep hygiene practices, these behaviors were not sufficient to materially influence their physiological sleep outcomes. It is also possible that the components most strongly affecting sleep physiology (e.g., stress, caffeine timing, circadian rhythm stability) were not fully reflected in the self-report instrument used.

2.2 Pre- and Post-Assessment Differences

While correlations across both pre- and post-assessments were non-significant, slight directional variation was observed, with sleep hygiene behaviors becoming more predictive of sleep quality at time 2 (Table 2). One potential explanation for these shifts is that, prior to the study, participants were not actively tracking or reflecting on their sleep habits, leading to less accurate or less intentional self-reporting. Participating in a week-long sleep study likely increased awareness of individual sleep behaviors, which may have either improved reporting accuracy or prompted participants to modify their behaviors in real time. In other words, being monitored may have influenced both perception and action — a “measurement reactivity” effect commonly observed in behavioral research. As such, the post-assessment correlations may capture more accurate self-monitoring and/or early behavior change attempts, even if those changes were not yet sufficient to produce measurable improvements in physiological sleep metrics.

2.3 Broader Implications

Although this study did not find support for a protective relationship between sleep hygiene and sleep outcomes, it highlights the growing importance of integrating subjective and objective measures in behavioral health research. University students face unique stressors and irregular schedules, which may blunt the effects of even well-intentioned sleep hygiene behaviors. These findings may therefore encourage public health and campus wellness initiatives to move beyond education alone and incorporate structured sleep support interventions, such as behavioral coaching, stress-reduction programs, and more.

2.4 Limitations

This study is limited by its small, program-specific sample, and the use of one self-report scale alongside one physiological metric. Additionally, sleep hygiene behaviors were not experimentally manipulated, meaning that causal conclusions cannot be drawn. Despite these limitations, the study demonstrates feasibility of wearable-integrated sleep research in undergraduate settings and highlights key methodological considerations for future work.

2.5 Future Directions

Future research should recruit larger and more diverse student samples to improve generalizability and statistical power. Researchers may also benefit from incorporating multi-method sleep assessments, such as ecological momentary assessment, sleep diaries, or actigraphy, to bridge self-report and physiological measures. A novel next step would be to experimentally manipulate specific sleep hygiene behaviors — such as consistent wake times or evening screen-use reductions — to determine whether objective sleep improvements follow. If given the opportunity to extend this research, we would conduct a semester-long randomized intervention pairing behavioral sleep hygiene training with wearable feedback, allowing for real-time correction and assessment of sleep behavior change over time.