#colnames(cortdata)
colnames(cortdata)[14:19] <- c("Cort0","Cort1","Cort2","Cort3","Cort4","Cort5")
#Create change scores
cortdata$RRS_change <- cortdata$RRS1 - cortdata$RRS3
cortdata$PSWQ_change <- cortdata$PSWQ1 - cortdata$PSWQ3
cortdata$PEPQ_change <- cortdata$PEPQ1 - cortdata$PEPQ3
#write.csv(cortdata, "cortdata.csv", row.names=F)
plot(cortvalues, xlab = "Time point", ylab = "Average Cortisol (nmol/L)", xaxt = 'n', cex.lab = 0.75, cex.axis=0.75)
axis(1, at=1:3, labels=c("Baseline","Stress","Recovery"), cex.axis=0.75)
colnames(cortdata)
[1] "ID" "SES" "Age"
[4] "Gender" "Ethnicity" "PTQ1"
[7] "PTQ3" "Time0" "Time1"
[10] "Time2" "Time3" "Time4"
[13] "Time5" "Cort0" "Cort1"
[16] "Cort2" "Cort3" "Cort4"
[19] "Cort5" "cortresponder" "CurrentMed_notBC_t3"
[22] "CurrentMed_BC_t3" "Smoker_0no_1yes_2yestoday_t3" "TodayCaff_NumCups_t3"
[25] "CurrentMenstr_t3" "altresponder" "PTQ_change"
[28] "PTQ2" "PSWQ1" "RRS1"
[31] "PEPQ1" "PSWQ2" "RRS2"
[34] "PEPQ2" "PSWQ3" "RRS3"
[37] "PEPQ3" "PTQ0" "PHQ91"
[40] "IES1" "GAD71" "PTSD3"
[43] "PHQ93" "GAD73" "pan_p1"
[46] "pan_p2" "pan_p3" "pan_p4"
[49] "pan_p5" "pan_p6" "pan_p7"
[52] "pan_n1" "pan_n2" "pan_n3"
[55] "pan_n4" "pan_n5" "pan_n6"
[58] "pan_n7" "HURTE_before12" "HURTE_before13"
[61] "HURTE_before14" "HURTE_before15" "HURTE_before16"
[64] "HURTE_before17" "HURTE_before18" "HURTE_during_left1"
[67] "HURTE_during_left2" "HURTE_during_left3" "HURTE_during_left4"
[70] "HURTE_during_left5" "HURTE_during_left6" "HURTE_during_left7"
[73] "HURTE_during_left8" "HURTE_during_stayed14" "HURTE_during_stayed15"
[76] "HURTE_during_stayed16" "HURTE_during_stayed17" "HURTE_during_stayed18"
[79] "HURTE_during_stayed19" "HURTE_during_stayed20" "HURTE_during_stayed21"
[82] "HURTE_after16_1" "HURTE_after16_2" "HURTE_after16_3"
[85] "HURTE_after16_4" "HURTE_after16_5" "HURTE_after16_6"
[88] "HURTE_curr_1" "HURTE_curr_2" "HURTE_curr_3"
[91] "HURTE_curr_4" "beforeDistress" "duringLeftDistress"
[94] "duringStayedDistress" "afterDistress" "currentImpairment"
[97] "PTQpre1change" "PTQ31change" "RRS_change"
[100] "PSWQ_change" "PEPQ_change" "cortBL"
[103] "cortStress" "cortRec"
panasdata <- cortdata[c(1:7,27:58,96:101)]
#colnames(panasdata)
colnames(panasdata)[c(19:39)] <- sub("^[[:alnum:]]+_","",(colnames(panasdata)[c(19:39)]))
#colnames(panasdata)
#PA
#Baseline: select higher value between p1 and p2, the 2 baseline measures of positive affect
panasdata$paBL <- ifelse(panasdata$p1 > panasdata$p2, panasdata$p1, panasdata$p2)
#Stress: select lower value between p3 and p4, the 2 stress measures
panasdata$paStress <- ifelse(panasdata$p3 < panasdata$p4, panasdata$p3, panasdata$p4)
#Recovery: select higher value between p5 and p6, the 2 recovery measures. Then if p7 is highest, select that one instead.
panasdata$paRec <- ifelse(panasdata$p5 > panasdata$p6, panasdata$p5, panasdata$p6)
#panasdata$paRec <- ifelse(panasdata$p7 > panasdata$paRec0, panasdata$p7, panasdata$paRec0)
#NA
#Baseline: select lower value between n1 and n2, the 2 baseline measures of negative affect
panasdata$naBL <- ifelse(panasdata$n1 < panasdata$n2, panasdata$n1, panasdata$n2)
#Stress: select higher value between n3 and n4, the 2 stress measures
panasdata$naStress <- ifelse(panasdata$n3 > panasdata$n4, panasdata$n3, panasdata$n4)
#Recovery: select lower value between n5 and n6, the 2 recovery measures. Then if n7 is lowest, select that one instead.
panasdata$naRec <- ifelse(panasdata$n5 < panasdata$n6, panasdata$n5, panasdata$n6)
#panasdata$naRec <- ifelse(panasdata$n7 < panasdata$naRec0, panasdata$n7, panasdata$naRec0)
plot(panas_n, xlab = "Time point", ylab = "Average Negative Affect", xaxt = 'n', cex.lab = 0.75, cex.axis=0.75)
axis(1, at=1:3, labels=c("Baseline","Stress","Recovery"), cex.axis=0.75)
plot(panas_p, xlab = "Time point", ylab = "Average Positive Affect", xaxt = 'n', cex.lab = 0.75, cex.axis=0.75)
axis(1, at=1:3, labels=c("Baseline","Stress","Recovery"), cex.axis=0.75)
naplot <- ggplot(data = panas.db, aes(x = time, y = na, group = ID))
naplot + geom_line()
paplot <- ggplot(data = panas.db, aes(x = time, y = pa, group = ID))
paplot + geom_line()
timeCortModel <- lme(scale(cort) ~ time + scale(Smoker_0no_1yes_2yestoday_t3) + Gender+ scale(TodayCaff_NumCups_t3), random = ~1|ID/time, data=cort.db2, na.action = na.omit)
summary(timeCortModel)
Linear mixed-effects model fit by REML
Data: cort.db2
AIC BIC logLik
413.5871 442.5216 -197.7936
Random effects:
Formula: ~1 | ID
(Intercept)
StdDev: 0.7374085
Formula: ~1 | time %in% ID
(Intercept) Residual
StdDev: 0.4169686 0.2096236
Fixed effects: scale(cort) ~ time + scale(Smoker_0no_1yes_2yestoday_t3) + Gender + scale(TodayCaff_NumCups_t3)
Value Std.Error DF t-value p-value
(Intercept) 0.0386319 0.12412479 124 0.311234 0.7561
time1 0.2183737 0.08315312 124 2.626163 0.0097
time2 -0.3424861 0.08306123 124 -4.123297 0.0001
scale(Smoker_0no_1yes_2yestoday_t3) 0.4136064 0.10192969 60 4.057762 0.0001
Gender 0.0617730 0.23290594 60 0.265227 0.7917
scale(TodayCaff_NumCups_t3) 0.1653129 0.10329758 60 1.600356 0.1148
Correlation:
(Intr) time1 time2 s(S_0_ Gender
time1 -0.335
time2 -0.341 0.501
scale(Smoker_0no_1yes_2yestoday_t3) 0.062 0.000 0.000
Gender -0.471 0.000 0.004 -0.131
scale(TodayCaff_NumCups_t3) -0.097 0.000 0.004 -0.228 0.212
Standardized Within-Group Residuals:
Min Q1 Med Q3 Max
-0.97620285 -0.26764819 -0.04103578 0.21320734 1.12727444
Number of Observations: 190
Number of Groups:
ID time %in% ID
64 190
summary(glht(timeCortModel,linfct=mcp(time="Tukey")))
Simultaneous Tests for General Linear Hypotheses
Multiple Comparisons of Means: Tukey Contrasts
Fit: lme.formula(fixed = scale(cort) ~ time + scale(Smoker_0no_1yes_2yestoday_t3) +
Gender + scale(TodayCaff_NumCups_t3), data = cort.db2, random = ~1 |
ID/time, na.action = na.omit)
Linear Hypotheses:
Estimate Std. Error z value Pr(>|z|)
1 - 0 == 0 0.21837 0.08315 2.626 0.0235 *
2 - 0 == 0 -0.34249 0.08306 -4.123 <0.001 ***
2 - 1 == 0 -0.56086 0.08306 -6.752 <0.001 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Adjusted p values reported -- single-step method)
timeNAModel <- lme(scale(na) ~ time, random = ~1|ID/time, data=panas.db2, na.action = na.omit)
summary(timeNAModel)
Linear mixed-effects model fit by REML
Data: panas.db2
AIC BIC logLik
418.303 437.7216 -203.1515
Random effects:
Formula: ~1 | ID
(Intercept)
StdDev: 0.7823731
Formula: ~1 | time %in% ID
(Intercept) Residual
StdDev: 0.4250258 0.216859
Fixed effects: scale(na) ~ time
Value Std.Error DF t-value p-value
(Intercept) -0.1572686 0.11454955 125 -1.372931 0.1722
time1 0.7141996 0.08482399 125 8.419784 0.0000
time2 -0.2414496 0.08434949 125 -2.862491 0.0049
Correlation:
(Intr) time1
time1 -0.366
time2 -0.368 0.497
Standardized Within-Group Residuals:
Min Q1 Med Q3 Max
-1.35905547 -0.21694541 -0.02282059 0.23362659 1.18507915
Number of Observations: 191
Number of Groups:
ID time %in% ID
64 191
summary(glht(timeNAModel,linfct=mcp(time="Tukey")))
Simultaneous Tests for General Linear Hypotheses
Multiple Comparisons of Means: Tukey Contrasts
Fit: lme.formula(fixed = scale(na) ~ time, data = panas.db2, random = ~1 |
ID/time, na.action = na.omit)
Linear Hypotheses:
Estimate Std. Error z value Pr(>|z|)
1 - 0 == 0 0.71420 0.08482 8.420 <0.001 ***
2 - 0 == 0 -0.24145 0.08435 -2.862 0.0118 *
2 - 1 == 0 -0.95565 0.08482 -11.266 <0.001 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Adjusted p values reported -- single-step method)
timePAModel <- lme(scale(pa) ~ time, random = ~1|ID/time, data=panas.db2, na.action = na.omit)
summary(timePAModel)
Linear mixed-effects model fit by REML
Data: panas.db2
AIC BIC logLik
438.1242 457.4138 -213.0621
Random effects:
Formula: ~1 | ID
(Intercept)
StdDev: 0.7473613
Formula: ~1 | time %in% ID
(Intercept) Residual
StdDev: 0.486039 0.2339577
Fixed effects: scale(pa) ~ time
Value Std.Error DF t-value p-value
(Intercept) 0.5867623 0.11703474 121 5.013574 0
time1 -1.0651259 0.09755107 121 -10.918649 0
time2 -0.6516620 0.09809358 121 -6.643268 0
Correlation:
(Intr) time1
time1 -0.435
time2 -0.433 0.520
Standardized Within-Group Residuals:
Min Q1 Med Q3 Max
-0.89992664 -0.23461635 -0.04203701 0.20186024 1.32698968
Number of Observations: 187
Number of Groups:
ID time %in% ID
64 187
summary(glht(timePAModel,linfct=mcp(time="Tukey")))
Simultaneous Tests for General Linear Hypotheses
Multiple Comparisons of Means: Tukey Contrasts
Fit: lme.formula(fixed = scale(pa) ~ time, data = panas.db2, random = ~1 |
ID/time, na.action = na.omit)
Linear Hypotheses:
Estimate Std. Error z value Pr(>|z|)
1 - 0 == 0 -1.06513 0.09755 -10.919 < 0.00001 ***
2 - 0 == 0 -0.65166 0.09809 -6.643 < 0.00001 ***
2 - 1 == 0 0.41346 0.09588 4.312 0.000043 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Adjusted p values reported -- single-step method)
#PTQ at Time 1 - cort
PTQ1model <- lme(scale(cort) ~ time + scale(PTQ1) + scale(Smoker_0no_1yes_2yestoday_t3) + Gender+ scale(TodayCaff_NumCups_t3), random = ~1|ID/time, data=cort.db2, na.action = na.omit)
summary(PTQ1model)
Linear mixed-effects model fit by REML
Data: cort.db2
AIC BIC logLik
412.9798 445.0747 -196.4899
Random effects:
Formula: ~1 | ID
(Intercept)
StdDev: 0.7063202
Formula: ~1 | time %in% ID
(Intercept) Residual
StdDev: 0.4182942 0.2072122
Fixed effects: scale(cort) ~ time + scale(PTQ1) + scale(Smoker_0no_1yes_2yestoday_t3) + Gender + scale(TodayCaff_NumCups_t3)
Value Std.Error DF t-value p-value
(Intercept) 0.0500602 0.12035649 124 0.415933 0.6782
time1 0.2183737 0.08317259 124 2.625549 0.0097
time2 -0.3420816 0.08307487 124 -4.117750 0.0001
scale(PTQ1) 0.2274169 0.09582278 59 2.373307 0.0209
scale(Smoker_0no_1yes_2yestoday_t3) 0.4159225 0.09815613 59 4.237356 0.0001
Gender 0.0147224 0.22517454 59 0.065382 0.9481
scale(TodayCaff_NumCups_t3) 0.1464767 0.09979631 59 1.467756 0.1475
Correlation:
(Intr) time1 time2 s(PTQ1 s(S_0_ Gender
time1 -0.346
time2 -0.351 0.501
scale(PTQ1) 0.042 0.000 0.000
scale(Smoker_0no_1yes_2yestoday_t3) 0.062 0.000 0.000 0.010
Gender -0.470 0.000 0.004 -0.089 -0.131
scale(TodayCaff_NumCups_t3) -0.100 0.000 0.004 -0.080 -0.228 0.218
Standardized Within-Group Residuals:
Min Q1 Med Q3 Max
-0.94349380 -0.25477933 -0.04640205 0.20268351 1.12043504
Number of Observations: 190
Number of Groups:
ID time %in% ID
64 190
#Look at PTQ at Time 0 - cort
PTQ0model <- lme(scale(cort) ~ time + scale(PTQ0) + scale(Smoker_0no_1yes_2yestoday_t3) + Gender+ scale(TodayCaff_NumCups_t3), random = ~1|ID/time, data=cort.db2, na.action = na.omit)
summary(PTQ0model)
Linear mixed-effects model fit by REML
Data: cort.db2
AIC BIC logLik
410.2401 442.2801 -195.12
Random effects:
Formula: ~1 | ID
(Intercept)
StdDev: 0.7085451
Formula: ~1 | time %in% ID
(Intercept) Residual
StdDev: 0.4172721 0.2072473
Fixed effects: scale(cort) ~ time + scale(PTQ0) + scale(Smoker_0no_1yes_2yestoday_t3) + Gender + scale(TodayCaff_NumCups_t3)
Value Std.Error DF t-value p-value
(Intercept) 0.0189250 0.12122376 124 0.156116 0.8762
time1 0.2183425 0.08301222 124 2.630245 0.0096
time2 -0.3492506 0.08301222 124 -4.207219 0.0000
scale(PTQ0) 0.1812139 0.09661547 58 1.875620 0.0657
scale(Smoker_0no_1yes_2yestoday_t3) 0.4140830 0.09864664 58 4.197639 0.0001
Gender 0.0972997 0.22553516 58 0.431417 0.6678
scale(TodayCaff_NumCups_t3) 0.1564330 0.10097474 58 1.549229 0.1268
Correlation:
(Intr) time1 time2 s(PTQ0 s(S_0_ Gender
time1 -0.342
time2 -0.342 0.500
scale(PTQ0) -0.004 0.000 0.000
scale(Smoker_0no_1yes_2yestoday_t3) 0.061 0.000 0.000 -0.012
Gender -0.473 0.000 0.000 0.009 -0.130
scale(TodayCaff_NumCups_t3) -0.101 0.000 0.000 -0.124 -0.223 0.214
Standardized Within-Group Residuals:
Min Q1 Med Q3 Max
-0.94100321 -0.26053106 -0.05318282 0.20600903 1.12407133
Number of Observations: 189
Number of Groups:
ID time %in% ID
63 189
#Look at PTQ at Time 3 - cort
PTQ3model <- lme(scale(cort) ~ time + scale(PTQ3) + scale(Smoker_0no_1yes_2yestoday_t3) + Gender+ scale(TodayCaff_NumCups_t3), random = ~1|ID/time, data=cort.db2, na.action = na.omit)
summary(PTQ3model)
Linear mixed-effects model fit by REML
Data: cort.db2
AIC BIC logLik
415.8721 447.967 -197.9361
Random effects:
Formula: ~1 | ID
(Intercept)
StdDev: 0.7268424
Formula: ~1 | time %in% ID
(Intercept) Residual
StdDev: 0.417478 0.2087699
Fixed effects: scale(cort) ~ time + scale(PTQ3) + scale(Smoker_0no_1yes_2yestoday_t3) + Gender + scale(TodayCaff_NumCups_t3)
Value Std.Error DF t-value p-value
(Intercept) 0.0370822 0.12280871 124 0.301951 0.7632
time1 0.2183737 0.08316607 124 2.625755 0.0097
time2 -0.3422375 0.08307226 124 -4.119756 0.0001
scale(PTQ3) 0.1582925 0.10013968 59 1.580717 0.1193
scale(Smoker_0no_1yes_2yestoday_t3) 0.4231892 0.10082632 59 4.197210 0.0001
Gender 0.0678744 0.23000287 59 0.295102 0.7690
scale(TodayCaff_NumCups_t3) 0.1302631 0.10438818 59 1.247872 0.2170
Correlation:
(Intr) time1 time2 s(PTQ3 s(S_0_ Gender
time1 -0.339
time2 -0.344 0.501
scale(PTQ3) -0.007 0.000 0.001
scale(Smoker_0no_1yes_2yestoday_t3) 0.062 0.000 0.001 0.060
Gender -0.470 0.000 0.004 0.016 -0.129
scale(TodayCaff_NumCups_t3) -0.093 0.000 0.004 -0.213 -0.235 0.204
Standardized Within-Group Residuals:
Min Q1 Med Q3 Max
-0.96399562 -0.26721093 -0.04487948 0.22013418 1.11938377
Number of Observations: 190
Number of Groups:
ID time %in% ID
64 190
#NA models
PTQ1modelNA <- lme(scale(na) ~ time + scale(PTQ1), random = ~1|ID/time, data=panas.db2, na.action = na.omit)
summary(PTQ1modelNA)
Linear mixed-effects model fit by REML
Data: panas.db2
AIC BIC logLik
400.8713 423.489 -193.4356
Random effects:
Formula: ~1 | ID
(Intercept)
StdDev: 0.6431133
Formula: ~1 | time %in% ID
(Intercept) Residual
StdDev: 0.4303822 0.205853
Fixed effects: scale(na) ~ time + scale(PTQ1)
Value Std.Error DF t-value p-value
(Intercept) -0.1533661 0.10009649 125 -1.532183 0.1280
time1 0.7121978 0.08480249 125 8.398313 0.0000
time2 -0.2414496 0.08433643 125 -2.862934 0.0049
scale(PTQ1) 0.4505852 0.08741767 62 5.154395 0.0000
Correlation:
(Intr) time1 time2
time1 -0.419
time2 -0.421 0.497
scale(PTQ1) 0.008 -0.006 0.000
Standardized Within-Group Residuals:
Min Q1 Med Q3 Max
-1.247508145 -0.252140115 -0.002562848 0.216564008 1.170065514
Number of Observations: 191
Number of Groups:
ID time %in% ID
64 191
PTQ0modelNA <- lme(scale(na) ~ time + scale(PTQ0), random = ~1|ID/time, data=panas.db2, na.action = na.omit)
summary(PTQ0modelNA)
Linear mixed-effects model fit by REML
Data: panas.db2
AIC BIC logLik
396.2847 418.7892 -191.1423
Random effects:
Formula: ~1 | ID
(Intercept)
StdDev: 0.6793328
Formula: ~1 | time %in% ID
(Intercept) Residual
StdDev: 0.4216155 0.2063103
Fixed effects: scale(na) ~ time + scale(PTQ0)
Value Std.Error DF t-value p-value
(Intercept) -0.1614936 0.10403486 123 -1.552303 0.1232
time1 0.7288247 0.08410610 123 8.665539 0.0000
time2 -0.2336321 0.08363252 123 -2.793556 0.0060
scale(PTQ0) 0.3993728 0.09200253 61 4.340889 0.0001
Correlation:
(Intr) time1 time2
time1 -0.400
time2 -0.402 0.497
scale(PTQ0) 0.008 -0.006 0.000
Standardized Within-Group Residuals:
Min Q1 Med Q3 Max
-1.312759749 -0.252315281 -0.005210294 0.222057071 1.158352163
Number of Observations: 188
Number of Groups:
ID time %in% ID
63 188
PTQ3modelNA <- lme(scale(na) ~ time + scale(PTQ3), random = ~1|ID/time, data=panas.db2, na.action = na.omit)
summary(PTQ3modelNA)
Linear mixed-effects model fit by REML
Data: panas.db2
AIC BIC logLik
383.0612 405.679 -184.5306
Random effects:
Formula: ~1 | ID
(Intercept)
StdDev: 0.5396926
Formula: ~1 | time %in% ID
(Intercept) Residual
StdDev: 0.4345089 0.1969835
Fixed effects: scale(na) ~ time + scale(PTQ3)
Value Std.Error DF t-value p-value
(Intercept) -0.1525628 0.09004286 125 -1.694336 0.0927
time1 0.7113517 0.08479119 125 8.389453 0.0000
time2 -0.2414496 0.08433573 125 -2.862958 0.0049
scale(PTQ3) 0.5672581 0.07577764 62 7.485825 0.0000
Correlation:
(Intr) time1 time2
time1 -0.466
time2 -0.468 0.497
scale(PTQ3) 0.007 -0.006 0.000
Standardized Within-Group Residuals:
Min Q1 Med Q3 Max
-1.304674935 -0.239265947 -0.003492833 0.199392842 1.009504310
Number of Observations: 191
Number of Groups:
ID time %in% ID
64 191
#PA models
PTQ1modelPA <- lme(scale(pa) ~ time + scale(PTQ1), random = ~1|ID/time, data=panas.db2, na.action = na.omit)
summary(PTQ1modelPA)
Linear mixed-effects model fit by REML
Data: panas.db2
AIC BIC logLik
442.2445 464.711 -214.1223
Random effects:
Formula: ~1 | ID
(Intercept)
StdDev: 0.7493757
Formula: ~1 | time %in% ID
(Intercept) Residual
StdDev: 0.4861518 0.2340715
Fixed effects: scale(pa) ~ time + scale(PTQ1)
Value Std.Error DF t-value p-value
(Intercept) 0.5872851 0.11724997 121 5.008829 0.0000
time1 -1.0643397 0.09758404 121 -10.906903 0.0000
time2 -0.6509131 0.09812639 121 -6.633415 0.0000
scale(PTQ1) -0.0803089 0.10037914 62 -0.800056 0.4267
Correlation:
(Intr) time1 time2
time1 -0.435
time2 -0.432 0.520
scale(PTQ1) -0.005 -0.010 -0.010
Standardized Within-Group Residuals:
Min Q1 Med Q3 Max
-0.89657251 -0.23906409 -0.04591769 0.20251529 1.30900026
Number of Observations: 187
Number of Groups:
ID time %in% ID
64 187
PTQ0modelPA <- lme(scale(pa) ~ time + scale(PTQ0), random = ~1|ID/time, data=panas.db2, na.action = na.omit)
summary(PTQ0modelPA)
Linear mixed-effects model fit by REML
Data: panas.db2
AIC BIC logLik
426.8402 449.1909 -206.4201
Random effects:
Formula: ~1 | ID
(Intercept)
StdDev: 0.7550802
Formula: ~1 | time %in% ID
(Intercept) Residual
StdDev: 0.4673454 0.2282147
Fixed effects: scale(pa) ~ time + scale(PTQ0)
Value Std.Error DF t-value p-value
(Intercept) 0.6005520 0.11727109 119 5.121058 0.0000
time1 -1.0656306 0.09485146 119 -11.234730 0.0000
time2 -0.6863469 0.09539172 119 -7.195036 0.0000
scale(PTQ0) -0.1331617 0.10106829 61 -1.317542 0.1926
Correlation:
(Intr) time1 time2
time1 -0.423
time2 -0.421 0.520
scale(PTQ0) -0.004 -0.010 -0.011
Standardized Within-Group Residuals:
Min Q1 Med Q3 Max
-0.95093173 -0.24317540 -0.03761091 0.20359792 1.36527698
Number of Observations: 184
Number of Groups:
ID time %in% ID
63 184
PTQ3modelPA <- lme(scale(pa) ~ time + scale(PTQ3), random = ~1|ID/time, data=panas.db2, na.action = na.omit)
summary(PTQ3modelPA)
Linear mixed-effects model fit by REML
Data: panas.db2
AIC BIC logLik
442.7646 465.231 -214.3823
Random effects:
Formula: ~1 | ID
(Intercept)
StdDev: 0.7539358
Formula: ~1 | time %in% ID
(Intercept) Residual
StdDev: 0.4857548 0.2344235
Fixed effects: scale(pa) ~ time + scale(PTQ3)
Value Std.Error DF t-value p-value
(Intercept) 0.5867534 0.11768948 121 4.985606 0.0000
time1 -1.0650828 0.09754387 121 -10.919013 0.0000
time2 -0.6515705 0.09808747 121 -6.642750 0.0000
scale(PTQ3) -0.0316298 0.10188250 62 -0.310453 0.7573
Correlation:
(Intr) time1 time2
time1 -0.433
time2 -0.431 0.520
scale(PTQ3) 0.001 -0.002 -0.004
Standardized Within-Group Residuals:
Min Q1 Med Q3 Max
-0.89600883 -0.23311783 -0.04384287 0.20316802 1.32376753
Number of Observations: 187
Number of Groups:
ID time %in% ID
64 187
PTQ associated with greater cortisol and NA overall, but not PA.
#cort
cortBL_PTQ1model <- lm(scale(cortBL) ~ scale(PTQ1) + scale(Smoker_0no_1yes_2yestoday_t3) + Gender+ scale(TodayCaff_NumCups_t3), data=cortdata)
summary(cortBL_PTQ1model)
Call:
lm(formula = scale(cortBL) ~ scale(PTQ1) + scale(Smoker_0no_1yes_2yestoday_t3) +
Gender + scale(TodayCaff_NumCups_t3), data = cortdata)
Residuals:
Min 1Q Median 3Q Max
-1.7820 -0.5820 -0.1870 0.4045 2.0597
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.01083 0.12956 0.084 0.934
scale(PTQ1) 0.18929 0.11522 1.643 0.106
scale(Smoker_0no_1yes_2yestoday_t3) 0.47910 0.11445 4.186 0.0000976 ***
Gender -0.07512 0.26321 -0.285 0.776
scale(TodayCaff_NumCups_t3) 0.02532 0.11690 0.217 0.829
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.881 on 58 degrees of freedom
(27 observations deleted due to missingness)
Multiple R-squared: 0.2739, Adjusted R-squared: 0.2238
F-statistic: 5.468 on 4 and 58 DF, p-value: 0.000834
#NA
naBL_PTQ1model <- lm(scale(naBL) ~ scale(PTQ1), data=panasdata)
summary(naBL_PTQ1model)
Call:
lm(formula = scale(naBL) ~ scale(PTQ1), data = panasdata)
Residuals:
Min 1Q Median 3Q Max
-1.5109 -0.4716 -0.1489 0.2861 3.0212
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.01365 0.11227 -0.122 0.903632
scale(PTQ1) 0.46931 0.11669 4.022 0.000159 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.8977 on 62 degrees of freedom
(26 observations deleted due to missingness)
Multiple R-squared: 0.2069, Adjusted R-squared: 0.1941
F-statistic: 16.17 on 1 and 62 DF, p-value: 0.0001593
#PA
paBL_PTQ1model <- lm(scale(paBL) ~ scale(PTQ1), data=panasdata)
summary(paBL_PTQ1model)
Call:
lm(formula = scale(paBL) ~ scale(PTQ1), data = panasdata)
Residuals:
Min 1Q Median 3Q Max
-2.2792 -0.6977 0.1208 0.7871 1.6269
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.006451 0.121794 -0.053 0.95794
scale(PTQ1) -0.393545 0.136497 -2.883 0.00551 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.9433 on 58 degrees of freedom
(30 observations deleted due to missingness)
Multiple R-squared: 0.1254, Adjusted R-squared: 0.1103
F-statistic: 8.313 on 1 and 58 DF, p-value: 0.005515
PTQ associated with greater self-reported NA and lower self-reported PA at baseline, but not associated with cortisol at baseline.
#Cort - Stress
cortStress_PTQ1model <- lm(scale(cortStress) ~ scale(PTQ1) + scale(Smoker_0no_1yes_2yestoday_t3) + Gender+ scale(TodayCaff_NumCups_t3), data=cortdata)
summary(cortStress_PTQ1model)
Call:
lm(formula = scale(cortStress) ~ scale(PTQ1) + scale(Smoker_0no_1yes_2yestoday_t3) +
Gender + scale(TodayCaff_NumCups_t3), data = cortdata)
Residuals:
Min 1Q Median 3Q Max
-1.74548 -0.57011 -0.06136 0.36719 2.22983
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.011115 0.121370 -0.092 0.927348
scale(PTQ1) 0.233305 0.107939 2.161 0.034800 *
scale(Smoker_0no_1yes_2yestoday_t3) 0.438062 0.107219 4.086 0.000137 ***
Gender -0.001594 0.246580 -0.006 0.994863
scale(TodayCaff_NumCups_t3) 0.246117 0.109509 2.247 0.028429 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.8254 on 58 degrees of freedom
(27 observations deleted due to missingness)
Multiple R-squared: 0.3627, Adjusted R-squared: 0.3188
F-statistic: 8.253 on 4 and 58 DF, p-value: 0.00002436
##Cort - Stress controlling for cort BL
cortStress_PTQ1model_BL <- lm(scale(cortStress) ~ scale(PTQ1) + scale(Smoker_0no_1yes_2yestoday_t3) + Gender+ scale(TodayCaff_NumCups_t3) + scale(cortBL), data=cortdata)
summary(cortStress_PTQ1model_BL)
Call:
lm(formula = scale(cortStress) ~ scale(PTQ1) + scale(Smoker_0no_1yes_2yestoday_t3) +
Gender + scale(TodayCaff_NumCups_t3) + scale(cortBL), data = cortdata)
Residuals:
Min 1Q Median 3Q Max
-0.9137 -0.3542 -0.1531 0.2373 1.6083
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.01895 0.07783 -0.243 0.80856
scale(PTQ1) 0.09642 0.07081 1.362 0.17865
scale(Smoker_0no_1yes_2yestoday_t3) 0.09160 0.07846 1.168 0.24784
Gender 0.05273 0.15823 0.333 0.74019
scale(TodayCaff_NumCups_t3) 0.22780 0.07025 3.243 0.00198 **
scale(cortBL) 0.72315 0.07888 9.168 0.000000000000823 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.5293 on 57 degrees of freedom
(27 observations deleted due to missingness)
Multiple R-squared: 0.7425, Adjusted R-squared: 0.7199
F-statistic: 32.87 on 5 and 57 DF, p-value: 0.000000000000001285
#NA - Stress
naStress_PTQ1model <- lm(scale(naStress) ~ scale(PTQ1), data=panasdata)
summary(naStress_PTQ1model)
Call:
lm(formula = scale(naStress) ~ scale(PTQ1), data = panasdata)
Residuals:
Min 1Q Median 3Q Max
-1.54800 -0.63772 -0.06647 0.50661 2.08805
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.03208 0.10500 -0.305 0.761
scale(PTQ1) 0.59089 0.11057 5.344 0.00000143 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.832 on 61 degrees of freedom
(27 observations deleted due to missingness)
Multiple R-squared: 0.3189, Adjusted R-squared: 0.3077
F-statistic: 28.56 on 1 and 61 DF, p-value: 0.00000143
#NA - Stress controlling for NA BL
naStress_PTQ1model <- lm(scale(naStress) ~ scale(PTQ1) + scale(naBL), data=panasdata)
summary(naStress_PTQ1model)
Call:
lm(formula = scale(naStress) ~ scale(PTQ1) + scale(naBL), data = panasdata)
Residuals:
Min 1Q Median 3Q Max
-1.1076 -0.4127 -0.2100 0.4329 1.3887
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.02300 0.07099 -0.324 0.74708
scale(PTQ1) 0.27115 0.08354 3.246 0.00192 **
scale(naBL) 0.68213 0.07957 8.573 0.0000000000052 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.5625 on 60 degrees of freedom
(27 observations deleted due to missingness)
Multiple R-squared: 0.6939, Adjusted R-squared: 0.6836
F-statistic: 67.99 on 2 and 60 DF, p-value: 0.0000000000000003783
#PA - Stress
paStress_PTQ1model <- lm(scale(paStress) ~ scale(PTQ1), data=panasdata)
summary(paStress_PTQ1model)
Call:
lm(formula = scale(paStress) ~ scale(PTQ1), data = panasdata)
Residuals:
Min 1Q Median 3Q Max
-1.1745 -0.8064 -0.2381 0.6239 3.9314
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.001132 0.125972 -0.009 0.993
scale(PTQ1) 0.038940 0.130937 0.297 0.767
Residual standard error: 1.007 on 62 degrees of freedom
(26 observations deleted due to missingness)
Multiple R-squared: 0.001424, Adjusted R-squared: -0.01468
F-statistic: 0.08844 on 1 and 62 DF, p-value: 0.7672
#PA - Stress controlling for PA BL
paStress_PTQ1model <- lm(scale(paStress) ~ scale(PTQ1) + scale(paBL), data=panasdata)
summary(paStress_PTQ1model)
Call:
lm(formula = scale(paStress) ~ scale(PTQ1) + scale(paBL), data = panasdata)
Residuals:
Min 1Q Median 3Q Max
-1.50286 -0.42912 -0.06479 0.43940 1.75655
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.01458 0.09185 -0.159 0.874
scale(PTQ1) 0.17397 0.11007 1.581 0.120
scale(paBL) 0.54388 0.09902 5.492 0.000000959 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.7113 on 57 degrees of freedom
(30 observations deleted due to missingness)
Multiple R-squared: 0.3472, Adjusted R-squared: 0.3243
F-statistic: 15.16 on 2 and 57 DF, p-value: 0.000005259
#PTQ and Rec
cortRec_PTQ1model <- lm(scale(cortRec) ~ scale(PTQ1) + scale(Smoker_0no_1yes_2yestoday_t3) + Gender+ scale(TodayCaff_NumCups_t3), data=cortdata)
summary(cortRec_PTQ1model)
Call:
lm(formula = scale(cortRec) ~ scale(PTQ1) + scale(Smoker_0no_1yes_2yestoday_t3) +
Gender + scale(TodayCaff_NumCups_t3), data = cortdata)
Residuals:
Min 1Q Median 3Q Max
-1.6739 -0.4501 -0.0466 0.4608 3.3995
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.06586 0.12325 -0.534 0.59509
scale(PTQ1) 0.32057 0.11090 2.891 0.00537 **
scale(Smoker_0no_1yes_2yestoday_t3) 0.34972 0.11015 3.175 0.00238 **
Gender 0.22616 0.25238 0.896 0.37385
scale(TodayCaff_NumCups_t3) 0.22536 0.11208 2.011 0.04893 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.848 on 59 degrees of freedom
(26 observations deleted due to missingness)
Multiple R-squared: 0.3266, Adjusted R-squared: 0.2809
F-statistic: 7.153 on 4 and 59 DF, p-value: 0.00009145
##PTQ and Rec controlling for cort BL
cortRec_PTQ1model_BL <- lm(scale(cortRec) ~ scale(PTQ1) + scale(Smoker_0no_1yes_2yestoday_t3) + Gender+ scale(TodayCaff_NumCups_t3) + scale(cortBL), data=cortdata)
summary(cortRec_PTQ1model_BL)
Call:
lm(formula = scale(cortRec) ~ scale(PTQ1) + scale(Smoker_0no_1yes_2yestoday_t3) +
Gender + scale(TodayCaff_NumCups_t3) + scale(cortBL), data = cortdata)
Residuals:
Min 1Q Median 3Q Max
-1.40354 -0.35987 -0.08598 0.33943 2.93451
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.11493 0.09745 -1.179 0.2432
scale(PTQ1) 0.21551 0.08866 2.431 0.0182 *
scale(Smoker_0no_1yes_2yestoday_t3) 0.08847 0.09823 0.901 0.3716
Gender 0.31762 0.19812 1.603 0.1144
scale(TodayCaff_NumCups_t3) 0.23392 0.08796 2.659 0.0101 *
scale(cortBL) 0.55104 0.09876 5.579 0.000000695 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.6627 on 57 degrees of freedom
(27 observations deleted due to missingness)
Multiple R-squared: 0.586, Adjusted R-squared: 0.5497
F-statistic: 16.14 on 5 and 57 DF, p-value: 0.0000000006873
#NA - Recovery
naRec_PTQ1model <- lm(scale(naRec) ~ scale(PTQ1), data=panasdata)
summary(naRec_PTQ1model)
Call:
lm(formula = scale(naRec) ~ scale(PTQ1), data = panasdata)
Residuals:
Min 1Q Median 3Q Max
-1.5341 -0.4353 -0.1165 0.3640 3.1080
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.01463 0.11006 -0.133 0.895
scale(PTQ1) 0.50302 0.11440 4.397 0.0000439 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.8801 on 62 degrees of freedom
(26 observations deleted due to missingness)
Multiple R-squared: 0.2377, Adjusted R-squared: 0.2254
F-statistic: 19.33 on 1 and 62 DF, p-value: 0.00004388
#NA - Recovery controlling for NA BL
naRec_PTQ1model <- lm(scale(naRec) ~ scale(PTQ1) + scale(naBL), data=panasdata)
summary(naRec_PTQ1model)
Call:
lm(formula = scale(naRec) ~ scale(PTQ1) + scale(naBL), data = panasdata)
Residuals:
Min 1Q Median 3Q Max
-1.9517 -0.2868 -0.0564 0.2015 1.5508
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.004337 0.070920 -0.061 0.9514
scale(PTQ1) 0.149129 0.082765 1.802 0.0765 .
scale(naBL) 0.754073 0.080219 9.400 0.00000000000018 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.567 on 61 degrees of freedom
(26 observations deleted due to missingness)
Multiple R-squared: 0.6887, Adjusted R-squared: 0.6785
F-statistic: 67.47 on 2 and 61 DF, p-value: 0.0000000000000003491
#PA - Recovery
paRec_PTQ1model <- lm(scale(paRec) ~ scale(PTQ1), data=panasdata)
summary(paRec_PTQ1model)
Call:
lm(formula = scale(paRec) ~ scale(PTQ1), data = panasdata)
Residuals:
Min 1Q Median 3Q Max
-1.2675 -0.8261 -0.2642 0.6410 3.1549
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.0009899 0.1269811 0.008 0.994
scale(PTQ1) -0.0371303 0.1309874 -0.283 0.778
Residual standard error: 1.008 on 61 degrees of freedom
(27 observations deleted due to missingness)
Multiple R-squared: 0.001316, Adjusted R-squared: -0.01506
F-statistic: 0.08035 on 1 and 61 DF, p-value: 0.7778
#PA - Recovery controlling for PA BL
paRec_PTQ1model <- lm(scale(paRec) ~ scale(PTQ1) + scale(paBL), data=panasdata)
summary(paRec_PTQ1model)
Call:
lm(formula = scale(paRec) ~ scale(PTQ1) + scale(paBL), data = panasdata)
Residuals:
Min 1Q Median 3Q Max
-1.68120 -0.39305 -0.09109 0.46449 2.07580
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.004133 0.102901 -0.040 0.968
scale(PTQ1) 0.092644 0.122346 0.757 0.452
scale(paBL) 0.527658 0.110035 4.795 0.0000124 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.7902 on 56 degrees of freedom
(31 observations deleted due to missingness)
Multiple R-squared: 0.3001, Adjusted R-squared: 0.2751
F-statistic: 12.01 on 2 and 56 DF, p-value: 0.00004578