Introduction

People tend to be called and perceived as grouchy, moody, and unruly when they don’t get the sleep they wish they could, but is this stereotype actually true? That’s what we are here to figure out

Literature Review

Article 1 Summary

Lollies and Friederike (2022) looked at the effects of administered experimental and natural sleep deprivation on subjects. They found data confidently pointing toward a relationship between sleep and emotional stability, although more research is required to reinforce.

Article 2 Summary

Palmer and Alfano (2017) observed a multitude of differing varying conditions including emotion regulation when someone is sleep deprived. They found that sleep deprivation had a manipulative effect on emotional regulation. This points toward sleep have a negative effect on regulation.

Hypothesis

If a person is more sleep deprived, they will become less emotionally regulated.

Method

Sample

The sample will include 2,000 differing averages of observations each being one person

Variables and Operationalization

The independent variable is “time slept daily”; it is operationalized as it is the total hours done sleeping in a 24 hour day each day which is then averaged out over time.

The dependent variable is “emotion regulation”; it is opertionalized as it is set to a score they are given though observations

Loading Required Libraries

# Load necessary libraries
library(ggplot2)
library(dplyr)
library(psych)
library(knitr)
library(readxl)
sleep_deprivation_dataset_detailed <- read_excel("archive/sleep_deprivation_dataset_detailed.xls")
## Error: 
##   filepath: C:\Users\trist\Downloads\archive\sleep_deprivation_dataset_detailed.xls
##   libxls error: Unable to open file
View(sleep_deprivation_dataset_detailed)
## Error: object 'sleep_deprivation_dataset_detailed' not found
#I imported it through a different method using the "from text" import option and just imported the file that way. 
#It showed a error: "Error: Can't establish that the input is either xls or xlsx." so i did the other way. I tried changing the file to xls and xlsx and neither worked. 

Descriptive Statistics

Present the descriptive statistics for your variables. Include appropriate measures of central tendency (mean, median), variability (standard deviation, range), and frequency distributions where applicable. Use R code chunks to generate and display your results.

psych::describe(sleep_deprivation_dataset_detailed[, c("Emotion_Regulation_Score", "Sleep_Hours")])
## Error: object 'sleep_deprivation_dataset_detailed' not found

Statistical Analysis

Analysis

Perform your chosen analysis. Make sure your output shows.

model <- lm(Emotion_Regulation_Score ~ Sleep_Hours, data = sleep_deprivation_dataset_detailed)
## Error in eval(mf, parent.frame()): object 'sleep_deprivation_dataset_detailed' not found
summary(model)
## Error: object 'model' not found

Post-hoc Power Analysis

Run a post-hoc power analysis with the pwr package. Use the pwr.f2.test function for multiple regression power analysis.

library(pwr)
## Warning: package 'pwr' was built under R version 4.4.3
pwr.f2.test
## function (u = NULL, v = NULL, f2 = NULL, sig.level = 0.05, power = NULL) 
## {
##     if (sum(sapply(list(u, v, f2, power, sig.level), is.null)) != 
##         1) 
##         stop("exactly one of u, v, f2, power, and sig.level must be NULL")
##     if (!is.null(f2)) {
##         if (is.character(f2)) 
##             f2 <- cohen.ES(test = "f2", size = f2)$effect.size
##         if (any(f2 < 0)) 
##             stop("f2 must be positive")
##     }
##     if (!is.null(u) && any(u < 1)) 
##         stop("degree of freedom u for numerator must be at least 1")
##     if (!is.null(v) && any(v < 1)) 
##         stop("degree of freedom v for denominator must be at least 1")
##     if (!is.null(sig.level) && !is.numeric(sig.level) || any(0 > 
##         sig.level | sig.level > 1)) 
##         stop(sQuote("sig.level"), " must be numeric in [0, 1]")
##     if (!is.null(power) && !is.numeric(power) || any(0 > power | 
##         power > 1)) 
##         stop(sQuote("power"), " must be numeric in [0, 1]")
##     p.body <- quote({
##         lambda <- f2 * (u + v + 1)
##         pf(qf(sig.level, u, v, lower = FALSE), u, v, lambda, 
##             lower = FALSE)
##     })
##     if (is.null(power)) 
##         power <- eval(p.body)
##     else if (is.null(u)) 
##         u <- uniroot(function(u) eval(p.body) - power, c(1 + 
##             1e-10, 100))$root
##     else if (is.null(v)) 
##         v <- uniroot(function(v) eval(p.body) - power, c(1 + 
##             1e-10, 1e+09))$root
##     else if (is.null(f2)) 
##         f2 <- uniroot(function(f2) eval(p.body) - power, c(1e-07, 
##             1e+07))$root
##     else if (is.null(sig.level)) 
##         sig.level <- uniroot(function(sig.level) eval(p.body) - 
##             power, c(1e-10, 1 - 1e-10))$root
##     else stop("internal error")
##     METHOD <- "Multiple regression power calculation"
##     structure(list(u = u, v = v, f2 = f2, sig.level = sig.level, 
##         power = power, method = METHOD), class = "power.htest")
## }
## <bytecode: 0x000002339b4477e8>
## <environment: namespace:pwr>
r2 <- 0.03191
f2 <- r2 / (1 - r2) 

