Skip to content

Instantly share code, notes, and snippets.

@elinw
Forked from naomispence/WTC Wave 5 Dataset
Last active November 5, 2022 01:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elinw/63b308ac7297febae0a939e40cd3cd6a to your computer and use it in GitHub Desktop.
Save elinw/63b308ac7297febae0a939e40cd3cd6a to your computer and use it in GitHub Desktop.
# you should not need to do ths, try having them make a project? Because setwd() is considered bad practice.
setwd("~/R_Program_Folder")
# all the amazon code here
Sys.setenv("AWS_ACCESS_KEY_ID" = "xxxxx",
"AWS_SECRET_ACCESS_KEY" = "xxxxxx",
"AWS_DEFAULT_REGION" = "us-west-2")
library(aws.s3)
s3load('Wave_5_Dataset.RData', bucket = 'xxxx')
#library(readr)
#Wave_5_Dataset <- read_csv("Wave_5_Dataset.csv")
#load(Wave_5_Dataset)
library(Hmisc)
library(descr)
freq(Wave_5_Dataset$work_pile)
freq(Wave_5_Dataset$sad_w5)
freq(Wave_5_Dataset$nervous_w5)
freq(Wave_5_Dataset$restless_w5)
freq(Wave_5_Dataset$hopeless_w5)
freq(Wave_5_Dataset$lethargic_w5)
freq(Wave_5_Dataset$worthless_w5)
freq(Wave_5_Dataset$depression_w5)
freq(Wave_5_Dataset$nerves_w5)
Wave_5_Dataset$Psychological_Symptoms <- ((Wave_5_Dataset$sad_w5 + Wave_5_Dataset$nervous_w5 +
Wave_5_Dataset$restless_w5 + Wave_5_Dataset$hopeless_w5 + Wave_5_Dataset$lethargic_w5 + Wave_5_Dataset$worthless_w5 + Wave_5_Dataset$depression_w5 + Wave_5_Dataset$nerves_w5) /8)
freq(Wave_5_Dataset$Psychological_Symptoms)
summary(Wave_5_Dataset$Psychological_Symptoms, na.rm = T)
sd(Wave_5_Dataset$Psychological_Symptoms, na.rm = T)
data.plot.bivariate10<-na.omit(Wave_5_Dataset[,c("work_pile", "Psychological_Symptoms")])
data.plot.bivariate10$work_pile<-as.factor(data.plot.bivariate10$work_pile)
levels(data.plot.bivariate10$work_pile)<-c("Yes", "No")
ggplot(data=data.plot.bivariate10)+
stat_summary(aes(x=work_pile, y=Psychological_Symptoms), geom = "bar")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment