library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.1.2 ✔ readr 2.1.4
## ✔ forcats 1.0.0 ✔ stringr 1.5.0
## ✔ ggplot2 3.4.2 ✔ tibble 3.2.1
## ✔ lubridate 1.9.2 ✔ tidyr 1.3.0
## ✔ purrr 1.0.1
## ── 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(ggplot2)
library(janitor)
##
## Attaching package: 'janitor'
##
## The following objects are masked from 'package:stats':
##
## chisq.test, fisher.test
library(broom)
library(dplyr)
library(tidyr)
library(purrr)
library(readxl)
library(openxlsx)
library(readr)
library(stringr)
library(afex)
## Loading required package: lme4
## Loading required package: Matrix
##
## Attaching package: 'Matrix'
##
## The following objects are masked from 'package:tidyr':
##
## expand, pack, unpack
##
## ************
## Welcome to afex. For support visit: http://afex.singmann.science/
## - Functions for ANOVAs: aov_car(), aov_ez(), and aov_4()
## - Methods for calculating p-values with mixed(): 'S', 'KR', 'LRT', and 'PB'
## - 'afex_aov' and 'mixed' objects can be passed to emmeans() for follow-up tests
## - Get and set global package options with: afex_options()
## - Set sum-to-zero contrasts globally: set_sum_contrasts()
## - For example analyses see: browseVignettes("afex")
## ************
##
## Attaching package: 'afex'
##
## The following object is masked from 'package:lme4':
##
## lmer
library(nlme)
##
## Attaching package: 'nlme'
##
## The following object is masked from 'package:lme4':
##
## lmList
##
## The following object is masked from 'package:dplyr':
##
## collapse
library(emmeans)
library(effects)
## Loading required package: carData
## lattice theme set by effectsTheme()
## See ?effectsTheme for details.
library(reshape2)
##
## Attaching package: 'reshape2'
##
## The following object is masked from 'package:tidyr':
##
## smiths
library(lme4)
library(brms)
## Warning: package 'brms' was built under R version 4.3.1
## Loading required package: Rcpp
## Loading 'brms' package (version 2.19.0). Useful instructions
## can be found by typing help('brms'). A more detailed introduction
## to the package is available through vignette('brms_overview').
##
## Attaching package: 'brms'
##
## The following object is masked from 'package:lme4':
##
## ngrps
##
## The following object is masked from 'package:stats':
##
## ar
The participant were asked to fill the Nasa tlx after 5 block and after 10 blocks
Condition 1= Cold temperature
Condition 2= Warm temperature
SURVEY <- read.xlsx("DATAsurvey - Copy.xlsx")
HM <- read.xlsx("heatmap.xlsx")
Mental1 <- lm( Mental1~ CONDITION, data = SURVEY)
Mental2 <- lm(Mental2 ~ CONDITION , data = SURVEY)
Physical1 <- lm(Physical1~ CONDITION , data = SURVEY)
Physical2 <- lm(Physical2~ CONDITION , data = SURVEY)
Temporal1 <- lm(Temporal1~ CONDITION, data = SURVEY)
Temporal2 <- lm(Temporal2 ~ CONDITION, data = SURVEY)
Performance1 <- lm(Performance1 ~ CONDITION, data = SURVEY)
Performance2 <- lm(Performance2 ~ CONDITION, data = SURVEY)
Effort1 <- lm(Effort1 ~ CONDITION , data = SURVEY)
Effort2 <- lm(Effort2 ~ CONDITION , data = SURVEY)
Frustration1 <- lm(Frustration1 ~ CONDITION , data = SURVEY)
Frustration2 <- lm(Frustration2 ~ CONDITION , data = SURVEY)
summary(Mental1)
##
## Call:
## lm(formula = Mental1 ~ CONDITION, data = SURVEY)
##
## Residuals:
## Min 1Q Median 3Q Max
## -10.8235 -3.5882 -0.3529 3.1765 9.1176
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 6.941 2.779 2.498 0.0178 *
## CONDITION 2.941 1.758 1.673 0.1040
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 5.124 on 32 degrees of freedom
## Multiple R-squared: 0.08047, Adjusted R-squared: 0.05173
## F-statistic: 2.8 on 1 and 32 DF, p-value: 0.104
summary(Mental2)
##
## Call:
## lm(formula = Mental2 ~ CONDITION, data = SURVEY)
##
## Residuals:
## Min 1Q Median 3Q Max
## -9.4118 -3.8971 -0.2353 4.4265 9.5882
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 8.765 2.672 3.280 0.00251 **
## CONDITION 1.647 1.690 0.974 0.33713
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 4.928 on 32 degrees of freedom
## Multiple R-squared: 0.02882, Adjusted R-squared: -0.00153
## F-statistic: 0.9496 on 1 and 32 DF, p-value: 0.3371
summary(Physical1)
##
## Call:
## lm(formula = Physical1 ~ CONDITION, data = SURVEY)
##
## Residuals:
## Min 1Q Median 3Q Max
## -10.2941 -3.2941 -0.4412 2.4118 9.7059
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 9.000 2.572 3.499 0.00139 **
## CONDITION 2.294 1.627 1.410 0.16807
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 4.742 on 32 degrees of freedom
## Multiple R-squared: 0.05852, Adjusted R-squared: 0.0291
## F-statistic: 1.989 on 1 and 32 DF, p-value: 0.1681
summary(Physical2)
##
## Call:
## lm(formula = Physical2 ~ CONDITION, data = SURVEY)
##
## Residuals:
## Min 1Q Median 3Q Max
## -10.353 -3.765 1.735 4.088 8.235
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 9.941 2.669 3.725 0.000753 ***
## CONDITION 1.412 1.688 0.836 0.409134
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 4.921 on 32 degrees of freedom
## Multiple R-squared: 0.02139, Adjusted R-squared: -0.009188
## F-statistic: 0.6996 on 1 and 32 DF, p-value: 0.4091
summary(Temporal1)
##
## Call:
## lm(formula = Temporal1 ~ CONDITION, data = SURVEY)
##
## Residuals:
## Min 1Q Median 3Q Max
## -8.8824 -3.5000 -0.7941 3.0441 8.1176
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 12.0588 2.3703 5.087 1.54e-05 ***
## CONDITION -0.1765 1.4991 -0.118 0.907
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 4.371 on 32 degrees of freedom
## Multiple R-squared: 0.0004328, Adjusted R-squared: -0.0308
## F-statistic: 0.01386 on 1 and 32 DF, p-value: 0.907
summary(Temporal2)
##
## Call:
## lm(formula = Temporal2 ~ CONDITION, data = SURVEY)
##
## Residuals:
## Min 1Q Median 3Q Max
## -7.8824 -3.7500 -0.6176 3.8676 8.6471
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 9.412 2.639 3.567 0.00116 **
## CONDITION 1.471 1.669 0.881 0.38482
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 4.866 on 32 degrees of freedom
## Multiple R-squared: 0.02369, Adjusted R-squared: -0.006822
## F-statistic: 0.7764 on 1 and 32 DF, p-value: 0.3848
summary(Performance1)
##
## Call:
## lm(formula = Performance1 ~ CONDITION, data = SURVEY)
##
## Residuals:
## Min 1Q Median 3Q Max
## -4.529 -2.529 -1.294 2.471 9.706
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 4.7647 1.9921 2.392 0.0228 *
## CONDITION 0.7647 1.2599 0.607 0.5482
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 3.673 on 32 degrees of freedom
## Multiple R-squared: 0.01138, Adjusted R-squared: -0.01951
## F-statistic: 0.3684 on 1 and 32 DF, p-value: 0.5482
summary(Performance2)
##
## Call:
## lm(formula = Performance2 ~ CONDITION, data = SURVEY)
##
## Residuals:
## Min 1Q Median 3Q Max
## -5.8235 -2.8235 -0.8235 1.6176 10.1765
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 6.6471 2.2515 2.952 0.00587 **
## CONDITION 0.5882 1.4240 0.413 0.68229
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 4.152 on 32 degrees of freedom
## Multiple R-squared: 0.005304, Adjusted R-squared: -0.02578
## F-statistic: 0.1706 on 1 and 32 DF, p-value: 0.6823
summary(Effort1)
##
## Call:
## lm(formula = Effort1 ~ CONDITION, data = SURVEY)
##
## Residuals:
## Min 1Q Median 3Q Max
## -8.8824 -3.1471 0.7647 3.0294 9.1176
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 8.529 2.373 3.594 0.00108 **
## CONDITION 3.353 1.501 2.234 0.03261 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 4.376 on 32 degrees of freedom
## Multiple R-squared: 0.1349, Adjusted R-squared: 0.1079
## F-statistic: 4.99 on 1 and 32 DF, p-value: 0.03261
summary(Effort2)
##
## Call:
## lm(formula = Effort2 ~ CONDITION, data = SURVEY)
##
## Residuals:
## Min 1Q Median 3Q Max
## -10.3529 -3.2500 0.5588 4.2500 6.6471
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 11.7647 2.6340 4.467 9.29e-05 ***
## CONDITION 0.5882 1.6659 0.353 0.726
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 4.857 on 32 degrees of freedom
## Multiple R-squared: 0.003881, Adjusted R-squared: -0.02725
## F-statistic: 0.1247 on 1 and 32 DF, p-value: 0.7263
summary(Frustration1)
##
## Call:
## lm(formula = Frustration1 ~ CONDITION, data = SURVEY)
##
## Residuals:
## Min 1Q Median 3Q Max
## -10.647 -6.324 1.000 5.353 9.353
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 11.9412 3.5792 3.336 0.00216 **
## CONDITION -0.2941 2.2637 -0.130 0.89743
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 6.6 on 32 degrees of freedom
## Multiple R-squared: 0.0005273, Adjusted R-squared: -0.03071
## F-statistic: 0.01688 on 1 and 32 DF, p-value: 0.8974
summary(Frustration2)
##
## Call:
## lm(formula = Frustration2 ~ CONDITION, data = SURVEY)
##
## Residuals:
## Min 1Q Median 3Q Max
## -8.4706 -4.2206 0.1176 3.5294 10.5294
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 13.647 2.936 4.648 5.5e-05 ***
## CONDITION -3.176 1.857 -1.711 0.0968 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 5.413 on 32 degrees of freedom
## Multiple R-squared: 0.08379, Adjusted R-squared: 0.05516
## F-statistic: 2.927 on 1 and 32 DF, p-value: 0.09681
Condition seems to have only a significant effect on effort 1 and an effect of 0.09 which is not significant but worth to notice for the frustration 2, therefore i run a post-hoc (emmeans) to check
emmeans(Effort1, ~ CONDITION)
## CONDITION emmean SE df lower.CL upper.CL
## 1 11.9 1.06 32 9.72 14.0
## 2 15.2 1.06 32 13.07 17.4
##
## Confidence level used: 0.95
emmeans(Effort2, ~ CONDITION)
## CONDITION emmean SE df lower.CL upper.CL
## 1 12.4 1.18 32 9.95 14.8
## 2 12.9 1.18 32 10.54 15.3
##
## Confidence level used: 0.95
emmeans(Frustration1, ~ CONDITION)
## CONDITION emmean SE df lower.CL upper.CL
## 1 11.6 1.6 32 8.39 14.9
## 2 11.4 1.6 32 8.09 14.6
##
## Confidence level used: 0.95
emmeans(Frustration2, ~ CONDITION)
## CONDITION emmean SE df lower.CL upper.CL
## 1 10.47 1.31 32 7.80 13.14
## 2 7.29 1.31 32 4.62 9.97
##
## Confidence level used: 0.95
The post-hoc shows that for effort 1 seems to be higher for the condition 2 (Warm) and the frustration 2 even if not statistically significant is higher for condition 1 (Cold)
HM$CONDITION <- factor(HM$CONDITION)
HM$TIMEPOINT <- factor(HM$TIMEPOINT)
Mental <- lmer( Mental1 ~ TIMEPOINT * CONDITION + (1|PARTICIPANT), data = HM)
summary(Mental)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: Mental1 ~ TIMEPOINT * CONDITION + (1 | PARTICIPANT)
## Data: HM
##
## REML criterion at convergence: 380.1
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -1.7122 -0.5396 -0.1092 0.5832 1.6779
##
## Random effects:
## Groups Name Variance Std.Dev.
## PARTICIPANT (Intercept) 17.094 4.134
## Residual 8.176 2.859
## Number of obs: 68, groups: PARTICIPANT, 34
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 9.8824 1.2192 43.9087 8.106 2.89e-10 ***
## TIMEPOINT3 0.5294 0.9808 32.0000 0.540 0.5931
## CONDITION2 2.9412 1.7242 43.9087 1.706 0.0951 .
## TIMEPOINT3:CONDITION2 -1.2941 1.3870 32.0000 -0.933 0.3578
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) TIMEPOINT3 CONDIT
## TIMEPOINT3 -0.402
## CONDITION2 -0.707 0.284
## TIMEPOINT3: 0.284 -0.707 -0.402
Physical <- lmer( Physical1 ~ TIMEPOINT * CONDITION + (1|PARTICIPANT), data = HM)
summary(Physical)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: Physical1 ~ TIMEPOINT * CONDITION + (1 | PARTICIPANT)
## Data: HM
##
## REML criterion at convergence: 374.4
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -1.75996 -0.47211 -0.02457 0.40643 1.57682
##
## Random effects:
## Groups Name Variance Std.Dev.
## PARTICIPANT (Intercept) 15.986 3.998
## Residual 7.366 2.714
## Number of obs: 68, groups: PARTICIPANT, 34
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 11.29412 1.17203 43.58059 9.636 2.28e-12 ***
## TIMEPOINT3 0.05882 0.93092 31.99907 0.063 0.950
## CONDITION2 2.29412 1.65750 43.58059 1.384 0.173
## TIMEPOINT3:CONDITION2 -0.88235 1.31652 31.99907 -0.670 0.508
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) TIMEPOINT3 CONDIT
## TIMEPOINT3 -0.397
## CONDITION2 -0.707 0.281
## TIMEPOINT3: 0.281 -0.707 -0.397
Temporal <- lmer( Temporal1 ~ TIMEPOINT * CONDITION + (1|PARTICIPANT), data = HM)
summary(Temporal)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: Temporal1 ~ TIMEPOINT * CONDITION + (1 | PARTICIPANT)
## Data: HM
##
## REML criterion at convergence: 379.4
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -1.41577 -0.50750 -0.09031 0.61240 1.75079
##
## Random effects:
## Groups Name Variance Std.Dev.
## PARTICIPANT (Intercept) 10.86 3.295
## Residual 10.53 3.245
## Number of obs: 68, groups: PARTICIPANT, 34
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 11.8824 1.1217 50.8827 10.593 1.79e-14 ***
## TIMEPOINT3 -1.0000 1.1130 32.0000 -0.898 0.376
## CONDITION2 -0.1765 1.5863 50.8827 -0.111 0.912
## TIMEPOINT3:CONDITION2 1.6471 1.5740 32.0000 1.046 0.303
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) TIMEPOINT3 CONDIT
## TIMEPOINT3 -0.496
## CONDITION2 -0.707 0.351
## TIMEPOINT3: 0.351 -0.707 -0.496
Performance <- lmer( Performance1 ~ TIMEPOINT * CONDITION + (1|PARTICIPANT), data = HM)
summary(Performance)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: Performance1 ~ TIMEPOINT * CONDITION + (1 | PARTICIPANT)
## Data: HM
##
## REML criterion at convergence: 356
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -1.3364 -0.5617 -0.1924 0.3627 2.1334
##
## Random effects:
## Groups Name Variance Std.Dev.
## PARTICIPANT (Intercept) 8.524 2.920
## Residual 6.840 2.615
## Number of obs: 68, groups: PARTICIPANT, 34
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 5.5294 0.9507 48.9371 5.816 4.5e-07 ***
## TIMEPOINT3 1.7059 0.8971 32.0000 1.902 0.0663 .
## CONDITION2 0.7647 1.3444 48.9371 0.569 0.5721
## TIMEPOINT3:CONDITION2 -0.1765 1.2686 32.0000 -0.139 0.8902
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) TIMEPOINT3 CONDIT
## TIMEPOINT3 -0.472
## CONDITION2 -0.707 0.334
## TIMEPOINT3: 0.334 -0.707 -0.472
Effort <- lmer(Effort1 ~ TIMEPOINT * CONDITION + (1|PARTICIPANT), data = HM)
summary(Effort)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: Effort1 ~ TIMEPOINT * CONDITION + (1 | PARTICIPANT)
## Data: HM
##
## REML criterion at convergence: 369.3
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -2.11218 -0.52153 0.04779 0.53277 1.80599
##
## Random effects:
## Groups Name Variance Std.Dev.
## PARTICIPANT (Intercept) 14.467 3.804
## Residual 6.903 2.627
## Number of obs: 68, groups: PARTICIPANT, 34
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 11.8824 1.1212 43.8863 10.598 1.12e-13 ***
## TIMEPOINT3 0.4706 0.9011 32.0000 0.522 0.6051
## CONDITION2 3.3529 1.5856 43.8863 2.115 0.0402 *
## TIMEPOINT3:CONDITION2 -2.7647 1.2744 32.0000 -2.169 0.0376 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) TIMEPOINT3 CONDIT
## TIMEPOINT3 -0.402
## CONDITION2 -0.707 0.284
## TIMEPOINT3: 0.284 -0.707 -0.402
Frustration <- lmer( Frustration1 ~ TIMEPOINT * CONDITION + (1|PARTICIPANT), data = HM)
summary(Frustration)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: Frustration1 ~ TIMEPOINT * CONDITION + (1 | PARTICIPANT)
## Data: HM
##
## REML criterion at convergence: 392
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -1.99561 -0.43688 0.01434 0.58633 1.62709
##
## Random effects:
## Groups Name Variance Std.Dev.
## PARTICIPANT (Intercept) 28.72 5.359
## Residual 7.71 2.777
## Number of obs: 68, groups: PARTICIPANT, 34
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 11.6471 1.4639 39.4688 7.956 9.95e-10 ***
## TIMEPOINT3 -1.1765 0.9524 32.0000 -1.235 0.2257
## CONDITION2 -0.2941 2.0702 39.4688 -0.142 0.8877
## TIMEPOINT3:CONDITION2 -2.8824 1.3469 32.0000 -2.140 0.0401 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) TIMEPOINT3 CONDIT
## TIMEPOINT3 -0.325
## CONDITION2 -0.707 0.230
## TIMEPOINT3: 0.230 -0.707 -0.325
emmeans(Mental,~ CONDITION )
## NOTE: Results may be misleading due to involvement in interactions
## CONDITION emmean SE df lower.CL upper.CL
## 1 10.1 1.12 32 7.87 12.4
## 2 12.4 1.12 32 10.17 14.7
##
## Results are averaged over the levels of: TIMEPOINT
## Degrees-of-freedom method: kenward-roger
## Confidence level used: 0.95
emmeans(Performance,~ TIMEPOINT)
## NOTE: Results may be misleading due to involvement in interactions
## TIMEPOINT emmean SE df lower.CL upper.CL
## 2 5.91 0.672 48.9 4.56 7.26
## 3 7.53 0.672 48.9 6.18 8.88
##
## Results are averaged over the levels of: CONDITION
## Degrees-of-freedom method: kenward-roger
## Confidence level used: 0.95
emmeans(Effort,~ CONDITION * TIMEPOINT)
## CONDITION TIMEPOINT emmean SE df lower.CL upper.CL
## 1 2 11.9 1.12 43.9 9.62 14.1
## 2 2 15.2 1.12 43.9 12.98 17.5
## 1 3 12.4 1.12 43.9 10.09 14.6
## 2 3 12.9 1.12 43.9 10.68 15.2
##
## Degrees-of-freedom method: kenward-roger
## Confidence level used: 0.95
emmeans(Frustration,~ CONDITION * TIMEPOINT)
## CONDITION TIMEPOINT emmean SE df lower.CL upper.CL
## 1 2 11.65 1.46 39.5 8.69 14.6
## 2 2 11.35 1.46 39.5 8.39 14.3
## 1 3 10.47 1.46 39.5 7.51 13.4
## 2 3 7.29 1.46 39.5 4.33 10.3
##
## Degrees-of-freedom method: kenward-roger
## Confidence level used: 0.95
plot_data <- data.frame(TIMEPOINT = HM$TIMEPOINT,
CONDITION = HM$CONDITION,
Effort1 = HM$Effort1,
Frustration1 = HM$Frustration1)
plot_data$CONDITION <- factor(plot_data$CONDITION, levels = c(1, 2),
labels = c("Cold", "Warm"))
ggplot(plot_data, aes(x = TIMEPOINT, y = Effort1, fill = CONDITION)) +
geom_boxplot(width = 0.8) +
xlab("Timepoints") +
ylab("Effort levels") +
ggtitle("Box Plot of effort level by Condition") +
scale_fill_manual(name = "Condition",
labels = c("Cold", "Ideal"),
values = c("#56B4E9", "orange"))
## Warning: Removed 34 rows containing non-finite values (`stat_boxplot()`).
ggplot(plot_data, aes(x = TIMEPOINT, y = Frustration1, fill = CONDITION)) +
geom_boxplot(width = 0.8) +
xlab("Timepoints") +
ylab("Frustration levels") +
ggtitle("Box Plot of frustration level by Condition") +
scale_fill_manual(name = "Condition",
labels = c("Cold", "Ideal"),
values = c("#56B4E9", "orange"))
## Warning: Removed 34 rows containing non-finite values (`stat_boxplot()`).
filtered_data <- HM %>% filter(TIMEPOINT %in% c(2, 3))
filtered_data$CONDITION <- factor(filtered_data$CONDITION, levels = c(1, 2),
labels = c("Cold", "Warm"))
filtered_data$TIMEPOINT <- factor(filtered_data$TIMEPOINT, levels = c(2, 3),
labels = c("After 5 Blocks", "After 10 Blocks"))
ggplot(filtered_data, aes(x = TIMEPOINT, y = Effort1, fill = CONDITION)) +
geom_boxplot(width = 0.8) +
xlab("Timepoints") +
ylab("Effort levels") +
ggtitle("Box Plot of effort level by Condition") +
scale_fill_manual(name = "Condition",
labels = c("Cold", "Ideal"),
values = c("#56B4E9", "orange")) +
theme_classic()
ggplot(filtered_data, aes(x = TIMEPOINT, y = Frustration1, fill = CONDITION)) +
geom_boxplot(width = 0.8) +
xlab("Timepoints") +
ylab("Frustration levels") +
ggtitle("Box Plot of frustration level by Condition") +
scale_fill_manual(name = "Condition",
labels = c("Cold", "Ideal"),
values = c("#56B4E9", "orange")) +
theme_classic()
filtered_data <- HM %>% filter(TIMEPOINT %in% c(2, 3))
filtered_data$CONDITION <- factor(filtered_data$CONDITION, levels = c(1, 2),
labels = c("Cold", "Warm"))
filtered_data$TIMEPOINT <- factor(filtered_data$TIMEPOINT, levels = c(2, 3),
labels = c("After 5 Blocks", "After 10 Blocks"))
ggplot(filtered_data, aes(x = TIMEPOINT, y = Effort1, fill = CONDITION)) +
geom_boxplot(width = 0.8) +
xlab("Timepoints") +
ylab("Effort levels") +
ggtitle("Box Plot of effort level by Condition") +
scale_fill_manual(name = "Condition",
labels = c("Cold", "Warm"),
values = c("#56B4E9", "orange")) +
theme_classic()
## Temperature perception Analysis
during the experiment participant where asked to indicate how warm or cold they felt on a scale from 1 (very cold) and 10 (very warm) in 3 different time (before starting, after 5 block, after 10 block).
PERCEPTION1 <- lm(PERCEPTION1 ~ CONDITION, data = SURVEY)
PERCEPTION2 <- lm(PERCEPTION2 ~ CONDITION, data = SURVEY)
PERCEPTION3 <- lm(PERCEPTION3 ~ CONDITION, data = SURVEY)
summary(PERCEPTION1)
##
## Call:
## lm(formula = PERCEPTION1 ~ CONDITION, data = SURVEY)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.2941 -1.1176 -0.2941 1.2353 2.7059
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 5.0000 0.8001 6.249 5.28e-07 ***
## CONDITION 0.2941 0.5060 0.581 0.565
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.475 on 32 degrees of freedom
## Multiple R-squared: 0.01045, Adjusted R-squared: -0.02048
## F-statistic: 0.3378 on 1 and 32 DF, p-value: 0.5652
summary(PERCEPTION2)
##
## Call:
## lm(formula = PERCEPTION2 ~ CONDITION, data = SURVEY)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.7059 -1.2941 0.2941 0.7059 4.7059
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 3.8824 0.8945 4.340 0.000134 ***
## CONDITION 1.4118 0.5657 2.495 0.017930 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.649 on 32 degrees of freedom
## Multiple R-squared: 0.1629, Adjusted R-squared: 0.1367
## F-statistic: 6.227 on 1 and 32 DF, p-value: 0.01793
summary(PERCEPTION3)
##
## Call:
## lm(formula = PERCEPTION3 ~ CONDITION, data = SURVEY)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.4118 -1.5000 -0.4118 0.5882 3.4706
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 4.2941 0.8700 4.936 2.4e-05 ***
## CONDITION 1.1176 0.5502 2.031 0.0506 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.604 on 32 degrees of freedom
## Multiple R-squared: 0.1142, Adjusted R-squared: 0.08652
## F-statistic: 4.126 on 1 and 32 DF, p-value: 0.05061
from the results of this model it can be seen that for perception 2 and 3 there is a significant effect of condition on the perception therefore a post-hoc is needed to see if it actually correspond the perception with the condition participants were in
emmeans(PERCEPTION1,~ CONDITION)
## CONDITION emmean SE df lower.CL upper.CL
## 1 5.29 0.358 32 4.57 6.02
## 2 5.59 0.358 32 4.86 6.32
##
## Confidence level used: 0.95
emmeans(PERCEPTION2,~ CONDITION)
## CONDITION emmean SE df lower.CL upper.CL
## 1 5.29 0.4 32 4.48 6.11
## 2 6.71 0.4 32 5.89 7.52
##
## Confidence level used: 0.95
emmeans(PERCEPTION3,~ CONDITION)
## CONDITION emmean SE df lower.CL upper.CL
## 1 5.41 0.389 32 4.62 6.20
## 2 6.53 0.389 32 5.74 7.32
##
## Confidence level used: 0.95
For perception 2 and 3 it can be seen that people that were in the warm condition(2) have a higher mean and therefore felt warmer than the people in the condition 1(cold). therefore perception is in line with how the participant felt.
and then i united the 3 plot together
SURVEY$CONDITION <- factor(SURVEY$CONDITION)
predictions <- SURVEY %>%
pivot_longer(cols = starts_with("PERCEPTION"), names_to = "Perception", values_to = "value") %>%
mutate(Perception = case_when(
Perception == "PERCEPTION1" ~ "At 0 Blocks",
Perception == "PERCEPTION2" ~ "After 5 Blocks",
Perception == "PERCEPTION3" ~ "After 10 Blocks",
TRUE ~ Perception
)) %>%
group_by(Perception, CONDITION) %>%
reframe(Prediction = value) %>%
mutate(Perception = reorder(Perception, as.integer(gsub("\\D", "", Perception))))
ggplot(predictions, aes(x = Perception, y = Prediction, fill = factor(CONDITION))) +
geom_boxplot(coef = 1, width = 0.8) +
xlab("Perception Time") +
ylab("Perception Values") +
ggtitle("Box Plot of Temperature perception by Condition") +
scale_fill_manual(
name = "Condition",
labels = c("Cold", "Ideal"),
values = c("#56B4E9", "orange")
) +
scale_y_continuous(limits = c(1, 10)) +
theme_classic()
the heathmap was asked at 3 different times, at the beginning(base) after 5 and after 10 blcks. i decided to run a descriptive analysis, and an anova. X is the scale from 1 t 9 from unpleasant to pleasant feelings Y is the scale from 1 to 9 from sleepiness and high arousal
HM$X <- as.numeric(HM$X)
HM$Y <- as.numeric(HM$Y)
HM$TIMEPOINT <- relevel(HM$TIMEPOINT, ref = 1)
summary_stats <- HM %>%
group_by(CONDITION) %>%
summarise(
mean_X = mean(X),
sd_X = sd(X),
mean_Y = mean(Y),
sd_Y = sd(Y)
)
print(summary_stats)
## # A tibble: 2 × 5
## CONDITION mean_X sd_X mean_Y sd_Y
## <fct> <dbl> <dbl> <dbl> <dbl>
## 1 1 5.89 1.99 5.73 1.75
## 2 2 5.48 2.05 5.03 2.24
ANOVA.X <- aov(X ~ CONDITION* TIMEPOINT, data = HM)
ANOVA.Y <- aov(Y ~ CONDITION* TIMEPOINT, data = HM)
print(summary(ANOVA.X))
## Df Sum Sq Mean Sq F value Pr(>F)
## CONDITION 1 4.2 4.160 1.159 0.284441
## TIMEPOINT 2 63.1 31.556 8.788 0.000313 ***
## CONDITION:TIMEPOINT 2 0.1 0.029 0.008 0.992060
## Residuals 96 344.7 3.591
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
print(summary(ANOVA.Y))
## Df Sum Sq Mean Sq F value Pr(>F)
## CONDITION 1 12.4 12.425 3.113 0.0809 .
## TIMEPOINT 2 16.3 8.164 2.045 0.1349
## CONDITION:TIMEPOINT 2 4.3 2.155 0.540 0.5846
## Residuals 96 383.2 3.992
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#pairwise.t.test(HM$X, interaction(HM$CONDITION, HM$TIMEPOINT), p.adjust.method = "bonferroni")
#pairwise.t.test(HM$Y, interaction(HM$CONDITION, HM$TIMEPOINT), p.adjust.method = "bonferroni")
emmeans(ANOVA.X,~ TIMEPOINT )
## NOTE: Results may be misleading due to involvement in interactions
## TIMEPOINT emmean SE df lower.CL upper.CL
## 1 6.75 0.325 96 6.11 7.40
## 2 4.88 0.325 96 4.24 5.53
## 3 5.42 0.325 96 4.77 6.06
##
## Results are averaged over the levels of: CONDITION
## Confidence level used: 0.95
emmeans(ANOVA.Y,~ CONDITION )
## NOTE: Results may be misleading due to involvement in interactions
## CONDITION emmean SE df lower.CL upper.CL
## 1 5.73 0.28 96 5.18 6.29
## 2 5.03 0.28 96 4.48 5.59
##
## Results are averaged over the levels of: TIMEPOINT
## Confidence level used: 0.95
Behav <- read_excel("SUMS.xlsx")
EMG <- read_excel("COACTIVATION TABLE.xlsx")
before starting the analysis i made a quick analysis on the NA of the EMG file. the following code gives the total number of NA for all participant together and then separately of missing Extensor, Flexor, error and Coactivation. and for every participant it also calculate the percentage of missing value for each variable.
#colSums(is.na(EMG[, c("EXTENSOR", "FLEXOR", "ERRORS", "COACTIVATION.INDEX")]))
na_counts <- colSums(is.na(EMG[, c("EXTENSOR", "FLEXOR", "ERRORS", "COACTIVATION.INDEX")]))
total_counts <- colSums(!is.na(EMG[, c("EXTENSOR", "FLEXOR", "ERRORS", "COACTIVATION.INDEX")]))
na_percentage <- na_counts / total_counts * 100
result.perc <- data.frame(Variable = c("EXTENSOR", "FLEXOR", "ERRORS", "COACTIVATION.INDEX"),
NA_Percentage = na_percentage)
na_counts
## EXTENSOR FLEXOR ERRORS COACTIVATION.INDEX
## 93 15 1325 102
result.perc
## Variable NA_Percentage
## EXTENSOR EXTENSOR 0.6238680
## FLEXOR FLEXOR 0.1001001
## ERRORS ERRORS 9.6892139
## COACTIVATION.INDEX COACTIVATION.INDEX 0.6846557
for (p in 5:34) {
na_counts <- colSums(is.na(EMG[EMG$PARTICIPANT == paste0("P", p), c("EXTENSOR", "FLEXOR", "ERRORS", "COACTIVATION.INDEX")]))
n_rows <- nrow(EMG[EMG$PARTICIPANT == paste0("P", p), ])
ext.perc <- round(na_counts[1] / n_rows * 100, 2)
flex.perc <- round(na_counts[2] / n_rows * 100, 2)
err.perc <- round(na_counts[3] / n_rows * 100, 2)
coact.perc <- round(na_counts[4] / n_rows * 100, 2)
print(paste0("P", p, " has ", na_counts[1], " EXTENSOR ","Percentage ", ext.perc))
print(paste0("P", p, " has ", na_counts[2], " FLEXOR ","Percentage ", flex.perc))
print(paste0("P", p, " has ", na_counts[3], " ERRORS ", "Percentage ", err.perc))
print(paste0("P", p, " has ", na_counts[4], " COACTIVATION.INDEX ","Percentage ", coact.perc))
}
## [1] "P5 has 0 EXTENSOR Percentage 0"
## [1] "P5 has 0 FLEXOR Percentage 0"
## [1] "P5 has 22 ERRORS Percentage 4.4"
## [1] "P5 has 0 COACTIVATION.INDEX Percentage 0"
## [1] "P6 has 0 EXTENSOR Percentage 0"
## [1] "P6 has 0 FLEXOR Percentage 0"
## [1] "P6 has 69 ERRORS Percentage 13.8"
## [1] "P6 has 0 COACTIVATION.INDEX Percentage 0"
## [1] "P7 has 0 EXTENSOR Percentage 0"
## [1] "P7 has 0 FLEXOR Percentage 0"
## [1] "P7 has 32 ERRORS Percentage 6.4"
## [1] "P7 has 0 COACTIVATION.INDEX Percentage 0"
## [1] "P8 has 0 EXTENSOR Percentage 0"
## [1] "P8 has 0 FLEXOR Percentage 0"
## [1] "P8 has 90 ERRORS Percentage 18"
## [1] "P8 has 0 COACTIVATION.INDEX Percentage 0"
## [1] "P9 has 4 EXTENSOR Percentage 0.8"
## [1] "P9 has 0 FLEXOR Percentage 0"
## [1] "P9 has 38 ERRORS Percentage 7.6"
## [1] "P9 has 4 COACTIVATION.INDEX Percentage 0.8"
## [1] "P10 has 0 EXTENSOR Percentage 0"
## [1] "P10 has 0 FLEXOR Percentage 0"
## [1] "P10 has 34 ERRORS Percentage 6.8"
## [1] "P10 has 0 COACTIVATION.INDEX Percentage 0"
## [1] "P11 has 2 EXTENSOR Percentage 0.4"
## [1] "P11 has 2 FLEXOR Percentage 0.4"
## [1] "P11 has 63 ERRORS Percentage 12.6"
## [1] "P11 has 2 COACTIVATION.INDEX Percentage 0.4"
## [1] "P12 has 0 EXTENSOR Percentage 0"
## [1] "P12 has 0 FLEXOR Percentage 0"
## [1] "P12 has 43 ERRORS Percentage 8.6"
## [1] "P12 has 0 COACTIVATION.INDEX Percentage 0"
## [1] "P13 has 1 EXTENSOR Percentage 0.2"
## [1] "P13 has 0 FLEXOR Percentage 0"
## [1] "P13 has 4 ERRORS Percentage 0.8"
## [1] "P13 has 1 COACTIVATION.INDEX Percentage 0.2"
## [1] "P14 has 17 EXTENSOR Percentage 3.4"
## [1] "P14 has 3 FLEXOR Percentage 0.6"
## [1] "P14 has 36 ERRORS Percentage 7.2"
## [1] "P14 has 19 COACTIVATION.INDEX Percentage 3.8"
## [1] "P15 has 0 EXTENSOR Percentage 0"
## [1] "P15 has 0 FLEXOR Percentage 0"
## [1] "P15 has 23 ERRORS Percentage 4.6"
## [1] "P15 has 0 COACTIVATION.INDEX Percentage 0"
## [1] "P16 has 0 EXTENSOR Percentage 0"
## [1] "P16 has 0 FLEXOR Percentage 0"
## [1] "P16 has 9 ERRORS Percentage 1.8"
## [1] "P16 has 0 COACTIVATION.INDEX Percentage 0"
## [1] "P17 has 0 EXTENSOR Percentage 0"
## [1] "P17 has 0 FLEXOR Percentage 0"
## [1] "P17 has 59 ERRORS Percentage 11.8"
## [1] "P17 has 0 COACTIVATION.INDEX Percentage 0"
## [1] "P18 has 0 EXTENSOR Percentage 0"
## [1] "P18 has 0 FLEXOR Percentage 0"
## [1] "P18 has 35 ERRORS Percentage 7"
## [1] "P18 has 0 COACTIVATION.INDEX Percentage 0"
## [1] "P19 has 0 EXTENSOR Percentage 0"
## [1] "P19 has 0 FLEXOR Percentage 0"
## [1] "P19 has 75 ERRORS Percentage 15"
## [1] "P19 has 0 COACTIVATION.INDEX Percentage 0"
## [1] "P20 has 0 EXTENSOR Percentage 0"
## [1] "P20 has 0 FLEXOR Percentage 0"
## [1] "P20 has 30 ERRORS Percentage 6"
## [1] "P20 has 0 COACTIVATION.INDEX Percentage 0"
## [1] "P21 has 4 EXTENSOR Percentage 0.8"
## [1] "P21 has 1 FLEXOR Percentage 0.2"
## [1] "P21 has 30 ERRORS Percentage 6"
## [1] "P21 has 5 COACTIVATION.INDEX Percentage 1"
## [1] "P22 has 0 EXTENSOR Percentage 0"
## [1] "P22 has 0 FLEXOR Percentage 0"
## [1] "P22 has 50 ERRORS Percentage 10"
## [1] "P22 has 0 COACTIVATION.INDEX Percentage 0"
## [1] "P23 has 0 EXTENSOR Percentage 0"
## [1] "P23 has 0 FLEXOR Percentage 0"
## [1] "P23 has 21 ERRORS Percentage 4.2"
## [1] "P23 has 0 COACTIVATION.INDEX Percentage 0"
## [1] "P24 has 0 EXTENSOR Percentage 0"
## [1] "P24 has 0 FLEXOR Percentage 0"
## [1] "P24 has 108 ERRORS Percentage 21.6"
## [1] "P24 has 0 COACTIVATION.INDEX Percentage 0"
## [1] "P25 has 0 EXTENSOR Percentage 0"
## [1] "P25 has 0 FLEXOR Percentage 0"
## [1] "P25 has 61 ERRORS Percentage 12.2"
## [1] "P25 has 0 COACTIVATION.INDEX Percentage 0"
## [1] "P26 has 0 EXTENSOR Percentage 0"
## [1] "P26 has 0 FLEXOR Percentage 0"
## [1] "P26 has 53 ERRORS Percentage 10.6"
## [1] "P26 has 0 COACTIVATION.INDEX Percentage 0"
## [1] "P27 has 1 EXTENSOR Percentage 0.2"
## [1] "P27 has 0 FLEXOR Percentage 0"
## [1] "P27 has 10 ERRORS Percentage 2"
## [1] "P27 has 1 COACTIVATION.INDEX Percentage 0.2"
## [1] "P28 has 3 EXTENSOR Percentage 0.6"
## [1] "P28 has 0 FLEXOR Percentage 0"
## [1] "P28 has 10 ERRORS Percentage 2"
## [1] "P28 has 3 COACTIVATION.INDEX Percentage 0.6"
## [1] "P29 has 0 EXTENSOR Percentage 0"
## [1] "P29 has 0 FLEXOR Percentage 0"
## [1] "P29 has 30 ERRORS Percentage 6"
## [1] "P29 has 0 COACTIVATION.INDEX Percentage 0"
## [1] "P30 has 0 EXTENSOR Percentage 0"
## [1] "P30 has 1 FLEXOR Percentage 0.2"
## [1] "P30 has 27 ERRORS Percentage 5.4"
## [1] "P30 has 1 COACTIVATION.INDEX Percentage 0.2"
## [1] "P31 has 31 EXTENSOR Percentage 6.2"
## [1] "P31 has 6 FLEXOR Percentage 1.2"
## [1] "P31 has 79 ERRORS Percentage 15.8"
## [1] "P31 has 35 COACTIVATION.INDEX Percentage 7"
## [1] "P32 has 1 EXTENSOR Percentage 0.2"
## [1] "P32 has 0 FLEXOR Percentage 0"
## [1] "P32 has 87 ERRORS Percentage 17.4"
## [1] "P32 has 1 COACTIVATION.INDEX Percentage 0.2"
## [1] "P33 has 5 EXTENSOR Percentage 1"
## [1] "P33 has 0 FLEXOR Percentage 0"
## [1] "P33 has 39 ERRORS Percentage 7.8"
## [1] "P33 has 5 COACTIVATION.INDEX Percentage 1"
## [1] "P34 has 24 EXTENSOR Percentage 4.8"
## [1] "P34 has 2 FLEXOR Percentage 0.4"
## [1] "P34 has 58 ERRORS Percentage 11.6"
## [1] "P34 has 25 COACTIVATION.INDEX Percentage 5"
# max and min range per mean coact and condition
max_min_condition_1 <- Behav %>%
filter(CONDITION == 1) %>%
summarize(MAX_COACTIVATION_INDEX = max(MEAN.COACT, na.rm = TRUE),
MIN_COACTIVATION_INDEX = min(MEAN.COACT, na.rm = TRUE))
max_min_condition_2 <- Behav %>%
filter(CONDITION == 2) %>%
summarize(MAX_COACTIVATION_INDEX = max(MEAN.COACT, na.rm = TRUE),
MIN_COACTIVATION_INDEX = min(MEAN.COACT, na.rm = TRUE))
print("Condition 1:")
## [1] "Condition 1:"
print(max_min_condition_1)
## # A tibble: 1 × 2
## MAX_COACTIVATION_INDEX MIN_COACTIVATION_INDEX
## <dbl> <dbl>
## 1 101. 97.8
print("Condition 2:")
## [1] "Condition 2:"
print(max_min_condition_2)
## # A tibble: 1 × 2
## MAX_COACTIVATION_INDEX MIN_COACTIVATION_INDEX
## <dbl> <dbl>
## 1 173. 97.9
#Factors for Behav
Behav$PARTICIPANT <- factor(Behav$PARTICIPANT)
Behav$BLOCK <- factor(Behav$BLOCK)
Behav$CONDITION <- factor(Behav$CONDITION)
#Factors for EMG
EMG$PARTICIPANT <- factor(EMG$PARTICIPANT)
EMG$BLOCK <- factor(EMG$BLOCK)
EMG$PHASE <- factor(EMG$PHASE)
EMG$CONDITION <- factor(EMG$CONDITION)
#RT
m.RT <- lmer(TIME ~ BLOCK * CONDITION + (1|PARTICIPANT), data = Behav)
anova(m.RT)
## Type III Analysis of Variance Table with Satterthwaite's method
## Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
## BLOCK 339994 37777 9 252 13.9721 <2e-16 ***
## CONDITION 100 100 1 28 0.0369 0.8490
## BLOCK:CONDITION 21810 2423 9 252 0.8963 0.5292
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(m.RT)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: TIME ~ BLOCK * CONDITION + (1 | PARTICIPANT)
## Data: Behav
##
## REML criterion at convergence: 3155.8
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.979 -0.539 -0.044 0.516 4.909
##
## Random effects:
## Groups Name Variance Std.Dev.
## PARTICIPANT (Intercept) 7599 87.17
## Residual 2704 52.00
## Number of obs: 300, groups: PARTICIPANT, 30
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 278.12 26.21 47.49 10.612 3.99e-14 ***
## BLOCK2 -52.96 18.99 252.00 -2.789 0.005686 **
## BLOCK3 -61.76 18.99 252.00 -3.253 0.001299 **
## BLOCK4 -70.12 18.99 252.00 -3.693 0.000272 ***
## BLOCK5 -73.60 18.99 252.00 -3.876 0.000135 ***
## BLOCK6 -55.48 18.99 252.00 -2.922 0.003793 **
## BLOCK7 -96.76 18.99 252.00 -5.096 6.81e-07 ***
## BLOCK8 -103.20 18.99 252.00 -5.435 1.29e-07 ***
## BLOCK9 -122.08 18.99 252.00 -6.430 6.37e-10 ***
## BLOCK10 -131.64 18.99 252.00 -6.933 3.44e-11 ***
## CONDITION2 -11.84 37.06 47.49 -0.319 0.750786
## BLOCK2:CONDITION2 30.44 26.85 252.00 1.134 0.258021
## BLOCK3:CONDITION2 31.96 26.85 252.00 1.190 0.235068
## BLOCK4:CONDITION2 33.04 26.85 252.00 1.230 0.219667
## BLOCK5:CONDITION2 14.52 26.85 252.00 0.541 0.589156
## BLOCK6:CONDITION2 -16.60 26.85 252.00 -0.618 0.536991
## BLOCK7:CONDITION2 3.00 26.85 252.00 0.112 0.911130
## BLOCK8:CONDITION2 15.80 26.85 252.00 0.588 0.556776
## BLOCK9:CONDITION2 38.80 26.85 252.00 1.445 0.149704
## BLOCK10:CONDITION2 29.68 26.85 252.00 1.105 0.270066
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation matrix not shown by default, as p = 20 > 12.
## Use print(x, correlation=TRUE) or
## vcov(x) if you need it
emmeans(m.RT, pairwise ~ CONDITION | BLOCK)
## $emmeans
## BLOCK = 1:
## CONDITION emmean SE df lower.CL upper.CL
## 1 278 26.2 47.5 225.4 331
## 2 266 26.2 47.5 213.6 319
##
## BLOCK = 2:
## CONDITION emmean SE df lower.CL upper.CL
## 1 225 26.2 47.5 172.5 278
## 2 244 26.2 47.5 191.1 296
##
## BLOCK = 3:
## CONDITION emmean SE df lower.CL upper.CL
## 1 216 26.2 47.5 163.7 269
## 2 236 26.2 47.5 183.8 289
##
## BLOCK = 4:
## CONDITION emmean SE df lower.CL upper.CL
## 1 208 26.2 47.5 155.3 261
## 2 229 26.2 47.5 176.5 282
##
## BLOCK = 5:
## CONDITION emmean SE df lower.CL upper.CL
## 1 205 26.2 47.5 151.8 257
## 2 207 26.2 47.5 154.5 260
##
## BLOCK = 6:
## CONDITION emmean SE df lower.CL upper.CL
## 1 223 26.2 47.5 169.9 275
## 2 194 26.2 47.5 141.5 247
##
## BLOCK = 7:
## CONDITION emmean SE df lower.CL upper.CL
## 1 181 26.2 47.5 128.7 234
## 2 173 26.2 47.5 119.8 225
##
## BLOCK = 8:
## CONDITION emmean SE df lower.CL upper.CL
## 1 175 26.2 47.5 122.2 228
## 2 179 26.2 47.5 126.2 232
##
## BLOCK = 9:
## CONDITION emmean SE df lower.CL upper.CL
## 1 156 26.2 47.5 103.3 209
## 2 183 26.2 47.5 130.3 236
##
## BLOCK = 10:
## CONDITION emmean SE df lower.CL upper.CL
## 1 146 26.2 47.5 93.8 199
## 2 164 26.2 47.5 111.6 217
##
## Degrees-of-freedom method: kenward-roger
## Confidence level used: 0.95
##
## $contrasts
## BLOCK = 1:
## contrast estimate SE df t.ratio p.value
## CONDITION1 - CONDITION2 11.84 37.1 47.5 0.319 0.7508
##
## BLOCK = 2:
## contrast estimate SE df t.ratio p.value
## CONDITION1 - CONDITION2 -18.60 37.1 47.5 -0.502 0.6181
##
## BLOCK = 3:
## contrast estimate SE df t.ratio p.value
## CONDITION1 - CONDITION2 -20.12 37.1 47.5 -0.543 0.5898
##
## BLOCK = 4:
## contrast estimate SE df t.ratio p.value
## CONDITION1 - CONDITION2 -21.20 37.1 47.5 -0.572 0.5700
##
## BLOCK = 5:
## contrast estimate SE df t.ratio p.value
## CONDITION1 - CONDITION2 -2.68 37.1 47.5 -0.072 0.9427
##
## BLOCK = 6:
## contrast estimate SE df t.ratio p.value
## CONDITION1 - CONDITION2 28.44 37.1 47.5 0.767 0.4467
##
## BLOCK = 7:
## contrast estimate SE df t.ratio p.value
## CONDITION1 - CONDITION2 8.84 37.1 47.5 0.239 0.8125
##
## BLOCK = 8:
## contrast estimate SE df t.ratio p.value
## CONDITION1 - CONDITION2 -3.96 37.1 47.5 -0.107 0.9154
##
## BLOCK = 9:
## contrast estimate SE df t.ratio p.value
## CONDITION1 - CONDITION2 -26.96 37.1 47.5 -0.727 0.4706
##
## BLOCK = 10:
## contrast estimate SE df t.ratio p.value
## CONDITION1 - CONDITION2 -17.84 37.1 47.5 -0.481 0.6325
##
## Degrees-of-freedom method: kenward-roger
emmeans(m.RT, pairwise ~ BLOCK)
## NOTE: Results may be misleading due to involvement in interactions
## $emmeans
## BLOCK emmean SE df lower.CL upper.CL
## 1 272 18.5 47.5 235 309
## 2 234 18.5 47.5 197 272
## 3 226 18.5 47.5 189 264
## 4 219 18.5 47.5 181 256
## 5 206 18.5 47.5 169 243
## 6 208 18.5 47.5 171 246
## 7 177 18.5 47.5 140 214
## 8 177 18.5 47.5 140 214
## 9 170 18.5 47.5 132 207
## 10 155 18.5 47.5 118 193
##
## Results are averaged over the levels of: CONDITION
## Degrees-of-freedom method: kenward-roger
## Confidence level used: 0.95
##
## $contrasts
## contrast estimate SE df t.ratio p.value
## BLOCK1 - BLOCK2 37.74 13.4 252 2.811 0.1384
## BLOCK1 - BLOCK3 45.78 13.4 252 3.410 0.0258
## BLOCK1 - BLOCK4 53.60 13.4 252 3.992 0.0034
## BLOCK1 - BLOCK5 66.34 13.4 252 4.941 0.0001
## BLOCK1 - BLOCK6 63.78 13.4 252 4.751 0.0001
## BLOCK1 - BLOCK7 95.26 13.4 252 7.095 <.0001
## BLOCK1 - BLOCK8 95.30 13.4 252 7.098 <.0001
## BLOCK1 - BLOCK9 102.68 13.4 252 7.648 <.0001
## BLOCK1 - BLOCK10 116.80 13.4 252 8.700 <.0001
## BLOCK2 - BLOCK3 8.04 13.4 252 0.599 0.9999
## BLOCK2 - BLOCK4 15.86 13.4 252 1.181 0.9746
## BLOCK2 - BLOCK5 28.60 13.4 252 2.130 0.5080
## BLOCK2 - BLOCK6 26.04 13.4 252 1.940 0.6420
## BLOCK2 - BLOCK7 57.52 13.4 252 4.284 0.0011
## BLOCK2 - BLOCK8 57.56 13.4 252 4.287 0.0011
## BLOCK2 - BLOCK9 64.94 13.4 252 4.837 0.0001
## BLOCK2 - BLOCK10 79.06 13.4 252 5.889 <.0001
## BLOCK3 - BLOCK4 7.82 13.4 252 0.582 0.9999
## BLOCK3 - BLOCK5 20.56 13.4 252 1.531 0.8784
## BLOCK3 - BLOCK6 18.00 13.4 252 1.341 0.9431
## BLOCK3 - BLOCK7 49.48 13.4 252 3.685 0.0103
## BLOCK3 - BLOCK8 49.52 13.4 252 3.688 0.0102
## BLOCK3 - BLOCK9 56.90 13.4 252 4.238 0.0013
## BLOCK3 - BLOCK10 71.02 13.4 252 5.290 <.0001
## BLOCK4 - BLOCK5 12.74 13.4 252 0.949 0.9946
## BLOCK4 - BLOCK6 10.18 13.4 252 0.758 0.9990
## BLOCK4 - BLOCK7 41.66 13.4 252 3.103 0.0645
## BLOCK4 - BLOCK8 41.70 13.4 252 3.106 0.0640
## BLOCK4 - BLOCK9 49.08 13.4 252 3.656 0.0114
## BLOCK4 - BLOCK10 63.20 13.4 252 4.707 0.0002
## BLOCK5 - BLOCK6 -2.56 13.4 252 -0.191 1.0000
## BLOCK5 - BLOCK7 28.92 13.4 252 2.154 0.4913
## BLOCK5 - BLOCK8 28.96 13.4 252 2.157 0.4892
## BLOCK5 - BLOCK9 36.34 13.4 252 2.707 0.1766
## BLOCK5 - BLOCK10 50.46 13.4 252 3.758 0.0080
## BLOCK6 - BLOCK7 31.48 13.4 252 2.345 0.3641
## BLOCK6 - BLOCK8 31.52 13.4 252 2.348 0.3623
## BLOCK6 - BLOCK9 38.90 13.4 252 2.897 0.1117
## BLOCK6 - BLOCK10 53.02 13.4 252 3.949 0.0040
## BLOCK7 - BLOCK8 0.04 13.4 252 0.003 1.0000
## BLOCK7 - BLOCK9 7.42 13.4 252 0.553 0.9999
## BLOCK7 - BLOCK10 21.54 13.4 252 1.604 0.8451
## BLOCK8 - BLOCK9 7.38 13.4 252 0.550 0.9999
## BLOCK8 - BLOCK10 21.50 13.4 252 1.601 0.8465
## BLOCK9 - BLOCK10 14.12 13.4 252 1.052 0.9886
##
## Results are averaged over the levels of: CONDITION
## Degrees-of-freedom method: kenward-roger
## P value adjustment: tukey method for comparing a family of 10 estimates
#Effects just on the RT model
ae.m.RT<-allEffects(m.RT)
ae.m.RT.df<-as.data.frame(ae.m.RT[[1]])
plot(ae.m.RT)
plot.m.RT <- ggplot(ae.m.RT.df, aes(x = BLOCK, y = fit, group = CONDITION)) +
geom_ribbon(aes(ymin = lower, ymax = upper, fill = CONDITION), alpha = 0.2) +
geom_line(aes(color = CONDITION), linewidth = 1) +
geom_point(aes(color = CONDITION, shape = CONDITION, fill = CONDITION), size = 3.5) +
ylab("Time on task") +
xlab("Blocks") +
ggtitle("Response time between groups") +
scale_color_manual(name = "CONDITION", values = c("#56B4E9", "orange"), labels = c("Cold", "Ideal")) +
scale_fill_manual(name = "CONDITION", values = c("#0072B2", "orange"), labels = c("Cold", "Ideal")) +
guides(shape = FALSE) +
theme_classic()
## Warning: The `<scale>` argument of `guides()` cannot be `FALSE`. Use "none" instead as
## of ggplot2 3.3.4.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
print(plot.m.RT)
## Error rate analysis
#Errors
m.error <- lmer(ERROR ~ BLOCK * CONDITION + (1|PARTICIPANT), data = Behav)
anova(m.error)
## Type III Analysis of Variance Table with Satterthwaite's method
## Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
## BLOCK 400362 44485 9 252 31.4318 <2e-16 ***
## CONDITION 532 532 1 28 0.3759 0.5448
## BLOCK:CONDITION 7095 788 9 252 0.5570 0.8315
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(m.error)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: ERROR ~ BLOCK * CONDITION + (1 | PARTICIPANT)
## Data: Behav
##
## REML criterion at convergence: 2966
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.3211 -0.5254 -0.0234 0.5024 3.5909
##
## Random effects:
## Groups Name Variance Std.Dev.
## PARTICIPANT (Intercept) 2887 53.73
## Residual 1415 37.62
## Number of obs: 300, groups: PARTICIPANT, 30
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 258.000 16.936 55.417 15.234 < 2e-16 ***
## BLOCK2 -57.267 13.737 252.000 -4.169 4.21e-05 ***
## BLOCK3 -69.200 13.737 252.000 -5.038 9.00e-07 ***
## BLOCK4 -77.667 13.737 252.000 -5.654 4.24e-08 ***
## BLOCK5 -84.067 13.737 252.000 -6.120 3.56e-09 ***
## BLOCK6 -107.533 13.737 252.000 -7.828 1.37e-13 ***
## BLOCK7 -108.533 13.737 252.000 -7.901 8.61e-14 ***
## BLOCK8 -121.267 13.737 252.000 -8.828 < 2e-16 ***
## BLOCK9 -122.800 13.737 252.000 -8.939 < 2e-16 ***
## BLOCK10 -127.200 13.737 252.000 -9.260 < 2e-16 ***
## CONDITION2 -17.000 23.951 55.417 -0.710 0.481
## BLOCK2:CONDITION2 14.600 19.427 252.000 0.752 0.453
## BLOCK3:CONDITION2 4.600 19.427 252.000 0.237 0.813
## BLOCK4:CONDITION2 6.467 19.427 252.000 0.333 0.740
## BLOCK5:CONDITION2 -7.133 19.427 252.000 -0.367 0.714
## BLOCK6:CONDITION2 -6.000 19.427 252.000 -0.309 0.758
## BLOCK7:CONDITION2 -10.667 19.427 252.000 -0.549 0.583
## BLOCK8:CONDITION2 13.733 19.427 252.000 0.707 0.480
## BLOCK9:CONDITION2 18.133 19.427 252.000 0.933 0.352
## BLOCK10:CONDITION2 13.067 19.427 252.000 0.673 0.502
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation matrix not shown by default, as p = 20 > 12.
## Use print(x, correlation=TRUE) or
## vcov(x) if you need it
emmeans(m.error, pairwise ~ CONDITION | BLOCK)
## $emmeans
## BLOCK = 1:
## CONDITION emmean SE df lower.CL upper.CL
## 1 258 16.9 55.4 224.1 292
## 2 241 16.9 55.4 207.1 275
##
## BLOCK = 2:
## CONDITION emmean SE df lower.CL upper.CL
## 1 201 16.9 55.4 166.8 235
## 2 198 16.9 55.4 164.4 232
##
## BLOCK = 3:
## CONDITION emmean SE df lower.CL upper.CL
## 1 189 16.9 55.4 154.9 223
## 2 176 16.9 55.4 142.5 210
##
## BLOCK = 4:
## CONDITION emmean SE df lower.CL upper.CL
## 1 180 16.9 55.4 146.4 214
## 2 170 16.9 55.4 135.9 204
##
## BLOCK = 5:
## CONDITION emmean SE df lower.CL upper.CL
## 1 174 16.9 55.4 140.0 208
## 2 150 16.9 55.4 115.9 184
##
## BLOCK = 6:
## CONDITION emmean SE df lower.CL upper.CL
## 1 150 16.9 55.4 116.5 184
## 2 127 16.9 55.4 93.5 161
##
## BLOCK = 7:
## CONDITION emmean SE df lower.CL upper.CL
## 1 149 16.9 55.4 115.5 183
## 2 122 16.9 55.4 87.9 156
##
## BLOCK = 8:
## CONDITION emmean SE df lower.CL upper.CL
## 1 137 16.9 55.4 102.8 171
## 2 133 16.9 55.4 99.5 167
##
## BLOCK = 9:
## CONDITION emmean SE df lower.CL upper.CL
## 1 135 16.9 55.4 101.3 169
## 2 136 16.9 55.4 102.4 170
##
## BLOCK = 10:
## CONDITION emmean SE df lower.CL upper.CL
## 1 131 16.9 55.4 96.9 165
## 2 127 16.9 55.4 92.9 161
##
## Degrees-of-freedom method: kenward-roger
## Confidence level used: 0.95
##
## $contrasts
## BLOCK = 1:
## contrast estimate SE df t.ratio p.value
## CONDITION1 - CONDITION2 17.00 24 55.4 0.710 0.4808
##
## BLOCK = 2:
## contrast estimate SE df t.ratio p.value
## CONDITION1 - CONDITION2 2.40 24 55.4 0.100 0.9205
##
## BLOCK = 3:
## contrast estimate SE df t.ratio p.value
## CONDITION1 - CONDITION2 12.40 24 55.4 0.518 0.6067
##
## BLOCK = 4:
## contrast estimate SE df t.ratio p.value
## CONDITION1 - CONDITION2 10.53 24 55.4 0.440 0.6618
##
## BLOCK = 5:
## contrast estimate SE df t.ratio p.value
## CONDITION1 - CONDITION2 24.13 24 55.4 1.008 0.3180
##
## BLOCK = 6:
## contrast estimate SE df t.ratio p.value
## CONDITION1 - CONDITION2 23.00 24 55.4 0.960 0.3411
##
## BLOCK = 7:
## contrast estimate SE df t.ratio p.value
## CONDITION1 - CONDITION2 27.67 24 55.4 1.155 0.2530
##
## BLOCK = 8:
## contrast estimate SE df t.ratio p.value
## CONDITION1 - CONDITION2 3.27 24 55.4 0.136 0.8920
##
## BLOCK = 9:
## contrast estimate SE df t.ratio p.value
## CONDITION1 - CONDITION2 -1.13 24 55.4 -0.047 0.9624
##
## BLOCK = 10:
## contrast estimate SE df t.ratio p.value
## CONDITION1 - CONDITION2 3.93 24 55.4 0.164 0.8701
##
## Degrees-of-freedom method: kenward-roger
emmeans(m.RT, pairwise ~ BLOCK)
## NOTE: Results may be misleading due to involvement in interactions
## $emmeans
## BLOCK emmean SE df lower.CL upper.CL
## 1 272 18.5 47.5 235 309
## 2 234 18.5 47.5 197 272
## 3 226 18.5 47.5 189 264
## 4 219 18.5 47.5 181 256
## 5 206 18.5 47.5 169 243
## 6 208 18.5 47.5 171 246
## 7 177 18.5 47.5 140 214
## 8 177 18.5 47.5 140 214
## 9 170 18.5 47.5 132 207
## 10 155 18.5 47.5 118 193
##
## Results are averaged over the levels of: CONDITION
## Degrees-of-freedom method: kenward-roger
## Confidence level used: 0.95
##
## $contrasts
## contrast estimate SE df t.ratio p.value
## BLOCK1 - BLOCK2 37.74 13.4 252 2.811 0.1384
## BLOCK1 - BLOCK3 45.78 13.4 252 3.410 0.0258
## BLOCK1 - BLOCK4 53.60 13.4 252 3.992 0.0034
## BLOCK1 - BLOCK5 66.34 13.4 252 4.941 0.0001
## BLOCK1 - BLOCK6 63.78 13.4 252 4.751 0.0001
## BLOCK1 - BLOCK7 95.26 13.4 252 7.095 <.0001
## BLOCK1 - BLOCK8 95.30 13.4 252 7.098 <.0001
## BLOCK1 - BLOCK9 102.68 13.4 252 7.648 <.0001
## BLOCK1 - BLOCK10 116.80 13.4 252 8.700 <.0001
## BLOCK2 - BLOCK3 8.04 13.4 252 0.599 0.9999
## BLOCK2 - BLOCK4 15.86 13.4 252 1.181 0.9746
## BLOCK2 - BLOCK5 28.60 13.4 252 2.130 0.5080
## BLOCK2 - BLOCK6 26.04 13.4 252 1.940 0.6420
## BLOCK2 - BLOCK7 57.52 13.4 252 4.284 0.0011
## BLOCK2 - BLOCK8 57.56 13.4 252 4.287 0.0011
## BLOCK2 - BLOCK9 64.94 13.4 252 4.837 0.0001
## BLOCK2 - BLOCK10 79.06 13.4 252 5.889 <.0001
## BLOCK3 - BLOCK4 7.82 13.4 252 0.582 0.9999
## BLOCK3 - BLOCK5 20.56 13.4 252 1.531 0.8784
## BLOCK3 - BLOCK6 18.00 13.4 252 1.341 0.9431
## BLOCK3 - BLOCK7 49.48 13.4 252 3.685 0.0103
## BLOCK3 - BLOCK8 49.52 13.4 252 3.688 0.0102
## BLOCK3 - BLOCK9 56.90 13.4 252 4.238 0.0013
## BLOCK3 - BLOCK10 71.02 13.4 252 5.290 <.0001
## BLOCK4 - BLOCK5 12.74 13.4 252 0.949 0.9946
## BLOCK4 - BLOCK6 10.18 13.4 252 0.758 0.9990
## BLOCK4 - BLOCK7 41.66 13.4 252 3.103 0.0645
## BLOCK4 - BLOCK8 41.70 13.4 252 3.106 0.0640
## BLOCK4 - BLOCK9 49.08 13.4 252 3.656 0.0114
## BLOCK4 - BLOCK10 63.20 13.4 252 4.707 0.0002
## BLOCK5 - BLOCK6 -2.56 13.4 252 -0.191 1.0000
## BLOCK5 - BLOCK7 28.92 13.4 252 2.154 0.4913
## BLOCK5 - BLOCK8 28.96 13.4 252 2.157 0.4892
## BLOCK5 - BLOCK9 36.34 13.4 252 2.707 0.1766
## BLOCK5 - BLOCK10 50.46 13.4 252 3.758 0.0080
## BLOCK6 - BLOCK7 31.48 13.4 252 2.345 0.3641
## BLOCK6 - BLOCK8 31.52 13.4 252 2.348 0.3623
## BLOCK6 - BLOCK9 38.90 13.4 252 2.897 0.1117
## BLOCK6 - BLOCK10 53.02 13.4 252 3.949 0.0040
## BLOCK7 - BLOCK8 0.04 13.4 252 0.003 1.0000
## BLOCK7 - BLOCK9 7.42 13.4 252 0.553 0.9999
## BLOCK7 - BLOCK10 21.54 13.4 252 1.604 0.8451
## BLOCK8 - BLOCK9 7.38 13.4 252 0.550 0.9999
## BLOCK8 - BLOCK10 21.50 13.4 252 1.601 0.8465
## BLOCK9 - BLOCK10 14.12 13.4 252 1.052 0.9886
##
## Results are averaged over the levels of: CONDITION
## Degrees-of-freedom method: kenward-roger
## P value adjustment: tukey method for comparing a family of 10 estimates
From the post-hoc analysis it can be seen that from block 1 to block10 there is an improvement( less) in the errors of participants in both conditions
#Effects just on the RT model
ae.m.error<-allEffects(m.error)
ae.m.error.df<-as.data.frame(ae.m.error[[1]])
plot(ae.m.error)
#The plot
plot.m.error.blk <- ggplot(ae.m.error.df, aes(x= BLOCK, y=fit, group=CONDITION))+
geom_ribbon(aes(ymin=lower, ymax=upper, fill=CONDITION), alpha = 0.2) +
geom_line(aes(color=CONDITION), linewidth = 1) +
geom_point(aes(color=CONDITION, shape=CONDITION), size = 3.5)+
ylab("Error")+
xlab("Block")+
ggtitle("Error rate between groups")+
scale_color_manual(name = "CONDITION", values = c("#56B4E9", "orange"), labels = c("Cold", "Ideal")) +
scale_fill_manual(name = "CONDITION", values = c("#0072B2", "orange"), labels = c("Cold", "Ideal")) +
guides(shape = FALSE) +
theme_classic()
print (plot.m.error.blk)
m.errorRT <- lm(TIME ~ ERROR, data = Behav)
anova(m.errorRT)
## Analysis of Variance Table
##
## Response: TIME
## Df Sum Sq Mean Sq F value Pr(>F)
## ERROR 1 211040 211040 20.698 7.836e-06 ***
## Residuals 298 3038457 10196
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(m.errorRT)
##
## Call:
## lm(formula = TIME ~ ERROR, data = Behav)
##
## Residuals:
## Min 1Q Median 3Q Max
## -152.42 -83.59 -24.52 74.85 445.60
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 145.23897 14.26530 10.18 < 2e-16 ***
## ERROR 0.36055 0.07925 4.55 7.84e-06 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 101 on 298 degrees of freedom
## Multiple R-squared: 0.06495, Adjusted R-squared: 0.06181
## F-statistic: 20.7 on 1 and 298 DF, p-value: 7.836e-06
plot(m.errorRT)
#Effects just on the RT model
ae.m.errorRT<-allEffects(m.errorRT)
ae.m.errorRT.df<-as.data.frame(ae.m.errorRT[[1]])
plot(ae.m.errorRT)
ggplot(ae.m.errorRT.df, aes(x = fit, y = ERROR)) +
geom_line(color = "#56B4E9", size = 1.5) +
scale_y_continuous(limits = c(0, 550), expand = c(0, 0)) +
xlab("Time") +
ylab("Error") +
theme_bw() +
theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
panel.border = element_blank(),
axis.line = element_line(size = 1.2),
axis.title = element_text(size = 14, face = "bold"),
axis.text = element_text(size = 12),
legend.position = "none")
## Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
## ℹ Please use `linewidth` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
## Warning: The `size` argument of `element_line()` is deprecated as of ggplot2 3.4.0.
## ℹ Please use the `linewidth` argument instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
m.errorRT.c <- lm(TIME ~ ERROR * CONDITION, data = Behav)
anova(m.errorRT.c)
## Analysis of Variance Table
##
## Response: TIME
## Df Sum Sq Mean Sq F value Pr(>F)
## ERROR 1 211040 211040 20.6334 8.107e-06 ***
## CONDITION 1 8592 8592 0.8401 0.3601
## ERROR:CONDITION 1 2343 2343 0.2291 0.6325
## Residuals 296 3027521 10228
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(m.errorRT.c)
##
## Call:
## lm(formula = TIME ~ ERROR * CONDITION, data = Behav)
##
## Residuals:
## Min 1Q Median 3Q Max
## -149.36 -81.03 -21.18 75.62 433.95
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 145.31639 20.83849 6.973 2.02e-11 ***
## ERROR 0.32880 0.11225 2.929 0.00366 **
## CONDITION2 -1.78271 28.67023 -0.062 0.95046
## ERROR:CONDITION2 0.07625 0.15931 0.479 0.63255
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 101.1 on 296 degrees of freedom
## Multiple R-squared: 0.06831, Adjusted R-squared: 0.05887
## F-statistic: 7.234 on 3 and 296 DF, p-value: 0.0001063
plot(m.errorRT.c)
#Effects just on the RT model
ae.m.errorRT.c<-allEffects(m.errorRT.c)
ae.m.errorRT.c.df<-as.data.frame(ae.m.errorRT.c,c[[1]])
plot(ae.m.errorRT.c)
ggplot(Behav, aes(x = TIME, y = ERROR, color = CONDITION)) +
geom_line(size=1) +
facet_grid(CONDITION ~ ., scales = "free_y") +
labs(x = "TIME", y = "Error", color = "CONDITION") +
ggtitle("Speed andErrors by Condition") +
scale_color_manual(name = "Condition",
labels = c("Cold", "Warm"),
values = c("#56B4E9", "orange"))+
theme_classic()
ae.m.errorRT.c.df <- data.frame(ae.m.errorRT.c)
error_condition <- ae.m.errorRT.c.df$ERROR.CONDITION
# Plot the data
ggplot(error_condition, aes(x = ERROR, y = fit, group = CONDITION)) +
geom_ribbon(aes(ymin = lower, ymax = upper, fill = CONDITION), alpha = 0.2) +
geom_line(aes(color = CONDITION), size = 1) +
geom_point(aes(color = CONDITION, shape = CONDITION), size = 3.5) +
ylab("Time on task") +
xlab("Error") +
ggtitle("Speed and Error rate between groups") +
scale_color_manual(name = "CONDITION", values = c("#56B4E9", "orange"), labels = c("Cold", "Ideal")) +
scale_fill_manual(name = "CONDITION", values = c("#0072B2", "orange"), labels = c("Cold", "Ideal")) +
guides(shape = FALSE) +
theme_classic()
#RT * Error model
m.RT.ER <- lmer(TIME ~ BLOCK * CONDITION * ERROR + (1|PARTICIPANT), data = Behav)
anova(m.RT.ER)
## Type III Analysis of Variance Table with Satterthwaite's method
## Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
## BLOCK 31892 3544 9 232.618 1.4102 0.1845
## CONDITION 57 57 1 79.491 0.0228 0.8803
## ERROR 61589 61589 1 258.844 24.5100 1.334e-06 ***
## BLOCK:CONDITION 26070 2897 9 232.618 1.1527 0.3266
## BLOCK:ERROR 14254 1584 9 233.357 0.6303 0.7707
## CONDITION:ERROR 1014 1014 1 258.844 0.4035 0.5259
## BLOCK:CONDITION:ERROR 25957 2884 9 233.357 1.1478 0.3300
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(m.RT.ER)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: TIME ~ BLOCK * CONDITION * ERROR + (1 | PARTICIPANT)
## Data: Behav
##
## REML criterion at convergence: 3139.6
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -4.5227 -0.4645 -0.0189 0.4155 4.8433
##
## Random effects:
## Groups Name Variance Std.Dev.
## PARTICIPANT (Intercept) 8212 90.62
## Residual 2513 50.13
## Number of obs: 300, groups: PARTICIPANT, 30
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 1.482e+02 5.391e+01 2.299e+02 2.748 0.00647 **
## BLOCK2 -6.949e+00 5.744e+01 2.322e+02 -0.121 0.90381
## BLOCK3 2.443e+01 6.227e+01 2.324e+02 0.392 0.69513
## BLOCK4 2.862e+01 5.645e+01 2.323e+02 0.507 0.61261
## BLOCK5 -2.025e+00 5.543e+01 2.323e+02 -0.037 0.97089
## BLOCK6 8.758e+00 5.174e+01 2.337e+02 0.169 0.86573
## BLOCK7 -7.482e+00 5.605e+01 2.325e+02 -0.133 0.89393
## BLOCK8 -2.613e+01 6.669e+01 2.325e+02 -0.392 0.69556
## BLOCK9 -1.156e+02 5.680e+01 2.324e+02 -2.036 0.04293 *
## BLOCK10 -9.565e+01 6.108e+01 2.325e+02 -1.566 0.11871
## CONDITION2 5.292e+01 6.771e+01 2.057e+02 0.781 0.43541
## ERROR 5.037e-01 1.815e-01 2.455e+02 2.776 0.00593 **
## BLOCK2:CONDITION2 -3.678e+01 7.361e+01 2.324e+02 -0.500 0.61782
## BLOCK3:CONDITION2 -7.969e+01 7.970e+01 2.328e+02 -1.000 0.31840
## BLOCK4:CONDITION2 -1.179e+02 7.686e+01 2.330e+02 -1.534 0.12635
## BLOCK5:CONDITION2 -8.008e+01 7.643e+01 2.328e+02 -1.048 0.29583
## BLOCK6:CONDITION2 -1.494e+02 7.335e+01 2.337e+02 -2.037 0.04275 *
## BLOCK7:CONDITION2 -1.088e+02 7.523e+01 2.329e+02 -1.446 0.14940
## BLOCK8:CONDITION2 -5.300e+01 8.245e+01 2.327e+02 -0.643 0.52095
## BLOCK9:CONDITION2 2.985e+01 7.495e+01 2.325e+02 0.398 0.69081
## BLOCK10:CONDITION2 -3.089e+00 8.315e+01 2.332e+02 -0.037 0.97040
## BLOCK2:ERROR -8.552e-02 2.399e-01 2.326e+02 -0.356 0.72185
## BLOCK3:ERROR -2.719e-01 2.810e-01 2.335e+02 -0.968 0.33414
## BLOCK4:ERROR -3.306e-01 2.488e-01 2.328e+02 -1.329 0.18527
## BLOCK5:ERROR -1.681e-01 2.468e-01 2.327e+02 -0.681 0.49648
## BLOCK6:ERROR -6.696e-02 2.280e-01 2.324e+02 -0.294 0.76925
## BLOCK7:ERROR -2.316e-01 2.777e-01 2.337e+02 -0.834 0.40525
## BLOCK8:ERROR -1.170e-01 4.014e-01 2.345e+02 -0.291 0.77103
## BLOCK9:ERROR 4.096e-01 3.083e-01 2.348e+02 1.329 0.18518
## BLOCK10:ERROR 2.147e-01 3.624e-01 2.354e+02 0.592 0.55409
## CONDITION2:ERROR -2.332e-01 2.225e-01 2.435e+02 -1.048 0.29572
## BLOCK2:CONDITION2:ERROR 2.506e-01 3.111e-01 2.329e+02 0.806 0.42126
## BLOCK3:CONDITION2:ERROR 5.153e-01 3.705e-01 2.343e+02 1.391 0.16560
## BLOCK4:CONDITION2:ERROR 7.515e-01 3.646e-01 2.345e+02 2.061 0.04038 *
## BLOCK5:CONDITION2:ERROR 4.865e-01 3.872e-01 2.344e+02 1.256 0.21027
## BLOCK6:CONDITION2:ERROR 8.460e-01 4.094e-01 2.356e+02 2.067 0.03987 *
## BLOCK7:CONDITION2:ERROR 6.814e-01 4.338e-01 2.355e+02 1.571 0.11757
## BLOCK8:CONDITION2:ERROR 2.729e-01 4.968e-01 2.351e+02 0.549 0.58328
## BLOCK9:CONDITION2:ERROR -1.837e-01 4.225e-01 2.345e+02 -0.435 0.66403
## BLOCK10:CONDITION2:ERROR 3.307e-03 5.282e-01 2.363e+02 0.006 0.99501
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation matrix not shown by default, as p = 40 > 12.
## Use print(x, correlation=TRUE) or
## vcov(x) if you need it
#Effects just on the RT model
ae.m.RT.ER<-allEffects(m.RT.ER)
ae.m.RT.ER.df<-as.data.frame(ae.m.RT.ER)
plot(ae.m.RT.ER)
ggplot(Behav, aes(x = BLOCK, y = ERROR, fill = CONDITION)) +
geom_boxplot() +
facet_grid(CONDITION ~ ., scales = "free_y") +
labs(x = "Block", y = "ERROR", fill = "CONDITION") +
ggtitle("Boxplot of Errors by block for both conditions") +
scale_fill_manual(name = "Condition",
labels = c("Cold", "Warm"),
values = c("#56B4E9", "orange"))
ggplot(Behav, aes(x = BLOCK, y = ERROR, fill = CONDITION)) +
geom_boxplot(position = position_dodge(width = 0.8)) +
labs(x = "BLOCK", y = "Error", fill = "Condition") +
ggtitle("Error by condition for each block") +
scale_fill_manual(name = "Condition",
labels = c("Cold", "Warm"),
values = c("#56B4E9", "orange")) +
theme_classic()
#RT
m.RT.coact <- lmer(TIME ~ BLOCK * CONDITION * MEAN.COACT + (1|PARTICIPANT), data = Behav)
anova(m.RT.coact)
## Type III Analysis of Variance Table with Satterthwaite's method
## Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
## BLOCK 20176 2241.7 9 234.44 0.8378 0.58195
## CONDITION 8979 8979.1 1 236.01 3.3557 0.06823 .
## MEAN.COACT 6546 6546.3 1 236.00 2.4465 0.11912
## BLOCK:CONDITION 34439 3826.6 9 234.44 1.4301 0.17591
## BLOCK:MEAN.COACT 20309 2256.6 9 234.44 0.8433 0.57691
## CONDITION:MEAN.COACT 8962 8962.3 1 236.00 3.3495 0.06849 .
## BLOCK:CONDITION:MEAN.COACT 34479 3830.9 9 234.44 1.4317 0.17523
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(m.RT.coact)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: TIME ~ BLOCK * CONDITION * MEAN.COACT + (1 | PARTICIPANT)
## Data: Behav
##
## REML criterion at convergence: 2948.5
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.7709 -0.4977 -0.0134 0.4668 4.9113
##
## Random effects:
## Groups Name Variance Std.Dev.
## PARTICIPANT (Intercept) 8051 89.72
## Residual 2676 51.73
## Number of obs: 300, groups: PARTICIPANT, 30
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) -17519.70 12881.69 234.11 -1.360 0.1751
## BLOCK2 963.01 16705.11 233.20 0.058 0.9541
## BLOCK3 17629.53 14018.89 233.49 1.258 0.2098
## BLOCK4 24322.34 17348.65 235.18 1.402 0.1622
## BLOCK5 -3532.08 23403.25 235.20 -0.151 0.8802
## BLOCK6 12995.76 28014.76 234.60 0.464 0.6432
## BLOCK7 24069.79 15226.57 234.97 1.581 0.1153
## BLOCK8 15392.25 33335.46 234.39 0.462 0.6447
## BLOCK9 21166.48 13223.31 234.37 1.601 0.1108
## BLOCK10 -39868.37 31355.66 234.86 -1.271 0.2048
## CONDITION2 24718.58 16451.80 234.02 1.502 0.1343
## MEAN.COACT 177.95 128.80 234.11 1.382 0.1684
## BLOCK2:CONDITION2 -3152.65 19862.59 233.80 -0.159 0.8740
## BLOCK3:CONDITION2 -26070.66 17589.41 233.71 -1.482 0.1396
## BLOCK4:CONDITION2 -35483.20 21145.82 235.51 -1.678 0.0947 .
## BLOCK5:CONDITION2 -1847.49 25553.78 234.97 -0.072 0.9424
## BLOCK6:CONDITION2 -20768.42 32516.37 235.35 -0.639 0.5236
## BLOCK7:CONDITION2 -30578.30 18361.84 234.58 -1.665 0.0972 .
## BLOCK8:CONDITION2 -22265.97 34869.82 234.35 -0.639 0.5237
## BLOCK9:CONDITION2 -28062.43 16719.37 234.18 -1.678 0.0946 .
## BLOCK10:CONDITION2 33347.38 32983.27 234.76 1.011 0.3130
## BLOCK2:MEAN.COACT -10.21 167.00 233.20 -0.061 0.9513
## BLOCK3:MEAN.COACT -176.89 140.16 233.49 -1.262 0.2082
## BLOCK4:MEAN.COACT -243.89 173.47 235.18 -1.406 0.1610
## BLOCK5:MEAN.COACT 34.53 233.96 235.20 0.148 0.8828
## BLOCK6:MEAN.COACT -130.50 280.09 234.60 -0.466 0.6417
## BLOCK7:MEAN.COACT -241.67 152.27 234.97 -1.587 0.1138
## BLOCK8:MEAN.COACT -154.93 333.32 234.39 -0.465 0.6425
## BLOCK9:MEAN.COACT -212.91 132.22 234.37 -1.610 0.1087
## BLOCK10:MEAN.COACT 397.20 313.46 234.86 1.267 0.2064
## CONDITION2:MEAN.COACT -247.29 164.52 234.02 -1.503 0.1341
## BLOCK2:CONDITION2:MEAN.COACT 31.84 198.60 233.80 0.160 0.8728
## BLOCK3:CONDITION2:MEAN.COACT 261.04 175.89 233.71 1.484 0.1391
## BLOCK4:CONDITION2:MEAN.COACT 355.16 211.46 235.51 1.680 0.0944 .
## BLOCK5:CONDITION2:MEAN.COACT 18.75 255.48 234.97 0.073 0.9416
## BLOCK6:CONDITION2:MEAN.COACT 207.52 325.14 235.35 0.638 0.5239
## BLOCK7:CONDITION2:MEAN.COACT 305.85 183.63 234.58 1.666 0.0971 .
## BLOCK8:CONDITION2:MEAN.COACT 222.84 348.67 234.35 0.639 0.5234
## BLOCK9:CONDITION2:MEAN.COACT 281.11 167.20 234.18 1.681 0.0940 .
## BLOCK10:CONDITION2:MEAN.COACT -332.96 329.75 234.76 -1.010 0.3137
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation matrix not shown by default, as p = 40 > 12.
## Use print(x, correlation=TRUE) or
## vcov(x) if you need it
emmeans(m.RT.coact,~ MEAN.COACT|CONDITION)
## NOTE: Results may be misleading due to involvement in interactions
## CONDITION = 1:
## MEAN.COACT emmean SE df lower.CL upper.CL
## 100 239 32.5 90.7 174 304
##
## CONDITION = 2:
## MEAN.COACT emmean SE df lower.CL upper.CL
## 100 206 25.0 35.1 155 257
##
## Results are averaged over the levels of: BLOCK
## Degrees-of-freedom method: kenward-roger
## Confidence level used: 0.95
#Effects just on the RT model
ae.m.RT.coact<-allEffects(m.RT.coact)
ae.m.RT.coact.df<-as.data.frame(ae.m.RT.coact[[1]])
plot(ae.m.RT.coact)
ggplot(Behav, aes(x = TIME, y = MEAN.COACT, color = CONDITION)) +
geom_line(size=1) +
facet_grid(CONDITION ~ ., scales = "free_y") +
labs(x = "Time", y = "Coactivation", color = "CONDITION") +
ggtitle("Coactivation on Time by Condition") +
scale_color_manual(name = "Condition",
labels = c("Cold", "Warm"),
values = c("#56B4E9", "orange")) +
scale_y_continuous(limits = c(80, 120)) +
scale_x_continuous(limits = c(50, 450)) +
theme_classic()
## Warning: Removed 2 rows containing missing values (`geom_line()`).
ggplot(Behav, aes(x = TIME, y = MEAN.COACT, color = CONDITION)) +
geom_line(position = position_dodge(width = 0.8), size=0.5) +
labs(x = "TIME", y = "Coactivation", fill = "Condition") +
ggtitle("Coactivation by condition for each block") +
scale_color_manual(name = "Condition",
labels = c("Cold", "Warm"),
values = c("#56B4E9", "orange")) +
scale_y_continuous(limits = c(90, 140)) +
theme(strip.text = element_text(margin = margin(b = 10))) +
theme_classic()
## Warning: `position_dodge()` requires non-overlapping x intervals
ggplot(Behav, aes(x = BLOCK, y = MEAN.COACT, color = CONDITION)) +
geom_line(position = position_dodge(width = 0.3), size=1.5) +
labs(x = "BLOCK", y = "Coactivation", fill = "Condition") +
ggtitle("Coactivation by condition for each block") +
scale_color_manual(name = "Condition",
labels = c("Cold", "Ideal"),
values = c("#56B4E9", "orange")) +
scale_y_continuous(limits = c(90, 140)) +
theme(strip.text = element_text(margin = margin(b = 10)))+
theme_classic()
m.RT.coact.log <- lmer(TIME ~ BLOCK * CONDITION * log(MEAN.COACT) + (1|PARTICIPANT), data = Behav)
anova(m.RT.coact.log)
## Type III Analysis of Variance Table with Satterthwaite's method
## Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
## BLOCK 20339 2259.9 9 233.69 0.8446 0.57575
## CONDITION 8995 8994.8 1 235.39 3.3617 0.06799 .
## log(MEAN.COACT) 6566 6565.6 1 235.36 2.4538 0.11858
## BLOCK:CONDITION 34401 3822.4 9 233.66 1.4286 0.17657
## BLOCK:log(MEAN.COACT) 20368 2263.2 9 233.69 0.8458 0.57463
## CONDITION:log(MEAN.COACT) 8991 8991.1 1 235.39 3.3604 0.06805 .
## BLOCK:CONDITION:log(MEAN.COACT) 34410 3823.3 9 233.66 1.4289 0.17642
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(m.RT.coact.log)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: TIME ~ BLOCK * CONDITION * log(MEAN.COACT) + (1 | PARTICIPANT)
## Data: Behav
##
## REML criterion at convergence: 2763.3
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -3.7724 -0.4978 -0.0135 0.4680 4.9116
##
## Random effects:
## Groups Name Variance Std.Dev.
## PARTICIPANT (Intercept) 8051 89.73
## Residual 2676 51.73
## Number of obs: 300, groups: PARTICIPANT, 30
##
## Fixed effects:
## Estimate Std. Error df t value
## (Intercept) -81828.0 59339.2 229.7 -1.379
## BLOCK2 4822.6 76938.7 230.5 0.063
## BLOCK3 81554.4 64600.9 229.7 1.262
## BLOCK4 112403.5 79879.9 232.1 1.407
## BLOCK5 -15915.8 107788.4 232.7 -0.148
## BLOCK6 60146.4 129046.9 232.2 0.466
## BLOCK7 111270.5 70081.0 231.9 1.588
## BLOCK8 71397.8 153529.6 232.1 0.465
## BLOCK9 97913.1 60885.3 230.2 1.608
## BLOCK10 -183204.6 144475.9 232.7 -1.268
## CONDITION2 113791.0 75759.5 230.1 1.502
## log(MEAN.COACT) 17828.5 12884.9 229.7 1.384
## BLOCK2:CONDITION2 -14853.7 91443.7 231.1 -0.162
## BLOCK3:CONDITION2 -120012.1 81002.6 230.2 -1.482
## BLOCK4:CONDITION2 -163597.5 97351.7 232.6 -1.680
## BLOCK5:CONDITION2 -8217.6 117684.2 232.3 -0.070
## BLOCK6:CONDITION2 -95513.2 149735.4 233.1 -0.638
## BLOCK7:CONDITION2 -140607.1 84517.0 231.5 -1.664
## BLOCK8:CONDITION2 -102417.0 160586.7 231.9 -0.638
## BLOCK9:CONDITION2 -128984.7 76969.4 230.4 -1.676
## BLOCK10:CONDITION2 153917.0 151960.1 232.6 1.013
## BLOCK2:log(MEAN.COACT) -1059.7 16706.0 230.5 -0.063
## BLOCK3:log(MEAN.COACT) -17722.1 14027.2 229.7 -1.263
## BLOCK4:log(MEAN.COACT) -24422.6 17345.3 232.1 -1.408
## BLOCK5:log(MEAN.COACT) 3439.0 23404.4 232.7 0.147
## BLOCK6:log(MEAN.COACT) -13072.3 28020.8 232.2 -0.467
## BLOCK7:log(MEAN.COACT) -24183.2 15218.0 231.9 -1.589
## BLOCK8:log(MEAN.COACT) -15525.7 33337.8 232.1 -0.466
## BLOCK9:log(MEAN.COACT) -21288.5 13220.8 230.2 -1.610
## BLOCK10:log(MEAN.COACT) 39750.2 31370.5 232.7 1.267
## CONDITION2:log(MEAN.COACT) -24711.7 16450.9 230.1 -1.502
## BLOCK2:CONDITION2:log(MEAN.COACT) 3232.3 19856.3 231.1 0.163
## BLOCK3:CONDITION2:log(MEAN.COACT) 26067.6 17589.4 230.2 1.482
## BLOCK4:CONDITION2:log(MEAN.COACT) 35531.8 21139.6 232.6 1.681
## BLOCK5:CONDITION2:log(MEAN.COACT) 1790.3 25553.6 232.3 0.070
## BLOCK6:CONDITION2:log(MEAN.COACT) 20736.9 32514.1 233.1 0.638
## BLOCK7:CONDITION2:log(MEAN.COACT) 30533.9 18352.9 231.5 1.664
## BLOCK8:CONDITION2:log(MEAN.COACT) 22243.5 34870.4 231.9 0.638
## BLOCK9:CONDITION2:log(MEAN.COACT) 28019.1 16713.8 230.4 1.676
## BLOCK10:CONDITION2:log(MEAN.COACT) -33411.5 32995.9 232.6 -1.013
## Pr(>|t|)
## (Intercept) 0.1692
## BLOCK2 0.9501
## BLOCK3 0.2081
## BLOCK4 0.1607
## BLOCK5 0.8827
## BLOCK6 0.6416
## BLOCK7 0.1137
## BLOCK8 0.6423
## BLOCK9 0.1092
## BLOCK10 0.2060
## CONDITION2 0.1345
## log(MEAN.COACT) 0.1678
## BLOCK2:CONDITION2 0.8711
## BLOCK3:CONDITION2 0.1398
## BLOCK4:CONDITION2 0.0942 .
## BLOCK5:CONDITION2 0.9444
## BLOCK6:CONDITION2 0.5242
## BLOCK7:CONDITION2 0.0975 .
## BLOCK8:CONDITION2 0.5243
## BLOCK9:CONDITION2 0.0951 .
## BLOCK10:CONDITION2 0.3122
## BLOCK2:log(MEAN.COACT) 0.9495
## BLOCK3:log(MEAN.COACT) 0.2077
## BLOCK4:log(MEAN.COACT) 0.1605
## BLOCK5:log(MEAN.COACT) 0.8833
## BLOCK6:log(MEAN.COACT) 0.6413
## BLOCK7:log(MEAN.COACT) 0.1134
## BLOCK8:log(MEAN.COACT) 0.6419
## BLOCK9:log(MEAN.COACT) 0.1087
## BLOCK10:log(MEAN.COACT) 0.2064
## CONDITION2:log(MEAN.COACT) 0.1344
## BLOCK2:CONDITION2:log(MEAN.COACT) 0.8708
## BLOCK3:CONDITION2:log(MEAN.COACT) 0.1397
## BLOCK4:CONDITION2:log(MEAN.COACT) 0.0941 .
## BLOCK5:CONDITION2:log(MEAN.COACT) 0.9442
## BLOCK6:CONDITION2:log(MEAN.COACT) 0.5242
## BLOCK7:CONDITION2:log(MEAN.COACT) 0.0975 .
## BLOCK8:CONDITION2:log(MEAN.COACT) 0.5242
## BLOCK9:CONDITION2:log(MEAN.COACT) 0.0950 .
## BLOCK10:CONDITION2:log(MEAN.COACT) 0.3123
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation matrix not shown by default, as p = 40 > 12.
## Use print(x, correlation=TRUE) or
## vcov(x) if you need it
#Effects just on the RT model
ae.m.RT.coact.log<-allEffects(m.RT.coact.log)
ae.m.RT.coact.df.og<-as.data.frame(ae.m.RT.coact.log[[1]])
plot(ae.m.RT.coact.log)
ggplot(Behav, aes(x = TIME, y = log(MEAN.COACT), color = CONDITION)) +
geom_line(size = 1) +
facet_grid(CONDITION ~ ., scales = "free_y") +
labs(x = "Time", y = "Log Coactivation", color = "CONDITION") +
ggtitle("Coactivation on Time by Condition") +
scale_color_manual(name = "Condition",
labels = c("Cold", "Warm"),
values = c("#56B4E9", "orange")) +
scale_y_continuous(limits = c(log(80), log(120))) +
scale_x_continuous(limits = c(50, 450))
## Warning: Removed 2 rows containing missing values (`geom_line()`).
ggplot(Behav, aes(x = BLOCK, y = log(MEAN.COACT), color = CONDITION)) +
geom_line() +
facet_grid(CONDITION ~ ., scales = "free_y") +
labs(x = "Block", y = "Coactivation", fill = "CONDITION") +
ggtitle("Coactivation by block for both conditions") +
scale_color_manual(name = "Condition",
labels = c("Cold", "Warm"),
values = c("#56B4E9", "orange")) +
scale_y_continuous(limits = c(log(80), log(120))) +
theme_classic()
m.coact <- lmer(COACTIVATION.INDEX ~ BLOCK * CONDITION * PHASE + (1|PARTICIPANT), data = EMG)
anova(m.coact)
## Type III Analysis of Variance Table with Satterthwaite's method
## Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
## BLOCK 8260 917.7 9 14670.3 1.5468 0.12527
## CONDITION 556 555.7 1 28.1 0.9367 0.34140
## PHASE 47077 5230.8 9 14670.1 8.8164 2.381e-13 ***
## BLOCK:CONDITION 9263 1029.2 9 14670.3 1.7347 0.07553 .
## BLOCK:PHASE 44459 548.9 81 14670.1 0.9251 0.66837
## CONDITION:PHASE 5384 598.3 9 14670.1 1.0084 0.43041
## BLOCK:CONDITION:PHASE 44283 546.7 81 14670.1 0.9215 0.67720
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
there is a significant effect of Phase but not of Block on the coactivation index
there is a interaction effect of Block and condition which is not significant but its worth mentioning on the coactivation index
emmeans(m.coact, ~ PHASE | CONDITION)
## Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
## To enable adjustments, add the argument 'pbkrtest.limit = 14898' (or larger)
## [or, globally, 'set emm_options(pbkrtest.limit = 14898)' or larger];
## but be warned that this may result in large computation time and memory use.
## Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
## To enable adjustments, add the argument 'lmerTest.limit = 14898' (or larger)
## [or, globally, 'set emm_options(lmerTest.limit = 14898)' or larger];
## but be warned that this may result in large computation time and memory use.
## NOTE: Results may be misleading due to involvement in interactions
## CONDITION = 0:
## PHASE emmean SE df asymp.LCL asymp.UCL
## 10 101.3 1.04 Inf 99.3 103
## 20 101.3 1.04 Inf 99.3 103
## 30 98.7 1.04 Inf 96.7 101
## 40 101.3 1.03 Inf 99.3 103
## 50 98.7 1.04 Inf 96.6 101
## 60 101.3 1.04 Inf 99.3 103
## 70 98.5 1.04 Inf 96.5 101
## 80 101.3 1.04 Inf 99.3 103
## 90 98.7 1.04 Inf 96.7 101
## 100 98.7 1.04 Inf 96.7 101
##
## CONDITION = 1:
## PHASE emmean SE df asymp.LCL asymp.UCL
## 10 105.1 1.04 Inf 103.1 107
## 20 101.9 1.04 Inf 99.8 104
## 30 98.4 1.03 Inf 96.4 100
## 40 103.5 1.04 Inf 101.4 105
## 50 98.8 1.03 Inf 96.8 101
## 60 101.8 1.04 Inf 99.8 104
## 70 98.8 1.03 Inf 96.7 101
## 80 102.5 1.04 Inf 100.5 105
## 90 98.6 1.04 Inf 96.6 101
## 100 98.8 1.04 Inf 96.8 101
##
## Results are averaged over the levels of: BLOCK
## Degrees-of-freedom method: asymptotic
## Confidence level used: 0.95
emmeans(m.coact, ~ PHASE)
## Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
## To enable adjustments, add the argument 'pbkrtest.limit = 14898' (or larger)
## [or, globally, 'set emm_options(pbkrtest.limit = 14898)' or larger];
## but be warned that this may result in large computation time and memory use.
## Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
## To enable adjustments, add the argument 'lmerTest.limit = 14898' (or larger)
## [or, globally, 'set emm_options(lmerTest.limit = 14898)' or larger];
## but be warned that this may result in large computation time and memory use.
## NOTE: Results may be misleading due to involvement in interactions
## PHASE emmean SE df asymp.LCL asymp.UCL
## 10 103.2 0.732 Inf 101.8 105
## 20 101.6 0.732 Inf 100.2 103
## 30 98.6 0.732 Inf 97.2 100
## 40 102.4 0.732 Inf 100.9 104
## 50 98.7 0.732 Inf 97.3 100
## 60 101.6 0.732 Inf 100.2 103
## 70 98.7 0.733 Inf 97.2 100
## 80 101.9 0.733 Inf 100.5 103
## 90 98.7 0.733 Inf 97.2 100
## 100 98.8 0.732 Inf 97.3 100
##
## Results are averaged over the levels of: BLOCK, CONDITION
## Degrees-of-freedom method: asymptotic
## Confidence level used: 0.95
emmeans(m.coact, ~ PHASE | BLOCK)
## Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
## To enable adjustments, add the argument 'pbkrtest.limit = 14898' (or larger)
## [or, globally, 'set emm_options(pbkrtest.limit = 14898)' or larger];
## but be warned that this may result in large computation time and memory use.
## Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
## To enable adjustments, add the argument 'lmerTest.limit = 14898' (or larger)
## [or, globally, 'set emm_options(lmerTest.limit = 14898)' or larger];
## but be warned that this may result in large computation time and memory use.
## NOTE: Results may be misleading due to involvement in interactions
## BLOCK = 1:
## PHASE emmean SE df asymp.LCL asymp.UCL
## 10 101.2 2.04 Inf 97.2 105
## 20 101.3 2.04 Inf 97.3 105
## 30 98.8 2.02 Inf 94.8 103
## 40 101.2 2.02 Inf 97.3 105
## 50 98.8 2.04 Inf 94.8 103
## 60 101.3 2.03 Inf 97.3 105
## 70 98.7 2.04 Inf 94.7 103
## 80 101.3 2.03 Inf 97.3 105
## 90 98.7 2.05 Inf 94.7 103
## 100 98.6 2.04 Inf 94.7 103
##
## BLOCK = 2:
## PHASE emmean SE df asymp.LCL asymp.UCL
## 10 101.2 2.04 Inf 97.2 105
## 20 100.9 2.04 Inf 96.9 105
## 30 98.8 2.04 Inf 94.7 103
## 40 102.0 2.03 Inf 98.1 106
## 50 98.5 2.03 Inf 94.5 102
## 60 101.1 2.03 Inf 97.1 105
## 70 98.0 2.04 Inf 94.0 102
## 80 101.6 2.03 Inf 97.6 106
## 90 98.7 2.03 Inf 94.8 103
## 100 98.9 2.03 Inf 94.9 103
##
## BLOCK = 3:
## PHASE emmean SE df asymp.LCL asymp.UCL
## 10 101.7 2.04 Inf 97.7 106
## 20 101.1 2.03 Inf 97.1 105
## 30 98.7 2.05 Inf 94.7 103
## 40 101.2 2.04 Inf 97.2 105
## 50 98.5 2.02 Inf 94.5 102
## 60 101.5 2.04 Inf 97.5 105
## 70 98.7 2.04 Inf 94.7 103
## 80 101.3 2.02 Inf 97.3 105
## 90 98.1 2.03 Inf 94.1 102
## 100 98.8 2.03 Inf 94.8 103
##
## BLOCK = 4:
## PHASE emmean SE df asymp.LCL asymp.UCL
## 10 101.0 2.02 Inf 97.1 105
## 20 101.4 2.02 Inf 97.4 105
## 30 98.7 2.02 Inf 94.8 103
## 40 101.2 2.03 Inf 97.3 105
## 50 98.7 2.03 Inf 94.8 103
## 60 101.4 2.03 Inf 97.4 105
## 70 98.7 2.03 Inf 94.7 103
## 80 101.3 2.04 Inf 97.2 105
## 90 98.7 2.04 Inf 94.7 103
## 100 98.7 2.03 Inf 94.7 103
##
## BLOCK = 5:
## PHASE emmean SE df asymp.LCL asymp.UCL
## 10 102.8 2.02 Inf 98.8 107
## 20 101.0 2.02 Inf 97.1 105
## 30 98.7 2.02 Inf 94.7 103
## 40 102.0 2.02 Inf 98.1 106
## 50 98.7 2.03 Inf 94.8 103
## 60 101.3 2.02 Inf 97.4 105
## 70 98.6 2.03 Inf 94.7 103
## 80 101.3 2.02 Inf 97.3 105
## 90 98.7 2.03 Inf 94.7 103
## 100 98.7 2.03 Inf 94.7 103
##
## BLOCK = 6:
## PHASE emmean SE df asymp.LCL asymp.UCL
## 10 101.0 2.04 Inf 97.0 105
## 20 101.5 2.03 Inf 97.5 105
## 30 98.7 2.02 Inf 94.8 103
## 40 101.3 2.03 Inf 97.3 105
## 50 98.7 2.02 Inf 94.7 103
## 60 101.2 2.02 Inf 97.2 105
## 70 98.8 2.03 Inf 94.8 103
## 80 101.3 2.03 Inf 97.3 105
## 90 98.7 2.02 Inf 94.8 103
## 100 98.7 2.02 Inf 94.8 103
##
## BLOCK = 7:
## PHASE emmean SE df asymp.LCL asymp.UCL
## 10 101.9 2.02 Inf 97.9 106
## 20 101.3 2.02 Inf 97.3 105
## 30 98.8 2.03 Inf 94.8 103
## 40 101.2 2.04 Inf 97.2 105
## 50 98.7 2.02 Inf 94.8 103
## 60 101.0 2.04 Inf 97.0 105
## 70 98.6 2.04 Inf 94.6 103
## 80 102.7 2.03 Inf 98.7 107
## 90 98.7 2.02 Inf 94.8 103
## 100 98.7 2.04 Inf 94.7 103
##
## BLOCK = 8:
## PHASE emmean SE df asymp.LCL asymp.UCL
## 10 101.6 2.02 Inf 97.6 106
## 20 101.8 2.03 Inf 97.8 106
## 30 97.6 2.02 Inf 93.6 102
## 40 108.8 2.03 Inf 104.8 113
## 50 98.8 2.03 Inf 94.9 103
## 60 102.5 2.04 Inf 98.5 107
## 70 98.7 2.02 Inf 94.7 103
## 80 102.4 2.04 Inf 98.4 106
## 90 99.5 2.03 Inf 95.5 103
## 100 99.1 2.02 Inf 95.1 103
##
## BLOCK = 9:
## PHASE emmean SE df asymp.LCL asymp.UCL
## 10 118.9 2.04 Inf 114.9 123
## 20 103.7 2.02 Inf 99.7 108
## 30 97.9 2.02 Inf 94.0 102
## 40 103.9 2.02 Inf 99.9 108
## 50 98.4 2.02 Inf 94.4 102
## 60 101.4 2.02 Inf 97.4 105
## 70 99.0 2.04 Inf 95.0 103
## 80 104.4 2.04 Inf 100.4 108
## 90 98.1 2.02 Inf 94.1 102
## 100 98.5 2.03 Inf 94.5 102
##
## BLOCK = 10:
## PHASE emmean SE df asymp.LCL asymp.UCL
## 10 100.8 2.02 Inf 96.9 105
## 20 101.9 2.02 Inf 98.0 106
## 30 99.2 2.02 Inf 95.3 103
## 40 100.9 2.02 Inf 96.9 105
## 50 99.5 2.03 Inf 95.5 104
## 60 103.2 2.03 Inf 99.3 107
## 70 98.8 2.03 Inf 94.8 103
## 80 101.6 2.02 Inf 97.6 106
## 90 98.8 2.03 Inf 94.8 103
## 100 99.0 2.02 Inf 95.0 103
##
## Results are averaged over the levels of: CONDITION
## Degrees-of-freedom method: asymptotic
## Confidence level used: 0.95
emmeans(m.coact, ~ BLOCK * CONDITION)
## Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
## To enable adjustments, add the argument 'pbkrtest.limit = 14898' (or larger)
## [or, globally, 'set emm_options(pbkrtest.limit = 14898)' or larger];
## but be warned that this may result in large computation time and memory use.
## Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
## To enable adjustments, add the argument 'lmerTest.limit = 14898' (or larger)
## [or, globally, 'set emm_options(lmerTest.limit = 14898)' or larger];
## but be warned that this may result in large computation time and memory use.
## NOTE: Results may be misleading due to involvement in interactions
## BLOCK CONDITION emmean SE df asymp.LCL asymp.UCL
## 1 0 100.0 1.04 Inf 98.0 102
## 2 0 100.0 1.04 Inf 98.0 102
## 3 0 100.1 1.04 Inf 98.0 102
## 4 0 100.0 1.04 Inf 98.0 102
## 5 0 100.0 1.03 Inf 98.0 102
## 6 0 100.0 1.03 Inf 98.0 102
## 7 0 100.0 1.03 Inf 97.9 102
## 8 0 100.0 1.04 Inf 98.0 102
## 9 0 99.9 1.04 Inf 97.8 102
## 10 0 100.0 1.03 Inf 98.0 102
## 1 1 100.0 1.04 Inf 97.9 102
## 2 1 99.9 1.03 Inf 97.9 102
## 3 1 99.8 1.04 Inf 97.8 102
## 4 1 100.0 1.04 Inf 97.9 102
## 5 1 100.4 1.04 Inf 98.3 102
## 6 1 100.0 1.04 Inf 97.9 102
## 7 1 100.4 1.04 Inf 98.3 102
## 8 1 102.2 1.04 Inf 100.1 104
## 9 1 105.0 1.04 Inf 102.9 107
## 10 1 100.7 1.03 Inf 98.7 103
##
## Results are averaged over the levels of: PHASE
## Degrees-of-freedom method: asymptotic
## Confidence level used: 0.95
ae.m.coact<-allEffects(m.coact)
ae.m.coact.df<-as.data.frame(ae.m.coact[[1]])
plot(ae.m.coact)
#Coactivation
m.coact.blk <- lmer(COACTIVATION.INDEX ~ BLOCK * CONDITION + (1|PARTICIPANT), data = EMG)
anova(m.coact.blk)
## Type III Analysis of Variance Table with Satterthwaite's method
## Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
## BLOCK 7989.2 887.69 9 14850.3 1.4906 0.14483
## CONDITION 540.4 540.41 1 28.1 0.9074 0.34893
## BLOCK:CONDITION 8989.6 998.85 9 14850.3 1.6772 0.08847 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ae.m.coact.blk<-allEffects(m.coact.blk)
ae.m.coact.blk.df<-as.data.frame(ae.m.coact.blk[[1]])
plot(ae.m.coact.blk)
ggplot(EMG, aes(x = INTERVALS , y = COACTIVATION.INDEX, color = CONDITION)) +
geom_line(size=0.8) +
facet_grid(CONDITION ~ ., scales = "free_y") +
labs(x = "Block", y = "Coactivation", color = "CONDITION") +
ggtitle("Coactivation by Block/Trial and Condition") +
geom_vline(xintercept = seq(0, max(EMG$INTERVALS), by = 5),
linetype = "dotted") +
scale_color_manual(name = "Condition",
labels = c("Cold", "Warm"),
values = c("#56B4E9", "orange")) +
scale_y_continuous(limits = c(70, 130)) +
scale_x_continuous(breaks = seq(0, max(EMG$INTERVALS), by = 5),
labels = c("0","1", "2", "3", "4", "5", "6", "7", "8", "9", "10")) +
theme_classic()
ggplot(EMG, aes(x = INTERVALS, y = COACTIVATION.INDEX, color = CONDITION)) +
geom_line(size = 0.4) +
labs(x = "Block", y = "Coactivation", color = "Condition") +
ggtitle("Coactivation by Block/Trial and Condition") +
geom_vline(xintercept = seq(0, max(EMG$INTERVALS), by = 5), linetype = "dotted") +
scale_color_manual(name = "Condition",
labels = c("Cold", "Warm"),
values = c("#56B4E9", "orange")) +
scale_y_continuous(limits = c(70, 130)) +
scale_x_continuous(breaks = seq(0, max(EMG$INTERVALS), by = 5),
labels = c("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10")) +
theme_classic()
ggplot(EMG, aes(x = BLOCK, y = COACTIVATION.INDEX, color = CONDITION)) +
geom_line(size=1) +
facet_grid(CONDITION ~ ., scales = "free_y") +
labs(x = "Block", y = "Coactivation", color = "CONDITION") +
ggtitle("Coactivation by Block and Condition") +
scale_color_manual(name = "Condition",
labels = c("Cold", "Warm"),
values = c("#56B4E9", "orange")) +
scale_y_continuous(limits = c(70, 130)) +
theme_classic()
ggplot(EMG, aes(x = BLOCK, y = COACTIVATION.INDEX, color = CONDITION)) +
geom_line(position = position_dodge(width = 0.3), size=1.5) +
labs(x = "Block", y = "Coactivation", color = "CONDITION") +
ggtitle("Coactivation by Block and Condition") +
scale_color_manual(name = "Condition",
labels = c("Cold", "Warm"),
values = c("#56B4E9", "orange")) +
scale_y_continuous(limits = c(70, 130)) +
theme(strip.text = element_text(margin = margin(b = 10)))+
theme_classic()
ggplot(EMG, aes(x = PHASE , y = COACTIVATION.INDEX, color = CONDITION)) +
geom_line(size=1) +
facet_grid(CONDITION ~ ., scales = "free_y") +
labs(x = "Phase", y = "Coactivation", color = "CONDITION") +
ggtitle(" Coactivation by Phase and Condition") +
scale_color_manual(name = "Condition",
labels = c("Cold", "Warm"),
values = c("#56B4E9", "orange")) +
scale_y_continuous(limits = c(70, 130))+
theme_classic()
## Warning: Removed 1 row containing missing values (`geom_line()`).
ggplot(EMG, aes(x = PHASE , y = COACTIVATION.INDEX, color = CONDITION)) +
geom_line(position = position_dodge(width = 0.3), size=1.5) +
labs(x = "Phase", y = "Coactivation", color = "CONDITION") +
ggtitle("Coactivation by Phase and Condition") +
scale_color_manual(name = "Condition",
labels = c("Cold", "Warm"),
values = c("#56B4E9", "orange")) +
scale_y_continuous(limits = c(70, 130)) +
theme(strip.text = element_text(margin = margin(b = 10)))+
theme_classic()
## Warning: Removed 1 row containing missing values (`geom_line()`).
m.coact.ext <- lmer(COACT.EXT ~ BLOCK * CONDITION * PHASE + (1|PARTICIPANT), data = EMG)
anova(m.coact.ext)
## Type III Analysis of Variance Table with Satterthwaite's method
## Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
## BLOCK 505692 56188 9 14667.7 0.9834 0.4512
## CONDITION 56954 56954 1 28.1 0.9968 0.3266
## PHASE 478105 53123 9 14667.4 0.9297 0.4976
## BLOCK:CONDITION 504887 56099 9 14667.7 0.9818 0.4526
## BLOCK:PHASE 4675546 57723 81 14667.4 1.0103 0.4535
## CONDITION:PHASE 476410 52934 9 14667.4 0.9264 0.5005
## BLOCK:CONDITION:PHASE 4680219 57780 81 14667.4 1.0113 0.4510
summary(m.coact.ext)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: COACT.EXT ~ BLOCK * CONDITION * PHASE + (1 | PARTICIPANT)
## Data: EMG
##
## REML criterion at convergence: 203538.2
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -1.799 0.000 0.001 0.009 119.424
##
## Random effects:
## Groups Name Variance Std.Dev.
## PARTICIPANT (Intercept) 89.95 9.484
## Residual 57137.03 239.034
## Number of obs: 14895, groups: PARTICIPANT, 30
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 1.013e+02 2.789e+01 1.302e+04 3.631 0.000283
## BLOCK2 7.140e-02 3.943e+01 1.467e+04 0.002 0.998555
## BLOCK3 1.335e-01 3.930e+01 1.467e+04 0.003 0.997290
## BLOCK4 9.961e-04 3.917e+01 1.467e+04 0.000 0.999980
## BLOCK5 2.207e-02 3.917e+01 1.467e+04 0.001 0.999550
## BLOCK6 -5.079e-02 3.930e+01 1.467e+04 -0.001 0.998969
## BLOCK7 1.304e-01 3.917e+01 1.467e+04 0.003 0.997343
## BLOCK8 2.570e-02 3.917e+01 1.467e+04 0.001 0.999476
## BLOCK9 -4.207e-02 3.917e+01 1.467e+04 -0.001 0.999143
## BLOCK10 -4.613e-02 3.917e+01 1.467e+04 -0.001 0.999060
## CONDITION1 -1.632e-01 3.945e+01 1.302e+04 -0.004 0.996699
## PHASE20 1.217e-01 3.957e+01 1.467e+04 0.003 0.997547
## PHASE30 1.284e-02 3.917e+01 1.467e+04 0.000 0.999738
## PHASE40 -2.741e-02 3.917e+01 1.467e+04 -0.001 0.999442
## PHASE50 1.165e-01 3.943e+01 1.467e+04 0.003 0.997643
## PHASE60 -4.090e-02 3.930e+01 1.467e+04 -0.001 0.999170
## PHASE70 1.779e-02 3.943e+01 1.467e+04 0.000 0.999640
## PHASE80 2.106e-01 3.930e+01 1.467e+04 0.005 0.995724
## PHASE90 8.012e-02 3.943e+01 1.467e+04 0.002 0.998379
## PHASE100 7.006e-03 3.930e+01 1.467e+04 0.000 0.999858
## BLOCK2:CONDITION1 -2.033e-01 5.558e+01 1.467e+04 -0.004 0.997081
## BLOCK3:CONDITION1 6.285e-01 5.557e+01 1.467e+04 0.011 0.990977
## BLOCK4:CONDITION1 -3.649e-01 5.539e+01 1.467e+04 -0.007 0.994744
## BLOCK5:CONDITION1 3.094e+00 5.539e+01 1.467e+04 0.056 0.955459
## BLOCK6:CONDITION1 -3.820e-01 5.557e+01 1.467e+04 -0.007 0.994516
## BLOCK7:CONDITION1 1.074e+00 5.539e+01 1.467e+04 0.019 0.984529
## BLOCK8:CONDITION1 7.240e-01 5.539e+01 1.467e+04 0.013 0.989570
## BLOCK9:CONDITION1 3.549e+01 5.558e+01 1.467e+04 0.639 0.523111
## BLOCK10:CONDITION1 -6.345e-01 5.539e+01 1.467e+04 -0.011 0.990860
## BLOCK2:PHASE20 -2.501e-01 5.586e+01 1.467e+04 -0.004 0.996427
## BLOCK3:PHASE20 -8.887e-02 5.567e+01 1.467e+04 -0.002 0.998726
## BLOCK4:PHASE20 -2.202e-01 5.558e+01 1.467e+04 -0.004 0.996839
## BLOCK5:PHASE20 -1.539e-01 5.558e+01 1.467e+04 -0.003 0.997790
## BLOCK6:PHASE20 7.647e-02 5.567e+01 1.467e+04 0.001 0.998904
## BLOCK7:PHASE20 -2.889e-01 5.558e+01 1.467e+04 -0.005 0.995853
## BLOCK8:PHASE20 -1.740e-01 5.558e+01 1.467e+04 -0.003 0.997502
## BLOCK9:PHASE20 -7.608e-02 5.558e+01 1.467e+04 -0.001 0.998908
## BLOCK10:PHASE20 -2.990e-02 5.558e+01 1.467e+04 -0.001 0.999571
## BLOCK2:PHASE30 -2.425e-01 5.577e+01 1.467e+04 -0.004 0.996531
## BLOCK3:PHASE30 -1.699e-01 5.558e+01 1.467e+04 -0.003 0.997561
## BLOCK4:PHASE30 -1.079e-02 5.530e+01 1.467e+04 0.000 0.999844
## BLOCK5:PHASE30 -1.053e-01 5.530e+01 1.467e+04 -0.002 0.998481
## BLOCK6:PHASE30 1.159e-03 5.539e+01 1.467e+04 0.000 0.999983
## BLOCK7:PHASE30 -8.808e-02 5.530e+01 1.467e+04 -0.002 0.998729
## BLOCK8:PHASE30 -2.848e-02 5.530e+01 1.467e+04 -0.001 0.999589
## BLOCK9:PHASE30 2.676e-02 5.530e+01 1.467e+04 0.000 0.999614
## BLOCK10:PHASE30 1.773e-02 5.530e+01 1.467e+04 0.000 0.999744
## BLOCK2:PHASE40 1.817e-01 5.558e+01 1.467e+04 0.003 0.997392
## BLOCK3:PHASE40 -9.939e-02 5.558e+01 1.467e+04 -0.002 0.998573
## BLOCK4:PHASE40 5.111e-02 5.530e+01 1.467e+04 0.001 0.999263
## BLOCK5:PHASE40 2.080e-02 5.530e+01 1.467e+04 0.000 0.999700
## BLOCK6:PHASE40 6.756e-02 5.539e+01 1.467e+04 0.001 0.999027
## BLOCK7:PHASE40 -3.249e-01 5.530e+01 1.467e+04 -0.006 0.995311
## BLOCK8:PHASE40 -6.031e-02 5.530e+01 1.467e+04 -0.001 0.999130
## BLOCK9:PHASE40 4.361e-02 5.530e+01 1.467e+04 0.001 0.999371
## BLOCK10:PHASE40 1.283e-01 5.530e+01 1.467e+04 0.002 0.998149
## BLOCK2:PHASE50 2.010e-02 5.576e+01 1.467e+04 0.000 0.999712
## BLOCK3:PHASE50 -2.337e-01 5.558e+01 1.467e+04 -0.004 0.996646
## BLOCK4:PHASE50 -6.058e-02 5.548e+01 1.467e+04 -0.001 0.999129
## BLOCK5:PHASE50 -2.622e-01 5.548e+01 1.467e+04 -0.005 0.996230
## BLOCK6:PHASE50 -4.532e-02 5.558e+01 1.467e+04 -0.001 0.999349
## BLOCK7:PHASE50 -1.523e-01 5.548e+01 1.467e+04 -0.003 0.997809
## BLOCK8:PHASE50 -3.057e-03 5.558e+01 1.467e+04 0.000 0.999956
## BLOCK9:PHASE50 -4.020e-02 5.548e+01 1.467e+04 -0.001 0.999422
## BLOCK10:PHASE50 -1.017e-01 5.558e+01 1.467e+04 -0.002 0.998540
## BLOCK2:PHASE60 8.737e-03 5.567e+01 1.467e+04 0.000 0.999875
## BLOCK3:PHASE60 1.077e-01 5.557e+01 1.467e+04 0.002 0.998454
## BLOCK4:PHASE60 1.038e-02 5.548e+01 1.467e+04 0.000 0.999851
## BLOCK5:PHASE60 1.740e-01 5.539e+01 1.467e+04 0.003 0.997493
## BLOCK6:PHASE60 -1.066e-02 5.548e+01 1.467e+04 0.000 0.999847
## BLOCK7:PHASE60 -1.375e-01 5.539e+01 1.467e+04 -0.002 0.998019
## BLOCK8:PHASE60 1.930e-01 5.558e+01 1.467e+04 0.003 0.997230
## BLOCK9:PHASE60 9.197e-02 5.539e+01 1.467e+04 0.002 0.998675
## BLOCK10:PHASE60 1.908e-01 5.539e+01 1.467e+04 0.003 0.997252
## BLOCK2:PHASE70 -9.650e-02 5.586e+01 1.467e+04 -0.002 0.998622
## BLOCK3:PHASE70 -6.764e-02 5.576e+01 1.467e+04 -0.001 0.999032
## BLOCK4:PHASE70 1.367e-02 5.558e+01 1.467e+04 0.000 0.999804
## BLOCK5:PHASE70 1.359e-01 5.548e+01 1.467e+04 0.002 0.998046
## BLOCK6:PHASE70 -3.086e-02 5.567e+01 1.467e+04 -0.001 0.999558
## BLOCK7:PHASE70 8.192e-02 5.567e+01 1.467e+04 0.001 0.998826
## BLOCK8:PHASE70 -4.026e-02 5.548e+01 1.467e+04 -0.001 0.999421
## BLOCK9:PHASE70 6.530e-02 5.567e+01 1.467e+04 0.001 0.999064
## BLOCK10:PHASE70 2.591e-02 5.558e+01 1.467e+04 0.000 0.999628
## BLOCK2:PHASE80 -2.356e-01 5.567e+01 1.467e+04 -0.004 0.996623
## BLOCK3:PHASE80 -3.961e-01 5.548e+01 1.467e+04 -0.007 0.994304
## BLOCK4:PHASE80 -1.222e-01 5.539e+01 1.467e+04 -0.002 0.998240
## BLOCK5:PHASE80 -2.231e-01 5.539e+01 1.467e+04 -0.004 0.996787
## BLOCK6:PHASE80 -1.259e-01 5.548e+01 1.467e+04 -0.002 0.998190
## BLOCK7:PHASE80 -3.470e-01 5.548e+01 1.467e+04 -0.006 0.995010
## BLOCK8:PHASE80 -2.109e-01 5.548e+01 1.467e+04 -0.004 0.996967
## BLOCK9:PHASE80 -1.866e-01 5.558e+01 1.467e+04 -0.003 0.997321
## BLOCK10:PHASE80 -1.825e-01 5.539e+01 1.467e+04 -0.003 0.997371
## BLOCK2:PHASE90 -1.422e-01 5.576e+01 1.467e+04 -0.003 0.997966
## BLOCK3:PHASE90 -1.949e-01 5.558e+01 1.467e+04 -0.004 0.997201
## BLOCK4:PHASE90 -1.542e-01 5.558e+01 1.467e+04 -0.003 0.997786
## BLOCK5:PHASE90 -1.113e-01 5.548e+01 1.467e+04 -0.002 0.998400
## BLOCK6:PHASE90 -5.554e-02 5.558e+01 1.467e+04 -0.001 0.999203
## BLOCK7:PHASE90 -2.246e-01 5.548e+01 1.467e+04 -0.004 0.996770
## BLOCK8:PHASE90 -3.887e-02 5.548e+01 1.467e+04 -0.001 0.999441
## BLOCK9:PHASE90 -6.211e-02 5.548e+01 1.467e+04 -0.001 0.999107
## BLOCK10:PHASE90 -1.408e-02 5.558e+01 1.467e+04 0.000 0.999798
## BLOCK2:PHASE100 -7.555e-02 5.567e+01 1.467e+04 -0.001 0.998917
## BLOCK3:PHASE100 -2.623e-01 5.548e+01 1.467e+04 -0.005 0.996228
## BLOCK4:PHASE100 3.511e-02 5.548e+01 1.467e+04 0.001 0.999495
## BLOCK5:PHASE100 -7.721e-02 5.539e+01 1.467e+04 -0.001 0.998888
## BLOCK6:PHASE100 3.007e-02 5.548e+01 1.467e+04 0.001 0.999568
## BLOCK7:PHASE100 -8.403e-02 5.539e+01 1.467e+04 -0.002 0.998790
## BLOCK8:PHASE100 -1.381e-01 5.539e+01 1.467e+04 -0.002 0.998011
## BLOCK9:PHASE100 1.670e-02 5.548e+01 1.467e+04 0.000 0.999760
## BLOCK10:PHASE100 2.105e-02 5.539e+01 1.467e+04 0.000 0.999697
## CONDITION1:PHASE20 -3.653e-02 5.567e+01 1.467e+04 -0.001 0.999476
## CONDITION1:PHASE30 3.078e-02 5.539e+01 1.467e+04 0.001 0.999557
## CONDITION1:PHASE40 6.999e-02 5.539e+01 1.467e+04 0.001 0.998992
## CONDITION1:PHASE50 -1.030e-01 5.558e+01 1.467e+04 -0.002 0.998522
## CONDITION1:PHASE60 2.170e-01 5.548e+01 1.467e+04 0.004 0.996879
## CONDITION1:PHASE70 2.694e-01 5.558e+01 1.467e+04 0.005 0.996132
## CONDITION1:PHASE80 -2.134e-01 5.548e+01 1.467e+04 -0.004 0.996931
## CONDITION1:PHASE90 -5.721e-02 5.576e+01 1.467e+04 -0.001 0.999181
## CONDITION1:PHASE100 2.899e-01 5.557e+01 1.467e+04 0.005 0.995838
## BLOCK2:CONDITION1:PHASE20 -2.560e-01 7.873e+01 1.467e+04 -0.003 0.997406
## BLOCK3:CONDITION1:PHASE20 -1.184e+00 7.860e+01 1.467e+04 -0.015 0.987979
## BLOCK4:CONDITION1:PHASE20 8.758e-01 7.840e+01 1.467e+04 0.011 0.991088
## BLOCK5:CONDITION1:PHASE20 -3.366e+00 7.840e+01 1.467e+04 -0.043 0.965751
## BLOCK6:CONDITION1:PHASE20 6.253e-01 7.860e+01 1.467e+04 0.008 0.993652
## BLOCK7:CONDITION1:PHASE20 -8.267e-01 7.840e+01 1.467e+04 -0.011 0.991587
## BLOCK8:CONDITION1:PHASE20 5.203e-01 7.847e+01 1.467e+04 0.007 0.994710
## BLOCK9:CONDITION1:PHASE20 -3.054e+01 7.854e+01 1.467e+04 -0.389 0.697427
## BLOCK10:CONDITION1:PHASE20 2.020e+00 7.840e+01 1.467e+04 0.026 0.979443
## BLOCK2:CONDITION1:PHASE30 6.244e-01 7.854e+01 1.467e+04 0.008 0.993657
## BLOCK3:CONDITION1:PHASE30 1.147e-01 7.860e+01 1.467e+04 0.001 0.998836
## BLOCK4:CONDITION1:PHASE30 4.867e-01 7.820e+01 1.467e+04 0.006 0.995034
## BLOCK5:CONDITION1:PHASE30 -2.741e+00 7.820e+01 1.467e+04 -0.035 0.972036
## BLOCK6:CONDITION1:PHASE30 5.483e-01 7.833e+01 1.467e+04 0.007 0.994415
## BLOCK7:CONDITION1:PHASE30 -1.228e+00 7.827e+01 1.467e+04 -0.016 0.987484
## BLOCK8:CONDITION1:PHASE30 8.433e+00 7.820e+01 1.467e+04 0.108 0.914127
## BLOCK9:CONDITION1:PHASE30 -2.854e+01 7.833e+01 1.467e+04 -0.364 0.715608
## BLOCK10:CONDITION1:PHASE30 3.697e-01 7.820e+01 1.467e+04 0.005 0.996228
## BLOCK2:CONDITION1:PHASE40 1.329e+00 7.840e+01 1.467e+04 0.017 0.986471
## BLOCK3:CONDITION1:PHASE40 -7.920e-01 7.853e+01 1.467e+04 -0.010 0.991954
## BLOCK4:CONDITION1:PHASE40 2.961e-01 7.827e+01 1.467e+04 0.004 0.996982
## BLOCK5:CONDITION1:PHASE40 -1.556e+00 7.820e+01 1.467e+04 -0.020 0.984121
## BLOCK6:CONDITION1:PHASE40 4.313e-01 7.840e+01 1.467e+04 0.006 0.995611
## BLOCK7:CONDITION1:PHASE40 -7.790e-01 7.840e+01 1.467e+04 -0.010 0.992073
## BLOCK8:CONDITION1:PHASE40 1.448e+01 7.827e+01 1.467e+04 0.185 0.853241
## BLOCK9:CONDITION1:PHASE40 -3.021e+01 7.833e+01 1.467e+04 -0.386 0.699732
## BLOCK10:CONDITION1:PHASE40 -1.751e-01 7.820e+01 1.467e+04 -0.002 0.998213
## BLOCK2:CONDITION1:PHASE50 6.425e-01 7.853e+01 1.467e+04 0.008 0.993472
## BLOCK3:CONDITION1:PHASE50 2.434e-01 7.846e+01 1.467e+04 0.003 0.997525
## BLOCK4:CONDITION1:PHASE50 4.684e-01 7.840e+01 1.467e+04 0.006 0.995233
## BLOCK5:CONDITION1:PHASE50 -2.653e+00 7.840e+01 1.467e+04 -0.034 0.973008
## BLOCK6:CONDITION1:PHASE50 6.575e-01 7.846e+01 1.467e+04 0.008 0.993314
## BLOCK7:CONDITION1:PHASE50 -9.785e-01 7.833e+01 1.467e+04 -0.012 0.990033
## BLOCK8:CONDITION1:PHASE50 -1.861e-01 7.840e+01 1.467e+04 -0.002 0.998106
## BLOCK9:CONDITION1:PHASE50 -3.354e+01 7.847e+01 1.467e+04 -0.427 0.669058
## BLOCK10:CONDITION1:PHASE50 -2.120e-01 7.846e+01 1.467e+04 -0.003 0.997845
## BLOCK2:CONDITION1:PHASE60 -3.562e-01 7.846e+01 1.467e+04 -0.005 0.996378
## BLOCK3:CONDITION1:PHASE60 -6.904e-01 7.853e+01 1.467e+04 -0.009 0.992986
## BLOCK4:CONDITION1:PHASE60 5.676e-01 7.833e+01 1.467e+04 0.007 0.994219
## BLOCK5:CONDITION1:PHASE60 -3.408e+00 7.827e+01 1.467e+04 -0.044 0.965272
## BLOCK6:CONDITION1:PHASE60 2.711e-01 7.840e+01 1.467e+04 0.003 0.997241
## BLOCK7:CONDITION1:PHASE60 -1.632e+00 7.840e+01 1.467e+04 -0.021 0.983396
## BLOCK8:CONDITION1:PHASE60 1.339e+00 7.840e+01 1.467e+04 0.017 0.986376
## BLOCK9:CONDITION1:PHASE60 -3.535e+01 7.840e+01 1.467e+04 -0.451 0.652070
## BLOCK10:CONDITION1:PHASE60 4.233e+00 7.833e+01 1.467e+04 0.054 0.956907
## BLOCK2:CONDITION1:PHASE70 3.919e+02 7.866e+01 1.467e+04 4.982 6.38e-07
## BLOCK3:CONDITION1:PHASE70 -9.207e-01 7.860e+01 1.467e+04 -0.012 0.990654
## BLOCK4:CONDITION1:PHASE70 2.021e-01 7.840e+01 1.467e+04 0.003 0.997943
## BLOCK5:CONDITION1:PHASE70 -3.411e+00 7.840e+01 1.467e+04 -0.044 0.965299
## BLOCK6:CONDITION1:PHASE70 2.787e-01 7.853e+01 1.467e+04 0.004 0.997168
## BLOCK7:CONDITION1:PHASE70 -1.294e+00 7.847e+01 1.467e+04 -0.016 0.986838
## BLOCK8:CONDITION1:PHASE70 -3.594e-01 7.833e+01 1.467e+04 -0.005 0.996340
## BLOCK9:CONDITION1:PHASE70 -3.695e+01 7.867e+01 1.467e+04 -0.470 0.638609
## BLOCK10:CONDITION1:PHASE70 3.862e-01 7.840e+01 1.467e+04 0.005 0.996070
## BLOCK2:CONDITION1:PHASE80 1.025e+00 7.846e+01 1.467e+04 0.013 0.989578
## BLOCK3:CONDITION1:PHASE80 -1.832e-01 7.840e+01 1.467e+04 -0.002 0.998135
## BLOCK4:CONDITION1:PHASE80 4.214e-01 7.847e+01 1.467e+04 0.005 0.995715
## BLOCK5:CONDITION1:PHASE80 -2.720e+00 7.827e+01 1.467e+04 -0.035 0.972280
## BLOCK6:CONDITION1:PHASE80 6.873e-01 7.846e+01 1.467e+04 0.009 0.993011
## BLOCK7:CONDITION1:PHASE80 2.058e+00 7.833e+01 1.467e+04 0.026 0.979042
## BLOCK8:CONDITION1:PHASE80 1.871e+00 7.840e+01 1.467e+04 0.024 0.980957
## BLOCK9:CONDITION1:PHASE80 -2.885e+01 7.860e+01 1.467e+04 -0.367 0.713557
## BLOCK10:CONDITION1:PHASE80 1.569e+00 7.827e+01 1.467e+04 0.020 0.984011
## BLOCK2:CONDITION1:PHASE90 4.550e-01 7.866e+01 1.467e+04 0.006 0.995385
## BLOCK3:CONDITION1:PHASE90 -5.228e-01 7.873e+01 1.467e+04 -0.007 0.994701
## BLOCK4:CONDITION1:PHASE90 6.700e-01 7.866e+01 1.467e+04 0.009 0.993204
## BLOCK5:CONDITION1:PHASE90 -2.892e+00 7.853e+01 1.467e+04 -0.037 0.970623
## BLOCK6:CONDITION1:PHASE90 6.161e-01 7.860e+01 1.467e+04 0.008 0.993746
## BLOCK7:CONDITION1:PHASE90 -8.670e-01 7.847e+01 1.467e+04 -0.011 0.991185
## BLOCK8:CONDITION1:PHASE90 -1.405e+00 7.853e+01 1.467e+04 -0.018 0.985728
## BLOCK9:CONDITION1:PHASE90 -3.290e+00 7.860e+01 1.467e+04 -0.042 0.966613
## BLOCK10:CONDITION1:PHASE90 7.198e-01 7.853e+01 1.467e+04 0.009 0.992687
## BLOCK2:CONDITION1:PHASE100 -1.702e-01 7.853e+01 1.467e+04 -0.002 0.998271
## BLOCK3:CONDITION1:PHASE100 -6.393e-01 7.853e+01 1.467e+04 -0.008 0.993505
## BLOCK4:CONDITION1:PHASE100 2.809e-01 7.840e+01 1.467e+04 0.004 0.997141
## BLOCK5:CONDITION1:PHASE100 -3.136e+00 7.840e+01 1.467e+04 -0.040 0.968091
## BLOCK6:CONDITION1:PHASE100 2.556e-01 7.846e+01 1.467e+04 0.003 0.997401
## BLOCK7:CONDITION1:PHASE100 -1.360e+00 7.846e+01 1.467e+04 -0.017 0.986173
## BLOCK8:CONDITION1:PHASE100 -9.165e-01 7.833e+01 1.467e+04 -0.012 0.990664
## BLOCK9:CONDITION1:PHASE100 -3.266e+01 7.853e+01 1.467e+04 -0.416 0.677472
## BLOCK10:CONDITION1:PHASE100 2.513e-01 7.833e+01 1.467e+04 0.003 0.997440
##
## (Intercept) ***
## BLOCK2
## BLOCK3
## BLOCK4
## BLOCK5
## BLOCK6
## BLOCK7
## BLOCK8
## BLOCK9
## BLOCK10
## CONDITION1
## PHASE20
## PHASE30
## PHASE40
## PHASE50
## PHASE60
## PHASE70
## PHASE80
## PHASE90
## PHASE100
## BLOCK2:CONDITION1
## BLOCK3:CONDITION1
## BLOCK4:CONDITION1
## BLOCK5:CONDITION1
## BLOCK6:CONDITION1
## BLOCK7:CONDITION1
## BLOCK8:CONDITION1
## BLOCK9:CONDITION1
## BLOCK10:CONDITION1
## BLOCK2:PHASE20
## BLOCK3:PHASE20
## BLOCK4:PHASE20
## BLOCK5:PHASE20
## BLOCK6:PHASE20
## BLOCK7:PHASE20
## BLOCK8:PHASE20
## BLOCK9:PHASE20
## BLOCK10:PHASE20
## BLOCK2:PHASE30
## BLOCK3:PHASE30
## BLOCK4:PHASE30
## BLOCK5:PHASE30
## BLOCK6:PHASE30
## BLOCK7:PHASE30
## BLOCK8:PHASE30
## BLOCK9:PHASE30
## BLOCK10:PHASE30
## BLOCK2:PHASE40
## BLOCK3:PHASE40
## BLOCK4:PHASE40
## BLOCK5:PHASE40
## BLOCK6:PHASE40
## BLOCK7:PHASE40
## BLOCK8:PHASE40
## BLOCK9:PHASE40
## BLOCK10:PHASE40
## BLOCK2:PHASE50
## BLOCK3:PHASE50
## BLOCK4:PHASE50
## BLOCK5:PHASE50
## BLOCK6:PHASE50
## BLOCK7:PHASE50
## BLOCK8:PHASE50
## BLOCK9:PHASE50
## BLOCK10:PHASE50
## BLOCK2:PHASE60
## BLOCK3:PHASE60
## BLOCK4:PHASE60
## BLOCK5:PHASE60
## BLOCK6:PHASE60
## BLOCK7:PHASE60
## BLOCK8:PHASE60
## BLOCK9:PHASE60
## BLOCK10:PHASE60
## BLOCK2:PHASE70
## BLOCK3:PHASE70
## BLOCK4:PHASE70
## BLOCK5:PHASE70
## BLOCK6:PHASE70
## BLOCK7:PHASE70
## BLOCK8:PHASE70
## BLOCK9:PHASE70
## BLOCK10:PHASE70
## BLOCK2:PHASE80
## BLOCK3:PHASE80
## BLOCK4:PHASE80
## BLOCK5:PHASE80
## BLOCK6:PHASE80
## BLOCK7:PHASE80
## BLOCK8:PHASE80
## BLOCK9:PHASE80
## BLOCK10:PHASE80
## BLOCK2:PHASE90
## BLOCK3:PHASE90
## BLOCK4:PHASE90
## BLOCK5:PHASE90
## BLOCK6:PHASE90
## BLOCK7:PHASE90
## BLOCK8:PHASE90
## BLOCK9:PHASE90
## BLOCK10:PHASE90
## BLOCK2:PHASE100
## BLOCK3:PHASE100
## BLOCK4:PHASE100
## BLOCK5:PHASE100
## BLOCK6:PHASE100
## BLOCK7:PHASE100
## BLOCK8:PHASE100
## BLOCK9:PHASE100
## BLOCK10:PHASE100
## CONDITION1:PHASE20
## CONDITION1:PHASE30
## CONDITION1:PHASE40
## CONDITION1:PHASE50
## CONDITION1:PHASE60
## CONDITION1:PHASE70
## CONDITION1:PHASE80
## CONDITION1:PHASE90
## CONDITION1:PHASE100
## BLOCK2:CONDITION1:PHASE20
## BLOCK3:CONDITION1:PHASE20
## BLOCK4:CONDITION1:PHASE20
## BLOCK5:CONDITION1:PHASE20
## BLOCK6:CONDITION1:PHASE20
## BLOCK7:CONDITION1:PHASE20
## BLOCK8:CONDITION1:PHASE20
## BLOCK9:CONDITION1:PHASE20
## BLOCK10:CONDITION1:PHASE20
## BLOCK2:CONDITION1:PHASE30
## BLOCK3:CONDITION1:PHASE30
## BLOCK4:CONDITION1:PHASE30
## BLOCK5:CONDITION1:PHASE30
## BLOCK6:CONDITION1:PHASE30
## BLOCK7:CONDITION1:PHASE30
## BLOCK8:CONDITION1:PHASE30
## BLOCK9:CONDITION1:PHASE30
## BLOCK10:CONDITION1:PHASE30
## BLOCK2:CONDITION1:PHASE40
## BLOCK3:CONDITION1:PHASE40
## BLOCK4:CONDITION1:PHASE40
## BLOCK5:CONDITION1:PHASE40
## BLOCK6:CONDITION1:PHASE40
## BLOCK7:CONDITION1:PHASE40
## BLOCK8:CONDITION1:PHASE40
## BLOCK9:CONDITION1:PHASE40
## BLOCK10:CONDITION1:PHASE40
## BLOCK2:CONDITION1:PHASE50
## BLOCK3:CONDITION1:PHASE50
## BLOCK4:CONDITION1:PHASE50
## BLOCK5:CONDITION1:PHASE50
## BLOCK6:CONDITION1:PHASE50
## BLOCK7:CONDITION1:PHASE50
## BLOCK8:CONDITION1:PHASE50
## BLOCK9:CONDITION1:PHASE50
## BLOCK10:CONDITION1:PHASE50
## BLOCK2:CONDITION1:PHASE60
## BLOCK3:CONDITION1:PHASE60
## BLOCK4:CONDITION1:PHASE60
## BLOCK5:CONDITION1:PHASE60
## BLOCK6:CONDITION1:PHASE60
## BLOCK7:CONDITION1:PHASE60
## BLOCK8:CONDITION1:PHASE60
## BLOCK9:CONDITION1:PHASE60
## BLOCK10:CONDITION1:PHASE60
## BLOCK2:CONDITION1:PHASE70 ***
## BLOCK3:CONDITION1:PHASE70
## BLOCK4:CONDITION1:PHASE70
## BLOCK5:CONDITION1:PHASE70
## BLOCK6:CONDITION1:PHASE70
## BLOCK7:CONDITION1:PHASE70
## BLOCK8:CONDITION1:PHASE70
## BLOCK9:CONDITION1:PHASE70
## BLOCK10:CONDITION1:PHASE70
## BLOCK2:CONDITION1:PHASE80
## BLOCK3:CONDITION1:PHASE80
## BLOCK4:CONDITION1:PHASE80
## BLOCK5:CONDITION1:PHASE80
## BLOCK6:CONDITION1:PHASE80
## BLOCK7:CONDITION1:PHASE80
## BLOCK8:CONDITION1:PHASE80
## BLOCK9:CONDITION1:PHASE80
## BLOCK10:CONDITION1:PHASE80
## BLOCK2:CONDITION1:PHASE90
## BLOCK3:CONDITION1:PHASE90
## BLOCK4:CONDITION1:PHASE90
## BLOCK5:CONDITION1:PHASE90
## BLOCK6:CONDITION1:PHASE90
## BLOCK7:CONDITION1:PHASE90
## BLOCK8:CONDITION1:PHASE90
## BLOCK9:CONDITION1:PHASE90
## BLOCK10:CONDITION1:PHASE90
## BLOCK2:CONDITION1:PHASE100
## BLOCK3:CONDITION1:PHASE100
## BLOCK4:CONDITION1:PHASE100
## BLOCK5:CONDITION1:PHASE100
## BLOCK6:CONDITION1:PHASE100
## BLOCK7:CONDITION1:PHASE100
## BLOCK8:CONDITION1:PHASE100
## BLOCK9:CONDITION1:PHASE100
## BLOCK10:CONDITION1:PHASE100
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation matrix not shown by default, as p = 200 > 12.
## Use print(x, correlation=TRUE) or
## vcov(x) if you need it
ae.m.coact.ext<-allEffects(m.coact.ext)
ae.m.coact.ext.df<-as.data.frame(ae.m.coact.ext[[1]])
plot(ae.m.coact.ext)
m.coact.ext.blk <- lmer(COACT.EXT ~ BLOCK * CONDITION + (1|PARTICIPANT), data = EMG)
anova(m.coact.ext.blk)
## Type III Analysis of Variance Table with Satterthwaite's method
## Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
## BLOCK 496407 55156 9 14847.7 0.9652 0.4667
## CONDITION 56003 56003 1 28.1 0.9801 0.3306
## BLOCK:CONDITION 495576 55064 9 14847.7 0.9636 0.4681
summary(m.coact.ext.blk)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: COACT.EXT ~ BLOCK * CONDITION + (1 | PARTICIPANT)
## Data: EMG
##
## REML criterion at convergence: 205292.2
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -0.490 -0.001 0.000 0.008 120.895
##
## Random effects:
## Groups Name Variance Std.Dev.
## PARTICIPANT (Intercept) 90.14 9.494
## Residual 57142.20 239.044
## Number of obs: 14895, groups: PARTICIPANT, 30
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 1.013e+02 9.141e+00 9.985e+02 11.087 <2e-16 ***
## BLOCK2 -1.081e-02 1.246e+01 1.485e+04 -0.001 0.9993
## BLOCK3 -6.776e-03 1.243e+01 1.485e+04 -0.001 0.9996
## BLOCK4 -4.427e-02 1.242e+01 1.485e+04 -0.004 0.9972
## BLOCK5 -3.771e-02 1.240e+01 1.485e+04 -0.003 0.9976
## BLOCK6 -5.953e-02 1.241e+01 1.485e+04 -0.005 0.9962
## BLOCK7 -2.622e-02 1.241e+01 1.485e+04 -0.002 0.9983
## BLOCK8 -2.453e-02 1.242e+01 1.485e+04 -0.002 0.9984
## BLOCK9 -5.377e-02 1.242e+01 1.485e+04 -0.004 0.9965
## BLOCK10 -4.008e-02 1.241e+01 1.485e+04 -0.003 0.9974
## CONDITION1 -1.159e-01 1.289e+01 9.886e+02 -0.009 0.9928
## BLOCK2:CONDITION1 3.895e+01 1.756e+01 1.485e+04 2.218 0.0266 *
## BLOCK3:CONDITION1 1.710e-01 1.756e+01 1.485e+04 0.010 0.9922
## BLOCK4:CONDITION1 6.249e-02 1.754e+01 1.485e+04 0.004 0.9972
## BLOCK5:CONDITION1 5.070e-01 1.752e+01 1.485e+04 0.029 0.9769
## BLOCK6:CONDITION1 5.489e-02 1.753e+01 1.485e+04 0.003 0.9975
## BLOCK7:CONDITION1 3.886e-01 1.754e+01 1.485e+04 0.022 0.9823
## BLOCK8:CONDITION1 3.094e+00 1.753e+01 1.485e+04 0.177 0.8599
## BLOCK9:CONDITION1 9.445e+00 1.753e+01 1.485e+04 0.539 0.5901
## BLOCK10:CONDITION1 2.776e-01 1.752e+01 1.485e+04 0.016 0.9874
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation matrix not shown by default, as p = 20 > 12.
## Use print(x, correlation=TRUE) or
## vcov(x) if you need it
ae.m.coact.ext.blk<-allEffects(m.coact.ext.blk)
ae.m.coact.ext.blk.df<-as.data.frame(ae.m.coact.ext.blk[[1]])
plot(ae.m.coact.ext.blk)
ggplot(EMG, aes(x = INTERVALS , y = COACT.EXT, color = CONDITION)) +
geom_line(size=0.5) +
facet_grid(CONDITION ~ ., scales = "free_y") +
labs(x = "Block", y = "Coactivation", color = "CONDITION") +
ggtitle("Coactivation by Block/Trial and Condition") +
geom_vline(xintercept = seq(0, max(EMG$INTERVALS), by = 5),
linetype = "dotted") +
scale_color_manual(name = "Condition",
labels = c("Cold", "Warm"),
values = c("#56B4E9", "orange")) +
scale_y_continuous(limits = c(70, 130)) +
scale_x_continuous(breaks = seq(0, max(EMG$INTERVALS), by = 5),
labels = c("0","1", "2", "3", "4", "5", "6", "7", "8", "9", "10"))
ggplot(EMG, aes(x = BLOCK, y = COACT.EXT, color = CONDITION)) +
geom_point(size=1) +
facet_grid(CONDITION ~ ., scales = "free_y") +
labs(x = "Block", y = "Coactivation", color = "CONDITION") +
ggtitle("Scatterplot of Coactivation by Block and Condition") +
scale_color_manual(name = "Condition",
labels = c("Cold", "Warm"),
values = c("#56B4E9", "orange")) +
scale_y_continuous(limits = c(70, 130))
## Warning: Removed 171 rows containing missing values (`geom_point()`).
ggplot(EMG, aes(x = PHASE , y = COACT.EXT, color = CONDITION)) +
geom_point(size=1) +
facet_grid(CONDITION ~ ., scales = "free_y") +
labs(x = "Paase", y = "Coactivation", color = "CONDITION") +
ggtitle("Scatterplot of Coactivation by Phase and Condition") +
scale_color_manual(name = "Condition",
labels = c("Cold", "Warm"),
values = c("#56B4E9", "orange")) +
scale_y_continuous(limits = c(70, 130))
## Warning: Removed 171 rows containing missing values (`geom_point()`).
#Coactivation
m.coact.flex <- lmer(COACT.FLEX ~ BLOCK * CONDITION * PHASE + (1|PARTICIPANT), data = EMG)
anova(m.coact.flex)
## Type III Analysis of Variance Table with Satterthwaite's method
## Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
## BLOCK 394.12 43.791 9 14675.8 1.3462 0.2070
## CONDITION 9.81 9.812 1 26.2 0.3016 0.5875
## PHASE 191.80 21.311 9 14675.4 0.6551 0.7502
## BLOCK:CONDITION 315.06 35.006 9 14675.8 1.0762 0.3766
## BLOCK:PHASE 1896.49 23.413 81 14675.4 0.7198 0.9730
## CONDITION:PHASE 212.22 23.580 9 14675.4 0.7249 0.6865
## BLOCK:CONDITION:PHASE 2195.83 27.109 81 14675.4 0.8334 0.8577
summary(m.coact.flex)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: COACT.FLEX ~ BLOCK * CONDITION * PHASE + (1 | PARTICIPANT)
## Data: EMG
##
## REML criterion at convergence: 93809.2
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -17.494 -0.034 0.002 0.058 43.921
##
## Random effects:
## Groups Name Variance Std.Dev.
## PARTICIPANT (Intercept) 0.03319 0.1822
## Residual 32.52856 5.7034
## Number of obs: 14905, groups: PARTICIPANT, 30
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 9.873e+01 6.647e-01 1.343e+04 148.533 <2e-16
## BLOCK2 -6.944e-02 9.408e-01 1.468e+04 -0.074 0.9412
## BLOCK3 -1.208e-01 9.376e-01 1.468e+04 -0.129 0.8975
## BLOCK4 -1.598e-03 9.345e-01 1.468e+04 -0.002 0.9986
## BLOCK5 -2.418e-02 9.345e-01 1.468e+04 -0.026 0.9794
## BLOCK6 4.803e-02 9.376e-01 1.468e+04 0.051 0.9591
## BLOCK7 -1.261e-01 9.345e-01 1.468e+04 -0.135 0.8927
## BLOCK8 -2.810e-02 9.345e-01 1.468e+04 -0.030 0.9760
## BLOCK9 3.848e-02 9.345e-01 1.468e+04 0.041 0.9672
## BLOCK10 4.238e-02 9.345e-01 1.468e+04 0.045 0.9638
## CONDITION1 1.368e-01 9.400e-01 1.343e+04 0.146 0.8843
## PHASE20 -1.164e-01 9.441e-01 1.468e+04 -0.123 0.9019
## PHASE30 -1.329e-02 9.345e-01 1.468e+04 -0.014 0.9887
## PHASE40 2.658e-02 9.345e-01 1.468e+04 0.028 0.9773
## PHASE50 -1.116e-01 9.408e-01 1.468e+04 -0.119 0.9055
## PHASE60 4.757e-02 9.376e-01 1.468e+04 0.051 0.9595
## PHASE70 -7.792e-03 9.408e-01 1.468e+04 -0.008 0.9934
## PHASE80 -1.814e-01 9.376e-01 1.468e+04 -0.193 0.8466
## PHASE90 -7.777e-02 9.408e-01 1.468e+04 -0.083 0.9341
## PHASE100 -4.870e-03 9.376e-01 1.468e+04 -0.005 0.9959
## BLOCK2:CONDITION1 3.873e-01 1.326e+00 1.468e+04 0.292 0.7702
## BLOCK3:CONDITION1 -4.411e-01 1.326e+00 1.468e+04 -0.333 0.7394
## BLOCK4:CONDITION1 6.999e-01 1.322e+00 1.468e+04 0.530 0.5964
## BLOCK5:CONDITION1 -1.025e+00 1.322e+00 1.468e+04 -0.776 0.4379
## BLOCK6:CONDITION1 5.748e-01 1.326e+00 1.468e+04 0.433 0.6647
## BLOCK7:CONDITION1 -5.900e-01 1.322e+00 1.468e+04 -0.446 0.6553
## BLOCK8:CONDITION1 -3.098e-01 1.322e+00 1.468e+04 -0.234 0.8147
## BLOCK9:CONDITION1 1.779e+00 1.326e+00 1.468e+04 1.342 0.1797
## BLOCK10:CONDITION1 1.035e+00 1.322e+00 1.468e+04 0.783 0.4334
## BLOCK2:PHASE20 2.482e-01 1.333e+00 1.468e+04 0.186 0.8523
## BLOCK3:PHASE20 8.300e-02 1.328e+00 1.468e+04 0.062 0.9502
## BLOCK4:PHASE20 2.158e-01 1.326e+00 1.468e+04 0.163 0.8707
## BLOCK5:PHASE20 1.512e-01 1.326e+00 1.468e+04 0.114 0.9092
## BLOCK6:PHASE20 -6.909e-02 1.328e+00 1.468e+04 -0.052 0.9585
## BLOCK7:PHASE20 2.763e-01 1.326e+00 1.468e+04 0.208 0.8349
## BLOCK8:PHASE20 1.683e-01 1.326e+00 1.468e+04 0.127 0.8990
## BLOCK9:PHASE20 7.174e-02 1.326e+00 1.468e+04 0.054 0.9569
## BLOCK10:PHASE20 2.680e-02 1.326e+00 1.468e+04 0.020 0.9839
## BLOCK2:PHASE30 2.524e-01 1.331e+00 1.468e+04 0.190 0.8496
## BLOCK3:PHASE30 1.527e-01 1.326e+00 1.468e+04 0.115 0.9083
## BLOCK4:PHASE30 1.031e-02 1.319e+00 1.468e+04 0.008 0.9938
## BLOCK5:PHASE30 1.069e-01 1.319e+00 1.468e+04 0.081 0.9355
## BLOCK6:PHASE30 -7.386e-04 1.322e+00 1.468e+04 -0.001 0.9996
## BLOCK7:PHASE30 8.331e-02 1.319e+00 1.468e+04 0.063 0.9497
## BLOCK8:PHASE30 2.884e-02 1.319e+00 1.468e+04 0.022 0.9826
## BLOCK9:PHASE30 -2.598e-02 1.319e+00 1.468e+04 -0.020 0.9843
## BLOCK10:PHASE30 -1.647e-02 1.319e+00 1.468e+04 -0.012 0.9900
## BLOCK2:PHASE40 -1.772e-01 1.326e+00 1.468e+04 -0.134 0.8937
## BLOCK3:PHASE40 8.895e-02 1.326e+00 1.468e+04 0.067 0.9465
## BLOCK4:PHASE40 -4.833e-02 1.319e+00 1.468e+04 -0.037 0.9708
## BLOCK5:PHASE40 -2.025e-02 1.319e+00 1.468e+04 -0.015 0.9878
## BLOCK6:PHASE40 -6.729e-02 1.322e+00 1.468e+04 -0.051 0.9594
## BLOCK7:PHASE40 3.435e-01 1.319e+00 1.468e+04 0.260 0.7946
## BLOCK8:PHASE40 6.073e-02 1.319e+00 1.468e+04 0.046 0.9633
## BLOCK9:PHASE40 -4.305e-02 1.319e+00 1.468e+04 -0.033 0.9740
## BLOCK10:PHASE40 -1.254e-01 1.319e+00 1.468e+04 -0.095 0.9243
## BLOCK2:PHASE50 -1.905e-02 1.331e+00 1.468e+04 -0.014 0.9886
## BLOCK3:PHASE50 2.252e-01 1.326e+00 1.468e+04 0.170 0.8652
## BLOCK4:PHASE50 5.702e-02 1.324e+00 1.468e+04 0.043 0.9656
## BLOCK5:PHASE50 2.556e-01 1.324e+00 1.468e+04 0.193 0.8469
## BLOCK6:PHASE50 4.419e-02 1.326e+00 1.468e+04 0.033 0.9734
## BLOCK7:PHASE50 1.516e-01 1.324e+00 1.468e+04 0.114 0.9089
## BLOCK8:PHASE50 1.209e-02 1.326e+00 1.468e+04 0.009 0.9927
## BLOCK9:PHASE50 3.759e-02 1.324e+00 1.468e+04 0.028 0.9773
## BLOCK10:PHASE50 9.867e-02 1.326e+00 1.468e+04 0.074 0.9407
## BLOCK2:PHASE60 -1.039e-02 1.328e+00 1.468e+04 -0.008 0.9938
## BLOCK3:PHASE60 -1.093e-01 1.326e+00 1.468e+04 -0.082 0.9343
## BLOCK4:PHASE60 -1.430e-02 1.324e+00 1.468e+04 -0.011 0.9914
## BLOCK5:PHASE60 -1.749e-01 1.322e+00 1.468e+04 -0.132 0.8947
## BLOCK6:PHASE60 3.792e-03 1.324e+00 1.468e+04 0.003 0.9977
## BLOCK7:PHASE60 1.387e-01 1.322e+00 1.468e+04 0.105 0.9164
## BLOCK8:PHASE60 -1.882e-01 1.326e+00 1.468e+04 -0.142 0.8872
## BLOCK9:PHASE60 -9.712e-02 1.322e+00 1.468e+04 -0.073 0.9414
## BLOCK10:PHASE60 -1.913e-01 1.322e+00 1.468e+04 -0.145 0.8849
## BLOCK2:PHASE70 8.760e-02 1.333e+00 1.468e+04 0.066 0.9476
## BLOCK3:PHASE70 5.153e-02 1.331e+00 1.468e+04 0.039 0.9691
## BLOCK4:PHASE70 -2.066e-02 1.326e+00 1.468e+04 -0.016 0.9876
## BLOCK5:PHASE70 -1.382e-01 1.324e+00 1.468e+04 -0.104 0.9168
## BLOCK6:PHASE70 2.342e-02 1.328e+00 1.468e+04 0.018 0.9859
## BLOCK7:PHASE70 -9.062e-02 1.328e+00 1.468e+04 -0.068 0.9456
## BLOCK8:PHASE70 3.235e-02 1.324e+00 1.468e+04 0.024 0.9805
## BLOCK9:PHASE70 -1.409e+00 1.326e+00 1.468e+04 -1.062 0.2881
## BLOCK10:PHASE70 -3.636e-02 1.326e+00 1.468e+04 -0.027 0.9781
## BLOCK2:PHASE80 2.085e-01 1.328e+00 1.468e+04 0.157 0.8752
## BLOCK3:PHASE80 3.554e-01 1.324e+00 1.468e+04 0.269 0.7883
## BLOCK4:PHASE80 9.477e-02 1.322e+00 1.468e+04 0.072 0.9428
## BLOCK5:PHASE80 1.942e-01 1.322e+00 1.468e+04 0.147 0.8832
## BLOCK6:PHASE80 9.723e-02 1.324e+00 1.468e+04 0.073 0.9414
## BLOCK7:PHASE80 3.093e-01 1.324e+00 1.468e+04 0.234 0.8152
## BLOCK8:PHASE80 1.822e-01 1.324e+00 1.468e+04 0.138 0.8905
## BLOCK9:PHASE80 -1.175e+00 1.324e+00 1.468e+04 -0.888 0.3746
## BLOCK10:PHASE80 1.548e-01 1.322e+00 1.468e+04 0.117 0.9067
## BLOCK2:PHASE90 1.437e-01 1.331e+00 1.468e+04 0.108 0.9140
## BLOCK3:PHASE90 1.895e-01 1.326e+00 1.468e+04 0.143 0.8864
## BLOCK4:PHASE90 1.514e-01 1.326e+00 1.468e+04 0.114 0.9091
## BLOCK5:PHASE90 1.098e-01 1.324e+00 1.468e+04 0.083 0.9339
## BLOCK6:PHASE90 5.256e-02 1.326e+00 1.468e+04 0.040 0.9684
## BLOCK7:PHASE90 2.152e-01 1.324e+00 1.468e+04 0.163 0.8709
## BLOCK8:PHASE90 3.771e-02 1.324e+00 1.468e+04 0.028 0.9773
## BLOCK9:PHASE90 6.026e-02 1.324e+00 1.468e+04 0.046 0.9637
## BLOCK10:PHASE90 1.143e-02 1.326e+00 1.468e+04 0.009 0.9931
## BLOCK2:PHASE100 7.327e-02 1.328e+00 1.468e+04 0.055 0.9560
## BLOCK3:PHASE100 2.478e-01 1.324e+00 1.468e+04 0.187 0.8515
## BLOCK4:PHASE100 -3.676e-02 1.324e+00 1.468e+04 -0.028 0.9778
## BLOCK5:PHASE100 7.407e-02 1.322e+00 1.468e+04 0.056 0.9553
## BLOCK6:PHASE100 -3.253e-02 1.324e+00 1.468e+04 -0.025 0.9804
## BLOCK7:PHASE100 7.598e-02 1.322e+00 1.468e+04 0.057 0.9542
## BLOCK8:PHASE100 1.329e-01 1.322e+00 1.468e+04 0.101 0.9199
## BLOCK9:PHASE100 -1.922e-02 1.324e+00 1.468e+04 -0.015 0.9884
## BLOCK10:PHASE100 -2.284e-02 1.322e+00 1.468e+04 -0.017 0.9862
## CONDITION1:PHASE20 5.636e-02 1.328e+00 1.468e+04 0.042 0.9662
## CONDITION1:PHASE30 -6.737e-06 1.322e+00 1.468e+04 0.000 1.0000
## CONDITION1:PHASE40 -4.318e-02 1.322e+00 1.468e+04 -0.033 0.9739
## CONDITION1:PHASE50 1.370e-01 1.326e+00 1.468e+04 0.103 0.9177
## CONDITION1:PHASE60 -1.700e-01 1.324e+00 1.468e+04 -0.128 0.8978
## CONDITION1:PHASE70 -2.308e-01 1.326e+00 1.468e+04 -0.174 0.8618
## CONDITION1:PHASE80 2.133e-01 1.324e+00 1.468e+04 0.161 0.8720
## CONDITION1:PHASE90 1.535e-02 1.331e+00 1.468e+04 0.012 0.9908
## CONDITION1:PHASE100 -2.833e-01 1.326e+00 1.468e+04 -0.214 0.8308
## BLOCK2:CONDITION1:PHASE20 -2.158e+00 1.875e+00 1.468e+04 -1.150 0.2500
## BLOCK3:CONDITION1:PHASE20 -1.695e-01 1.874e+00 1.468e+04 -0.090 0.9279
## BLOCK4:CONDITION1:PHASE20 -1.178e+00 1.871e+00 1.468e+04 -0.630 0.5290
## BLOCK5:CONDITION1:PHASE20 1.492e+00 1.871e+00 1.468e+04 0.798 0.4251
## BLOCK6:CONDITION1:PHASE20 -8.105e-01 1.875e+00 1.468e+04 -0.432 0.6656
## BLOCK7:CONDITION1:PHASE20 3.616e-01 1.871e+00 1.468e+04 0.193 0.8467
## BLOCK8:CONDITION1:PHASE20 -6.104e-01 1.872e+00 1.468e+04 -0.326 0.7444
## BLOCK9:CONDITION1:PHASE20 -3.465e+00 1.874e+00 1.468e+04 -1.849 0.0645
## BLOCK10:CONDITION1:PHASE20 -1.795e+00 1.871e+00 1.468e+04 -0.959 0.3374
## BLOCK2:CONDITION1:PHASE30 -8.117e-01 1.874e+00 1.468e+04 -0.433 0.6649
## BLOCK3:CONDITION1:PHASE30 1.091e-01 1.875e+00 1.468e+04 0.058 0.9536
## BLOCK4:CONDITION1:PHASE30 -8.252e-01 1.866e+00 1.468e+04 -0.442 0.6583
## BLOCK5:CONDITION1:PHASE30 6.923e-01 1.866e+00 1.468e+04 0.371 0.7106
## BLOCK6:CONDITION1:PHASE30 -7.398e-01 1.869e+00 1.468e+04 -0.396 0.6922
## BLOCK7:CONDITION1:PHASE30 7.260e-01 1.867e+00 1.468e+04 0.389 0.6975
## BLOCK8:CONDITION1:PHASE30 -2.047e+00 1.866e+00 1.468e+04 -1.097 0.2726
## BLOCK9:CONDITION1:PHASE30 -3.518e+00 1.869e+00 1.468e+04 -1.882 0.0598
## BLOCK10:CONDITION1:PHASE30 -2.075e-01 1.866e+00 1.468e+04 -0.111 0.9115
## BLOCK2:CONDITION1:PHASE40 -8.329e-01 1.871e+00 1.468e+04 -0.445 0.6562
## BLOCK3:CONDITION1:PHASE40 5.610e-01 1.874e+00 1.468e+04 0.299 0.7646
## BLOCK4:CONDITION1:PHASE40 -6.718e-01 1.867e+00 1.468e+04 -0.360 0.7190
## BLOCK5:CONDITION1:PHASE40 3.102e-01 1.866e+00 1.468e+04 0.166 0.8680
## BLOCK6:CONDITION1:PHASE40 -1.972e+00 1.869e+00 1.468e+04 -1.055 0.2913
## BLOCK7:CONDITION1:PHASE40 1.765e-01 1.871e+00 1.468e+04 0.094 0.9248
## BLOCK8:CONDITION1:PHASE40 -1.850e+00 1.867e+00 1.468e+04 -0.991 0.3218
## BLOCK9:CONDITION1:PHASE40 -3.557e+00 1.869e+00 1.468e+04 -1.903 0.0570
## BLOCK10:CONDITION1:PHASE40 1.701e+00 1.866e+00 1.468e+04 0.912 0.3619
## BLOCK2:CONDITION1:PHASE50 -6.829e-01 1.874e+00 1.468e+04 -0.364 0.7155
## BLOCK3:CONDITION1:PHASE50 -2.739e-01 1.872e+00 1.468e+04 -0.146 0.8837
## BLOCK4:CONDITION1:PHASE50 -8.504e-01 1.871e+00 1.468e+04 -0.455 0.6494
## BLOCK5:CONDITION1:PHASE50 5.472e-01 1.871e+00 1.468e+04 0.293 0.7699
## BLOCK6:CONDITION1:PHASE50 -8.593e-01 1.872e+00 1.468e+04 -0.459 0.6463
## BLOCK7:CONDITION1:PHASE50 4.775e-01 1.869e+00 1.468e+04 0.255 0.7983
## BLOCK8:CONDITION1:PHASE50 5.364e-01 1.871e+00 1.468e+04 0.287 0.7743
## BLOCK9:CONDITION1:PHASE50 -2.614e+00 1.872e+00 1.468e+04 -1.396 0.1626
## BLOCK10:CONDITION1:PHASE50 2.244e-01 1.871e+00 1.468e+04 0.120 0.9045
## BLOCK2:CONDITION1:PHASE60 3.480e-01 1.872e+00 1.468e+04 0.186 0.8525
## BLOCK3:CONDITION1:PHASE60 -8.713e-01 1.872e+00 1.468e+04 -0.465 0.6417
## BLOCK4:CONDITION1:PHASE60 -9.173e-01 1.869e+00 1.468e+04 -0.491 0.6236
## BLOCK5:CONDITION1:PHASE60 1.312e+00 1.867e+00 1.468e+04 0.703 0.4824
## BLOCK6:CONDITION1:PHASE60 -4.867e-01 1.871e+00 1.468e+04 -0.260 0.7947
## BLOCK7:CONDITION1:PHASE60 -1.059e-01 1.869e+00 1.468e+04 -0.057 0.9548
## BLOCK8:CONDITION1:PHASE60 -9.120e-01 1.871e+00 1.468e+04 -0.488 0.6259
## BLOCK9:CONDITION1:PHASE60 -2.502e-01 1.871e+00 1.468e+04 -0.134 0.8936
## BLOCK10:CONDITION1:PHASE60 -1.457e+00 1.869e+00 1.468e+04 -0.780 0.4356
## BLOCK2:CONDITION1:PHASE70 -1.841e+00 1.877e+00 1.468e+04 -0.981 0.3266
## BLOCK3:CONDITION1:PHASE70 7.119e-01 1.875e+00 1.468e+04 0.380 0.7042
## BLOCK4:CONDITION1:PHASE70 -5.500e-01 1.871e+00 1.468e+04 -0.294 0.7687
## BLOCK5:CONDITION1:PHASE70 1.285e+00 1.871e+00 1.468e+04 0.687 0.4922
## BLOCK6:CONDITION1:PHASE70 -4.876e-01 1.874e+00 1.468e+04 -0.260 0.7947
## BLOCK7:CONDITION1:PHASE70 8.082e-01 1.872e+00 1.468e+04 0.432 0.6660
## BLOCK8:CONDITION1:PHASE70 2.724e-01 1.869e+00 1.468e+04 0.146 0.8841
## BLOCK9:CONDITION1:PHASE70 1.671e+00 1.875e+00 1.468e+04 0.891 0.3729
## BLOCK10:CONDITION1:PHASE70 -7.853e-01 1.871e+00 1.468e+04 -0.420 0.6746
## BLOCK2:CONDITION1:PHASE80 -9.148e-01 1.872e+00 1.468e+04 -0.489 0.6251
## BLOCK3:CONDITION1:PHASE80 2.190e-02 1.871e+00 1.468e+04 0.012 0.9907
## BLOCK4:CONDITION1:PHASE80 -8.526e-01 1.872e+00 1.468e+04 -0.455 0.6488
## BLOCK5:CONDITION1:PHASE80 6.773e-01 1.867e+00 1.468e+04 0.363 0.7168
## BLOCK6:CONDITION1:PHASE80 -8.924e-01 1.872e+00 1.468e+04 -0.477 0.6336
## BLOCK7:CONDITION1:PHASE80 -6.211e-01 1.869e+00 1.468e+04 -0.332 0.7397
## BLOCK8:CONDITION1:PHASE80 -9.097e-01 1.871e+00 1.468e+04 -0.486 0.6267
## BLOCK9:CONDITION1:PHASE80 -1.604e+00 1.874e+00 1.468e+04 -0.856 0.3919
## BLOCK10:CONDITION1:PHASE80 -1.383e+00 1.867e+00 1.468e+04 -0.740 0.4591
## BLOCK2:CONDITION1:PHASE90 -5.181e-01 1.877e+00 1.468e+04 -0.276 0.7825
## BLOCK3:CONDITION1:PHASE90 -1.011e+00 1.877e+00 1.468e+04 -0.539 0.5900
## BLOCK4:CONDITION1:PHASE90 -1.010e+00 1.877e+00 1.468e+04 -0.538 0.5904
## BLOCK5:CONDITION1:PHASE90 8.545e-01 1.874e+00 1.468e+04 0.456 0.6484
## BLOCK6:CONDITION1:PHASE90 -7.405e-01 1.875e+00 1.468e+04 -0.395 0.6930
## BLOCK7:CONDITION1:PHASE90 4.505e-01 1.872e+00 1.468e+04 0.241 0.8098
## BLOCK8:CONDITION1:PHASE90 1.805e+00 1.874e+00 1.468e+04 0.963 0.3353
## BLOCK9:CONDITION1:PHASE90 -3.284e+00 1.875e+00 1.468e+04 -1.751 0.0799
## BLOCK10:CONDITION1:PHASE90 -1.025e+00 1.874e+00 1.468e+04 -0.547 0.5843
## BLOCK2:CONDITION1:PHASE100 7.838e-02 1.874e+00 1.468e+04 0.042 0.9666
## BLOCK3:CONDITION1:PHASE100 4.338e-01 1.874e+00 1.468e+04 0.232 0.8169
## BLOCK4:CONDITION1:PHASE100 -5.928e-01 1.871e+00 1.468e+04 -0.317 0.7513
## BLOCK5:CONDITION1:PHASE100 1.054e+00 1.871e+00 1.468e+04 0.563 0.5732
## BLOCK6:CONDITION1:PHASE100 -4.283e-01 1.872e+00 1.468e+04 -0.229 0.8191
## BLOCK7:CONDITION1:PHASE100 8.162e-01 1.872e+00 1.468e+04 0.436 0.6629
## BLOCK8:CONDITION1:PHASE100 9.946e-01 1.869e+00 1.468e+04 0.532 0.5946
## BLOCK9:CONDITION1:PHASE100 -2.180e+00 1.874e+00 1.468e+04 -1.164 0.2446
## BLOCK10:CONDITION1:PHASE100 -4.094e-01 1.869e+00 1.468e+04 -0.219 0.8266
##
## (Intercept) ***
## BLOCK2
## BLOCK3
## BLOCK4
## BLOCK5
## BLOCK6
## BLOCK7
## BLOCK8
## BLOCK9
## BLOCK10
## CONDITION1
## PHASE20
## PHASE30
## PHASE40
## PHASE50
## PHASE60
## PHASE70
## PHASE80
## PHASE90
## PHASE100
## BLOCK2:CONDITION1
## BLOCK3:CONDITION1
## BLOCK4:CONDITION1
## BLOCK5:CONDITION1
## BLOCK6:CONDITION1
## BLOCK7:CONDITION1
## BLOCK8:CONDITION1
## BLOCK9:CONDITION1
## BLOCK10:CONDITION1
## BLOCK2:PHASE20
## BLOCK3:PHASE20
## BLOCK4:PHASE20
## BLOCK5:PHASE20
## BLOCK6:PHASE20
## BLOCK7:PHASE20
## BLOCK8:PHASE20
## BLOCK9:PHASE20
## BLOCK10:PHASE20
## BLOCK2:PHASE30
## BLOCK3:PHASE30
## BLOCK4:PHASE30
## BLOCK5:PHASE30
## BLOCK6:PHASE30
## BLOCK7:PHASE30
## BLOCK8:PHASE30
## BLOCK9:PHASE30
## BLOCK10:PHASE30
## BLOCK2:PHASE40
## BLOCK3:PHASE40
## BLOCK4:PHASE40
## BLOCK5:PHASE40
## BLOCK6:PHASE40
## BLOCK7:PHASE40
## BLOCK8:PHASE40
## BLOCK9:PHASE40
## BLOCK10:PHASE40
## BLOCK2:PHASE50
## BLOCK3:PHASE50
## BLOCK4:PHASE50
## BLOCK5:PHASE50
## BLOCK6:PHASE50
## BLOCK7:PHASE50
## BLOCK8:PHASE50
## BLOCK9:PHASE50
## BLOCK10:PHASE50
## BLOCK2:PHASE60
## BLOCK3:PHASE60
## BLOCK4:PHASE60
## BLOCK5:PHASE60
## BLOCK6:PHASE60
## BLOCK7:PHASE60
## BLOCK8:PHASE60
## BLOCK9:PHASE60
## BLOCK10:PHASE60
## BLOCK2:PHASE70
## BLOCK3:PHASE70
## BLOCK4:PHASE70
## BLOCK5:PHASE70
## BLOCK6:PHASE70
## BLOCK7:PHASE70
## BLOCK8:PHASE70
## BLOCK9:PHASE70
## BLOCK10:PHASE70
## BLOCK2:PHASE80
## BLOCK3:PHASE80
## BLOCK4:PHASE80
## BLOCK5:PHASE80
## BLOCK6:PHASE80
## BLOCK7:PHASE80
## BLOCK8:PHASE80
## BLOCK9:PHASE80
## BLOCK10:PHASE80
## BLOCK2:PHASE90
## BLOCK3:PHASE90
## BLOCK4:PHASE90
## BLOCK5:PHASE90
## BLOCK6:PHASE90
## BLOCK7:PHASE90
## BLOCK8:PHASE90
## BLOCK9:PHASE90
## BLOCK10:PHASE90
## BLOCK2:PHASE100
## BLOCK3:PHASE100
## BLOCK4:PHASE100
## BLOCK5:PHASE100
## BLOCK6:PHASE100
## BLOCK7:PHASE100
## BLOCK8:PHASE100
## BLOCK9:PHASE100
## BLOCK10:PHASE100
## CONDITION1:PHASE20
## CONDITION1:PHASE30
## CONDITION1:PHASE40
## CONDITION1:PHASE50
## CONDITION1:PHASE60
## CONDITION1:PHASE70
## CONDITION1:PHASE80
## CONDITION1:PHASE90
## CONDITION1:PHASE100
## BLOCK2:CONDITION1:PHASE20
## BLOCK3:CONDITION1:PHASE20
## BLOCK4:CONDITION1:PHASE20
## BLOCK5:CONDITION1:PHASE20
## BLOCK6:CONDITION1:PHASE20
## BLOCK7:CONDITION1:PHASE20
## BLOCK8:CONDITION1:PHASE20
## BLOCK9:CONDITION1:PHASE20 .
## BLOCK10:CONDITION1:PHASE20
## BLOCK2:CONDITION1:PHASE30
## BLOCK3:CONDITION1:PHASE30
## BLOCK4:CONDITION1:PHASE30
## BLOCK5:CONDITION1:PHASE30
## BLOCK6:CONDITION1:PHASE30
## BLOCK7:CONDITION1:PHASE30
## BLOCK8:CONDITION1:PHASE30
## BLOCK9:CONDITION1:PHASE30 .
## BLOCK10:CONDITION1:PHASE30
## BLOCK2:CONDITION1:PHASE40
## BLOCK3:CONDITION1:PHASE40
## BLOCK4:CONDITION1:PHASE40
## BLOCK5:CONDITION1:PHASE40
## BLOCK6:CONDITION1:PHASE40
## BLOCK7:CONDITION1:PHASE40
## BLOCK8:CONDITION1:PHASE40
## BLOCK9:CONDITION1:PHASE40 .
## BLOCK10:CONDITION1:PHASE40
## BLOCK2:CONDITION1:PHASE50
## BLOCK3:CONDITION1:PHASE50
## BLOCK4:CONDITION1:PHASE50
## BLOCK5:CONDITION1:PHASE50
## BLOCK6:CONDITION1:PHASE50
## BLOCK7:CONDITION1:PHASE50
## BLOCK8:CONDITION1:PHASE50
## BLOCK9:CONDITION1:PHASE50
## BLOCK10:CONDITION1:PHASE50
## BLOCK2:CONDITION1:PHASE60
## BLOCK3:CONDITION1:PHASE60
## BLOCK4:CONDITION1:PHASE60
## BLOCK5:CONDITION1:PHASE60
## BLOCK6:CONDITION1:PHASE60
## BLOCK7:CONDITION1:PHASE60
## BLOCK8:CONDITION1:PHASE60
## BLOCK9:CONDITION1:PHASE60
## BLOCK10:CONDITION1:PHASE60
## BLOCK2:CONDITION1:PHASE70
## BLOCK3:CONDITION1:PHASE70
## BLOCK4:CONDITION1:PHASE70
## BLOCK5:CONDITION1:PHASE70
## BLOCK6:CONDITION1:PHASE70
## BLOCK7:CONDITION1:PHASE70
## BLOCK8:CONDITION1:PHASE70
## BLOCK9:CONDITION1:PHASE70
## BLOCK10:CONDITION1:PHASE70
## BLOCK2:CONDITION1:PHASE80
## BLOCK3:CONDITION1:PHASE80
## BLOCK4:CONDITION1:PHASE80
## BLOCK5:CONDITION1:PHASE80
## BLOCK6:CONDITION1:PHASE80
## BLOCK7:CONDITION1:PHASE80
## BLOCK8:CONDITION1:PHASE80
## BLOCK9:CONDITION1:PHASE80
## BLOCK10:CONDITION1:PHASE80
## BLOCK2:CONDITION1:PHASE90
## BLOCK3:CONDITION1:PHASE90
## BLOCK4:CONDITION1:PHASE90
## BLOCK5:CONDITION1:PHASE90
## BLOCK6:CONDITION1:PHASE90
## BLOCK7:CONDITION1:PHASE90
## BLOCK8:CONDITION1:PHASE90
## BLOCK9:CONDITION1:PHASE90 .
## BLOCK10:CONDITION1:PHASE90
## BLOCK2:CONDITION1:PHASE100
## BLOCK3:CONDITION1:PHASE100
## BLOCK4:CONDITION1:PHASE100
## BLOCK5:CONDITION1:PHASE100
## BLOCK6:CONDITION1:PHASE100
## BLOCK7:CONDITION1:PHASE100
## BLOCK8:CONDITION1:PHASE100
## BLOCK9:CONDITION1:PHASE100
## BLOCK10:CONDITION1:PHASE100
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation matrix not shown by default, as p = 200 > 12.
## Use print(x, correlation=TRUE) or
## vcov(x) if you need it
ae.m.coact.flex<-allEffects(m.coact.flex)
ae.m.coact.flex.df<-as.data.frame(ae.m.coact.flex[[1]])
plot(ae.m.coact.flex)
#Coactivation
m.coact.flex.blk <- lmer(COACT.FLEX ~ BLOCK * CONDITION + (1|PARTICIPANT), data = EMG)
anova(m.coact.flex.blk)
## Type III Analysis of Variance Table with Satterthwaite's method
## Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
## BLOCK 396.50 44.056 9 14855.8 1.3582 0.2011
## CONDITION 10.01 10.011 1 26.3 0.3086 0.5832
## BLOCK:CONDITION 315.66 35.074 9 14855.8 1.0813 0.3727
summary(m.coact.flex.blk)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: COACT.FLEX ~ BLOCK * CONDITION + (1 | PARTICIPANT)
## Data: EMG
##
## REML criterion at convergence: 94174.9
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -17.349 -0.023 0.010 0.052 44.374
##
## Random effects:
## Groups Name Variance Std.Dev.
## PARTICIPANT (Intercept) 0.03484 0.1866
## Residual 32.43593 5.6953
## Number of obs: 14905, groups: PARTICIPANT, 30
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 9.868e+01 2.153e-01 1.192e+03 458.433 <2e-16 ***
## BLOCK2 1.027e-02 2.968e-01 1.486e+04 0.035 0.972
## BLOCK3 7.440e-03 2.962e-01 1.486e+04 0.025 0.980
## BLOCK4 3.883e-02 2.958e-01 1.486e+04 0.131 0.896
## BLOCK5 3.122e-02 2.954e-01 1.486e+04 0.106 0.916
## BLOCK6 5.262e-02 2.956e-01 1.486e+04 0.178 0.859
## BLOCK7 2.431e-02 2.957e-01 1.486e+04 0.082 0.934
## BLOCK8 1.870e-02 2.958e-01 1.486e+04 0.063 0.950
## BLOCK9 -2.194e-01 2.957e-01 1.486e+04 -0.742 0.458
## BLOCK10 3.183e-02 2.957e-01 1.486e+04 0.108 0.914
## CONDITION1 1.060e-01 3.035e-01 1.180e+03 0.349 0.727
## BLOCK2:CONDITION1 -3.434e-01 4.182e-01 1.486e+04 -0.821 0.412
## BLOCK3:CONDITION1 -4.907e-01 4.181e-01 1.486e+04 -1.174 0.241
## BLOCK4:CONDITION1 -4.464e-02 4.179e-01 1.486e+04 -0.107 0.915
## BLOCK5:CONDITION1 -2.030e-01 4.174e-01 1.486e+04 -0.486 0.627
## BLOCK6:CONDITION1 -1.676e-01 4.175e-01 1.486e+04 -0.401 0.688
## BLOCK7:CONDITION1 -2.824e-01 4.178e-01 1.486e+04 -0.676 0.499
## BLOCK8:CONDITION1 -5.822e-01 4.177e-01 1.486e+04 -1.394 0.163
## BLOCK9:CONDITION1 -1.113e-01 4.176e-01 1.486e+04 -0.267 0.790
## BLOCK10:CONDITION1 5.236e-01 4.174e-01 1.486e+04 1.255 0.210
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation matrix not shown by default, as p = 20 > 12.
## Use print(x, correlation=TRUE) or
## vcov(x) if you need it
ae.m.coact.flex.blk<-allEffects(m.coact.flex.blk)
ae.m.coact.flex.blk.df<-as.data.frame(ae.m.coact.flex.blk[[1]])
plot(ae.m.coact.flex.blk)
ggplot(EMG, aes(x = INTERVALS , y = COACT.FLEX, color = CONDITION)) +
geom_line(size=0.5) +
facet_grid(CONDITION ~ ., scales = "free_y") +
labs(x = "Block", y = "Coactivation", color = "CONDITION") +
ggtitle("Coactivation by Block/Trial and Condition") +
geom_vline(xintercept = seq(0, max(EMG$INTERVALS), by = 5),
linetype = "dotted") +
scale_color_manual(name = "Condition",
labels = c("Cold", "Warm"),
values = c("#56B4E9", "orange")) +
scale_y_continuous(limits = c(70, 130)) +
scale_x_continuous(breaks = seq(0, max(EMG$INTERVALS), by = 5),
labels = c("0","1", "2", "3", "4", "5", "6", "7", "8", "9", "10"))
ggplot(EMG, aes(x = BLOCK, y = COACT.FLEX, color = CONDITION)) +
geom_point(size=1) +
facet_grid(CONDITION ~ ., scales = "free_y") +
labs(x = "Block", y = "Coactivation", color = "CONDITION") +
ggtitle("Scatterplot of Coactivation by Block and Condition") +
scale_color_manual(name = "Condition",
labels = c("Cold", "Warm"),
values = c("#56B4E9", "orange")) +
scale_y_continuous(limits = c(70, 130))
## Warning: Removed 174 rows containing missing values (`geom_point()`).
ggplot(EMG, aes(x = PHASE , y = COACT.FLEX, color = CONDITION)) +
geom_point(size=1) +
facet_grid(CONDITION ~ ., scales = "free_y") +
labs(x = "Paase", y = "Coactivation", color = "CONDITION") +
ggtitle("Scatterplot of Coactivation by Phase and Condition") +
scale_color_manual(name = "Condition",
labels = c("Cold", "Warm"),
values = c("#56B4E9", "orange")) +
scale_y_continuous(limits = c(70, 130))
## Warning: Removed 174 rows containing missing values (`geom_point()`).
glmer(TIME ~ BLOCK * CONDITION + (1 | PARTICIPANT), data = Behav, family = gaussian(link = "log"))
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv, :
## Model failed to converge with max|grad| = 0.00244372 (tol = 0.002, component 1)
## Generalized linear mixed model fit by maximum likelihood (Laplace
## Approximation) [glmerMod]
## Family: gaussian ( log )
## Formula: TIME ~ BLOCK * CONDITION + (1 | PARTICIPANT)
## Data: Behav
## AIC BIC logLik deviance df.resid
## 3566.273 3647.756 -1761.137 3522.273 278
## Random effects:
## Groups Name Std.Dev.
## PARTICIPANT (Intercept) 22.38
## Residual 46.18
## Number of obs: 300, groups: PARTICIPANT, 30
## Fixed Effects:
## (Intercept) BLOCK2 BLOCK3 BLOCK4
## 5.51861 -0.18872 -0.22554 -0.25900
## BLOCK5 BLOCK6 BLOCK7 BLOCK8
## -0.29032 -0.19368 -0.39851 -0.43212
## BLOCK9 BLOCK10 CONDITION2 BLOCK2:CONDITION2
## -0.58145 -0.64762 -0.04869 0.08169
## BLOCK3:CONDITION2 BLOCK4:CONDITION2 BLOCK5:CONDITION2 BLOCK6:CONDITION2
## 0.10648 0.09559 0.02500 -0.13579
## BLOCK7:CONDITION2 BLOCK8:CONDITION2 BLOCK9:CONDITION2 BLOCK10:CONDITION2
## -0.03972 0.05257 0.22681 0.18657
## optimizer (Nelder_Mead) convergence code: 0 (OK) ; 0 optimizer warnings; 1 lme4 warnings
i tried this but it does not work, R made me install new packages that do not work and are not recognised
#brm(ERROR ~ BLOCK * CONDITION + (1 | PARTICIPANT), family = negbinomial(link = "log"), data = Behav)
#model.try<- brm(ERROR ~ 1 + CONDITION + TIME, family = poisson(), data = Behav)
#coef(model.try, mean.func = exp)
Behav$BLOCK <- factor(Behav$BLOCK)
Behav$CONDITION <- factor(Behav$CONDITION)
# Calculate the mean time per condition for each block
mean_time_per_block <- Behav %>%
group_by(BLOCK, CONDITION) %>%
summarize(mean_time = mean(TIME))
## `summarise()` has grouped output by 'BLOCK'. You can override using the
## `.groups` argument.
# Plot the learning curve with mean time per condition for each block
ggplot(mean_time_per_block, aes(x = BLOCK, y = mean_time, color = CONDITION)) +
geom_line() +
geom_point() +
labs(x = "Block", y = "Mean Time", title = "Learning Curve by Block and Condition") +
scale_color_manual(values = c("#56B4E9", "orange"), name = "Condition", labels = c("Cold", "Ideal"))
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
mean_error_per_block <- Behav %>%
group_by(BLOCK, CONDITION) %>%
summarize(mean_error = mean(ERROR))
## `summarise()` has grouped output by 'BLOCK'. You can override using the
## `.groups` argument.
# Plot the learning curve with mean error per condition for each block
ggplot(mean_error_per_block, aes(x = BLOCK, y = mean_error, color = CONDITION)) +
geom_line() +
geom_point() +
labs(x = "Block", y = "Mean Error", title = "Learning Curve by Block and Condition") +
scale_color_manual(values = c("#56B4E9", "orange"), name = "Condition", labels = c("Cold", "Ideal"))
## `geom_line()`: Each group consists of only one observation.
## ℹ Do you need to adjust the group aesthetic?
plot_data <- Behav %>%
group_by(BLOCK, CONDITION) %>%
summarize(mean_time = mean(TIME), mean_error = mean(ERROR))
## `summarise()` has grouped output by 'BLOCK'. You can override using the
## `.groups` argument.
ggplot(plot_data, aes(x = mean_time, y = mean_error, color = CONDITION)) +
geom_point() +
labs(x = "Mean Time", y = "Mean Error", title = "Learning Curve by Block and Condition") +
scale_color_manual(values = c("#56B4E9", "orange"), name = "Condition", labels = c("Cold", "Ideal")) +
facet_wrap(~BLOCK, ncol = 5)