rl <- read.csv("/Users/nikki/Desktop/Research/HealthyU_Scanning_Local/RL_inputdata/BestLR_Grp.csv")
ema <- read.csv("/Users/nikki/Desktop/Research/Masters_reanalysis/Data/demos_sxs_ema.csv")
#merge together & reduce
alldata <- merge(rl, ema, by.x = "id", by.y = "ID", all.x = T)
main <- alldata[c(1:4,36,44,71,72,74,75,73,76:78,64,65,66,67,68,69,70,61,62,5:16,18,20)]
datatable(main)
la_hist <- ggplot(data=main, aes(x=LR_lamyg)) +
geom_histogram(bins = 8, fill = "turquoise4", alpha = .5) +
geom_density() +
xlab("Left amaygdala LR") +
theme_minimal()
ra_hist <- ggplot(data=main, aes(x=LR_ramyg)) +
geom_histogram(bins = 8, fill = "mediumpurple3", alpha = .5) +
geom_density() +
xlab("Right amaygdala LR") +
theme_minimal()
ofc_hist <- ggplot(data=main, aes(x=LR_ofc)) +
geom_histogram(bins = 8, fill = "palegreen3", alpha = .5) +
geom_density() +
xlab("Orbitalfrontal LR") +
theme_minimal()
gridExtra::grid.arrange(la_hist,ra_hist,ofc_hist, nrow = 1)
res1 <- cor.test(main$LR_lamyg,main$LR_ramyg)
results1 <- res1 %>% # take the object results and then
tidy()
results1
ggplot(data=main, aes(x=LR_lamyg, y=LR_ramyg)) +
geom_point(color = "darkslategray4", size = 2, alpha = .75) +
labs(title = "Left and Right amygdala LR concordance") +
xlab("Left amygdala LR") +
ylab("Right amygdala LR") +
theme_gray()
ggplot(data=main, aes(x=LR_lamyg, y=LR_ofc)) +
geom_point(color = "slateblue4", size = 2, alpha = .75) +
labs(title = "Left amygdala and OFC LR concordance") +
xlab("Left amygdala LR") +
ylab("OFC LR") +
theme_gray()
dep <- ggplot(data=main, aes(x=PHQ9_tot_3)) +
geom_histogram(bins = 10, fill = "gold3", alpha = .5) +
xlab("Depression Sx (max 27)") +
theme_minimal()
anx <- ggplot(data=main, aes(x=GAD7_3)) +
geom_histogram(bins = 10, fill = "darkorange", alpha = .5) +
xlab("Anxiety Sx (max 21)") +
theme_minimal()
na <- ggplot(data=main, aes(x=NAmean)) +
geom_histogram(bins = 12, fill = "orangered", alpha = .5) +
xlab("Average Daily NA over two months (from 0-100)") +
theme_minimal()
pa <- ggplot(data=main, aes(x=PAmean)) +
geom_histogram(bins = 12, fill = "firebrick", alpha = .5) +
xlab("Average Daily PA over two months (from 0-100)") +
theme_minimal()
gridExtra::grid.arrange(dep,anx,na,pa, nrow = 2)
left1 <- ggplot(data=main, aes(x=LR_lamyg)) +
geom_point(aes(y=PHQ9_tot_3), color = "gold2", size = 3, shape = 4) +
geom_point(aes(y=GAD7_3), color = "darkorange2", size = 3, shape = 4) +
geom_smooth(aes(y=PHQ9_tot_3), color = "gold2", size = 1, alpha = .4, formula = y ~ x, method = lm, se=F) +
geom_smooth(aes(y=GAD7_3), color = "darkorange2", size = 1, alpha = .4, formula = y ~ x, method = lm, se=F) +
labs(title = "Left amy LR does not predict Depression or Anxiety") +
xlab("Left amygdala LR") +
ylab("Depression and Anxiety scores") +
theme_gray() +
theme(plot.title = element_text(size = 9),
axis.title.x=element_text(size = 9),
axis.title.y=element_text(size = 9),
axis.text.y=element_text(size = 9),
axis.text.x=element_text(size = 9))
left2 <- ggplot(data=main, aes(x=LR_lamyg)) +
geom_point(aes(y=NAmean), color = "orangered2", size = 3, shape = 4) +
geom_point(aes(y=PAmean), color = "firebrick4", size = 3, shape = 4) +
geom_smooth(aes(y=NAmean), color = "orangered2", size = 1, alpha = .4, formula = y ~ x, method = lm, se=F) +
geom_smooth(aes(y=PAmean), color = "firebrick4", size = 1, alpha = .4, formula = y ~ x, method = lm, se=F) +
labs(title = "Left amyg LR does not predict daily mean NA or PA") +
xlab("Left amygdala LR") +
ylab("mean NA and PA") +
theme_gray() +
theme(plot.title = element_text(size = 9),
axis.title.x=element_text(size = 9),
axis.title.y=element_text(size = 9),
axis.text.y=element_text(size = 9),
axis.text.x=element_text(size = 9))
right1 <- ggplot(data=main, aes(x=LR_ramyg)) +
geom_point(aes(y=PHQ9_tot_3), color = "gold2", size = 3, shape = 4) +
geom_point(aes(y=GAD7_3), color = "darkorange2", size = 3, shape = 4) +
geom_smooth(aes(y=PHQ9_tot_3), color = "gold2", size = 1, alpha = .4, formula = y ~ x, method = lm, se=F) +
geom_smooth(aes(y=GAD7_3), color = "darkorange2", size = 1, alpha = .4, formula = y ~ x, method = lm, se=F) +
labs(title = "Right amyg LR does not predict Depression or Anxiety") +
xlab("Right amygdala LR") +
ylab("Depression and Anxiety scores") +
theme_gray()+
theme(plot.title = element_text(size = 9),
axis.title.x=element_text(size = 9),
axis.title.y=element_text(size = 9),
axis.text.y=element_text(size = 9),
axis.text.x=element_text(size = 9))
right2 <- ggplot(data=main, aes(x=LR_ramyg)) +
geom_point(aes(y=NAmean), color = "orangered2", size = 3, shape = 4) +
geom_point(aes(y=PAmean), color = "firebrick4", size = 3, shape = 4) +
geom_smooth(aes(y=NAmean), color = "orangered2", size = 1, alpha = .4, formula = y ~ x, method = lm, se=F) +
geom_smooth(aes(y=PAmean), color = "firebrick4", size = 1, alpha = .4, formula = y ~ x, method = lm, se=F) +
labs(title = "Right amyg LR does not predict daily mean NA or PA") +
xlab("Right amygdala LR") +
ylab("mean NA and PA") +
theme_gray()+
theme(plot.title = element_text(size = 9),
axis.title.x=element_text(size = 9),
axis.title.y=element_text(size = 9),
axis.text.y=element_text(size = 9),
axis.text.x=element_text(size = 9))
gridExtra::grid.arrange(left1,left2,right1,right2, nrow = 2)