pwr.f2.test(u = 1, v = 58, f2 = f2, sig.level = 0.05)
## 
##      Multiple regression power calculation 
## 
##               u = 1
##               v = 58
##              f2 = 0.03296181
##       sig.level = 0.05
##           power = 0.2824182

Results Interpretation

Overall we found a slight negative relationship between sleep and emotional regulation but that it was so small of a relationship with a p-value of .172 that it is insignificant and cannot prove any substantial claim of effect. It also has a R-squared vlue of around 3.2% pointing to the reality that the majority of the variation was caused by external factors not involving sleep. Not to mention the power was 28% meaning that its ability to find the relationship in a meaningful way is not possible either in the first place. In conclusion we did not get a strong or concussive link between sleep and emotional regulation. Although since the power was so low we cant rule out the psossbility of the realtionship still existing.

Graph and Table

Include at least one table and one graph that effectively summarize your analysis and findings. Use R code chunks to generate these visualizations.

sleep_deprivation_dataset_detailed <- sleep_deprivation_dataset_detailed %>%
  mutate(Sleep_Split = ifelse(Sleep_Hours > median(Sleep_Hours, na.rm = TRUE), 
                              "More Sleep", "Less Sleep"))
## Error: object 'sleep_deprivation_dataset_detailed' not found
ggplot(sleep_deprivation_dataset_detailed, 
       aes(x = Sleep_Hours, y = Emotion_Regulation_Score, color = Sleep_Split)) +
  geom_point() +
  geom_smooth(method = "lm", se = FALSE) +
  labs(title = "Effect of Sleep Hours on Emotion Regulation by Sleep Group (Median Split)",
       x = "Sleep Hours", y = "Emotion Regulation Score") +
  scale_color_manual(values = c("More Sleep" = "blue", "Less Sleep" = "red")) +
  theme_minimal()
## Error: object 'sleep_deprivation_dataset_detailed' not found
summary_table <- sleep_deprivation_dataset_detailed %>%
  group_by(Sleep_Split) %>%
  summarise(
    Emotion_Regulation_Mean = mean(Emotion_Regulation_Score, na.rm = TRUE),
    Emotion_Regulation_SD = sd(Emotion_Regulation_Score, na.rm = TRUE),
    Emotion_Regulation_Min = min(Emotion_Regulation_Score, na.rm = TRUE),
    Emotion_Regulation_Max = max(Emotion_Regulation_Score, na.rm = TRUE)
  )
## Error: object 'sleep_deprivation_dataset_detailed' not found
summary_table
## Error: object 'summary_table' not found
# Display the table using knitr::kable()
kable(summary_table, caption = "Descriptive Statistics for Iris Sepal Length")
## Error: object 'summary_table' not found

Discussion

Discuss the implications of your results for psychological theory or practice. Address the following points:

  • Implications: My findings sadly leave the door open still on whether or not thier is a relationship as the examination was unable to detect any valuable findings.

  • Limitations: The limited amount of people and the subjectivy emtion regulation scroes have inherintly both most likely played a part in why the study was limited.

  • Future Directions: I think finding a way measure parts of the brain involved with emotions and tracking those in increments would be a mroe percise method of data gathering then jsut subjective scores from observation. This would give a more objective concrete idea.

References

Lollies, Friederike, et al. “Associations of Sleep and Emotion Regulation Processes in Childhood and Adolescence - a Systematic Review, Report of Methodological Challenges and Future Directions.” Sleep Science (São Paulo, SP ), vol. 15, no. 4, 2022, pp. 490–514, https://doi.org/10.5935/1984-0063.20220082.

Palmer, Cara A., and Candice A. Alfano. “Sleep and Emotion Regulation: An Organizing, Integrative Review.” Sleep Medicine Reviews, vol. 31, 2017, pp. 6–16, https://doi.org/10.1016/j.smrv.2015.12.006.