The behavioral evidence of processing congruences and incongruences between Self- and Other-perspective-related representations during both perspective judgments.
The 1 match
- [1] § Methods › Statistical analysis ↔ yk2d9/R code for Congruency Beh analysis to share.R, lines 24–64 · score 0.55 · emmeans, lmerTest, lme4, marginal, model, Satterthwaite
Paper
Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
R · 892 lines · 25 KB · no license · 1 match
- ## Cong/Incong Beh analysis from (iEEG VPT exp)
- library(lme4) # usd in Multilevel MOdeling Center (Bristol) tutorial. gives the same results as nlme but this is more versatile for complicated nestings
- library(readxl)
- library(nlme) # used in Field's book
- library(car)
- library(tidyverse)
- library(rstatix)
- library(emmeans)
- library(ggpubr)
- library(ggplot2)
- library(lmerTest)
- library(dplyr)
- library(scales)
- library(simr)
- # for copying results
- write.excel <- function(res.aov,row.names=FALSE,col.names=TRUE,...) {
- write.table(res.aov,"clipboard",sep="\t",row.names=row.names,col.names=col.names,...)
- }
- # 19.08.25
- ## LMM for left/right Congruence effect on Accuracy
- dat <- read_excel("datapath")
- rintercept <- lmer(Accuracy ~ Congruence*Perspective + (1|ParticipantID), data = dat, REML = FALSE) # this by default gives treatment contrast with a reference level with alphabetical oder, i.e., SPJ in Perspective and Cong in Congruence
- summary(rintercept) # therefore the estimates are Perspective effect in Cong and Congruence effect in SPJ
- # When overal effect over all levels of another factor is needed marginal means averaged over all lvels of another factor is obtained by lsmeans function from emmeans
- # or default treatment coding can be manually adjusted to sum to zero coding before running the lmer
- # using this > dat$Congruence <- factor(dat$Congruence, levels = c("Cong", "Incong")); dat$Perspective <- factor(dat$Perspective, levels = c("SPJ", "VPT")); contrasts(dat$Congruence) <- cbind(Congruence = c(-0.5, 0.5)) in this paper about contrasts in detail Schad et al., 2020 but this sum to zero coding may not be optimal for ublanaced data (e.g. if some levels of a factor has more datapoints)
- #contrasts(dat$Perspective) <- cbind(Perspective = c(-0.5, 0.5))
- # contrasts(dat$Congruence)
- #contrasts(dat$Perspective)
- rslope <- lmer(Accuracy ~ Congruence*Perspective + (1+Congruence|ParticipantID), data = dat, REML = FALSE)
- summary(rslope)
- # comparing the models
- anova (rintercept,rslope)
- # Comparing marginal means of Congruence averaged over both levels of Perspective
- lsmeans(rslope, pairwise~Congruence, lmer.df = "satterthwaite", lmerTest.limit = 5777)
- # Comparing marginal means of Perspective averaged over both levels of Congruence
- lsmeans(rslope, pairwise~Perspective, lmer.df = "satterthwaite", lmerTest.limit = 5777)
- ## Plot by default plots with SEM- standard error of the mean
- bxp <- ggerrorplot(
- dat, x = "Perspective", y = "Accuracy", size = 1.3,
- color = "Congruence", palette = c("#0072B2", "#E69FBB")
- )
- bxp
- #
- bxp <- ggerrorplot(
- dat, x = "Perspective", y = "Accuracy", size = 1.3,
- color = "Congruence", palette = c("#0072B2", "#E69FBB"),
- facet.by = "Angle"
- )
- bxp
- # plot with VPT and SPJ with different shapes, Angle x axis, Congruence different colors
- library(ggplot2)
- library(dplyr)
- # Ensure your data is clean
- dat <- dat %>%
- filter(!is.na(Accuracy)) %>%
- mutate(
- Perspective = factor(Perspective, levels = c("SPJ", "VPT")),
- Congruence = factor(Congruence, levels = c("Cong", "Incong")),
- Angle = factor(Angle, levels = sort(unique(Angle)))
- )
- pd <- position_dodge(width = 0.6)
- ggplot(dat, aes(x = Angle, y = Accuracy*100, color = Congruence, shape = Perspective)) +
- stat_summary(
- fun = mean,
- geom = "point",
- size = 4,
- position = pd,
- na.rm = TRUE
- ) +
- stat_summary(
- fun.data = mean_se, # SEM
- geom = "errorbar",
- width = 0, # straight lines
- size = 1.2,
- position = pd,
- na.rm = TRUE
- ) +
- scale_color_manual(values = c("Cong" = "#0072B2", "Incong" = "#E69FBB")) +
- scale_shape_manual(values = c("SPJ" = 16, "VPT" = 17)) +
- labs(x = "Angle (°)", y = "Accuracy (%)", shape = "Perspective") +
- theme_classic(base_size = 14) +
- theme(
- axis.text.x = element_text(size = 14, angle = 0, hjust = 0.5, color = "black"),
- axis.text.y = element_text(size = 14, color = "black"),
- axis.title.x = element_text(size = 16, face = "bold", color = "black"),
- axis.title.y = element_text(size = 16, face = "bold", color = "black"),
- axis.line = element_line(size = 1.2, color = "black"), # thicker axes
- legend.title = element_text(size = 14),
- legend.text = element_text(size = 13),
- legend.position = "right"
- )
- ## the same as above only connecting lines between datpoints are added
- library(ggplot2)
- library(dplyr)
- # Ensure your data is clean
- dat <- dat %>%
- filter(!is.na(Accuracy)) %>%
- mutate(
- Perspective = factor(Perspective, levels = c("SPJ", "VPT")),
- Congruence = factor(Congruence, levels = c("Cong", "Incong")),
- Angle = factor(Angle, levels = sort(unique(Angle)))
- )
- pd <- position_dodge(width = 0.6)
- ggplot(dat, aes(x = Angle,
- y = Accuracy*100,
- color = Congruence,
- shape = Perspective,
- group = interaction(Congruence, Perspective))) +
- stat_summary(
- fun = mean,
- geom = "line",
- size = 1.2, # same thickness as axis lines
- position = pd,
- na.rm = TRUE
- ) +
- stat_summary(
- fun = mean,
- geom = "point",
- size = 4,
- position = pd,
- na.rm = TRUE
- ) +
- stat_summary(
- fun.data = mean_se,
- geom = "errorbar",
- width = 0,
- size = 1.2,
- position = pd,
- na.rm = TRUE
- ) +
- scale_color_manual(values = c("Cong" = "#0072B2", "Incong" = "#E69FBB")) +
- scale_shape_manual(values = c("SPJ" = 16, "VPT" = 17)) +
- labs(x = "Angle (°)", y = "Accuracy (%)", shape = "Perspective") +
- theme_classic(base_size = 14) +
- theme(
- axis.text.x = element_text(size = 14, angle = 0, hjust = 0.5, color = "black"),
- axis.text.y = element_text(size = 14, color = "black"),
- axis.title.x = element_text(size = 16, face = "bold", color = "black"),
- axis.title.y = element_text(size = 16, face = "bold", color = "black"),
- axis.line = element_line(size = 1.2, color = "black"),
- legend.title = element_text(size = 14),
- legend.text = element_text(size = 13),
- legend.position = "right"
- )
- ## compute means and SE
- means <- dat %>%
- group_by(Perspective, Congruence) %>%
- get_summary_stats(Accuracy, type = "mean_se")
- print(means)
- write.excel(means)
- ## compute means and SE
- means <- dat %>%
- group_by(Perspective, Angle, Congruence) %>%
- get_summary_stats(Accuracy, type = "mean_se")
- print(means)
- write.excel(means)
- ## LMM for left/right Congruence effect on RT
- dat <- read_excel("datapath")
- rintercept <- lmer(RT ~ Congruence*Perspective + (1|ParticipantID), data = dat, REML = FALSE)
- summary(rintercept)
- rslope <- lmer(RT ~ Congruence*Perspective + (1+Congruence|ParticipantID), data = dat, REML = FALSE)
- summary(rslope)
- # comparing the models
- anova (rintercept,rslope)
- # comparing estimated marginal means of Congruence averaged over both levels of Perspective
- lsmeans(rintercept, pairwise~Congruence, lmer.df = "satterthwaite", lmerTest.limit = 5685) # for RT on all responses incl 180 and 0 deg
- # comparing estimated marginal means of Congruence averaged over both levels of Perspective
- lsmeans(rintercept, pairwise~Perspective, lmer.df = "satterthwaite", lmerTest.limit = 5685)
- # posthoc
- lsmeans(rintercept, pairwise~Congruence|Perspective, adjust="tukey", lmer.df = "satterthwaite", lmerTest.limit = 5685) # for RT on all responses incl 180 and 0 deg
- ## Plot by default plots with SEM- standard error of the mean
- bxp <- ggerrorplot(
- dat, x = "Perspective", y = "RT", size = 1.3,
- color = "Congruence", palette = c("#0072B2", "#E69FBB")
- )
- bxp
- #
- bxp <- ggerrorplot(
- dat, x = "Perspective", y = "RT", size = 1.3,
- color = "Congruence", palette = c("#0072B2", "#E69FBB"),
- facet.by = "Angle"
- )
- bxp
- # plot with VPT and SPJ with different shapes, Angle x axis, Congruence different colors
- library(ggplot2)
- library(dplyr)
- # Ensure your data is clean
- dat <- dat %>%
- filter(!is.na(RT)) %>%
- mutate(
- Perspective = factor(Perspective, levels = c("SPJ", "VPT")),
- Congruence = factor(Congruence, levels = c("Cong", "Incong")),
- Angle = factor(Angle, levels = sort(unique(Angle)))
- )
- pd <- position_dodge(width = 0.6)
- ggplot(dat, aes(x = Angle, y = RT, color = Congruence, shape = Perspective)) +
- stat_summary(
- fun = mean,
- geom = "point",
- size = 4,
- position = pd,
- na.rm = TRUE
- ) +
- stat_summary(
- fun.data = mean_se, # SEM
- geom = "errorbar",
- width = 0, # straight lines
- size = 1.2,
- position = pd,
- na.rm = TRUE
- ) +
- scale_color_manual(values = c("Cong" = "#0072B2", "Incong" = "#E69FBB")) +
- scale_shape_manual(values = c("SPJ" = 16, "VPT" = 17)) +
- labs(x = "Angle (°)", y = "RT (s)", shape = "Perspective") +
- theme_classic(base_size = 14) +
- theme(
- axis.text.x = element_text(size = 14, angle = 0, hjust = 0.5, color = "black"),
- axis.text.y = element_text(size = 14, color = "black"),
- axis.title.x = element_text(size = 16, face = "bold", color = "black"),
- axis.title.y = element_text(size = 16, face = "bold", color = "black"),
- axis.line = element_line(size = 1.2, color = "black"), # thicker axes
- legend.title = element_text(size = 14),
- legend.text = element_text(size = 13),
- legend.position = "right"
- )
- ## same as above just with added lines to connedct thed datapoints
- library(ggplot2)
- library(dplyr)
- # Ensure your data is clean
- dat <- dat %>%
- filter(!is.na(RT)) %>%
- mutate(
- Perspective = factor(Perspective, levels = c("SPJ", "VPT")),
- Congruence = factor(Congruence, levels = c("Cong", "Incong")),
- Angle = factor(Angle, levels = sort(unique(Angle)))
- )
- pd <- position_dodge(width = 0.6)
- ggplot(dat, aes(x = Angle,
- y = RT,
- color = Congruence,
- shape = Perspective,
- group = interaction(Congruence, Perspective))) +
- stat_summary(
- fun = mean,
- geom = "line",
- size = 1.2, # same thickness as axis lines
- position = pd,
- na.rm = TRUE
- ) +
- stat_summary(
- fun = mean,
- geom = "point",
- size = 4,
- position = pd,
- na.rm = TRUE
- ) +
- stat_summary(
- fun.data = mean_se,
- geom = "errorbar",
- width = 0,
- size = 1.2,
- position = pd,
- na.rm = TRUE
- ) +
- scale_color_manual(values = c("Cong" = "#0072B2", "Incong" = "#E69FBB")) +
- scale_shape_manual(values = c("SPJ" = 16, "VPT" = 17)) +
- labs(x = "Angle (°)", y = "RT(S)", shape = "Perspective") +
- theme_classic(base_size = 14) +
- theme(
- axis.text.x = element_text(size = 14, angle = 0, hjust = 0.5, color = "black"),
- axis.text.y = element_text(size = 14, color = "black"),
- axis.title.x = element_text(size = 16, face = "bold", color = "black"),
- axis.title.y = element_text(size = 16, face = "bold", color = "black"),
- axis.line = element_line(size = 1.2, color = "black"),
- legend.title = element_text(size = 14),
- legend.text = element_text(size = 13),
- legend.position = "right"
- )
- ## same as above the RT plot with lines but the line is cut for Cong at 180 deg
- library(ggplot2)
- library(dplyr)
- # Ensure your data is clean
- dat <- dat %>%
- filter(!is.na(RT)) %>%
- mutate(
- Perspective = factor(Perspective, levels = c("SPJ", "VPT")),
- Congruence = factor(Congruence, levels = c("Cong", "Incong")),
- Angle = factor(Angle, levels = sort(unique(Angle)))
- )
- pd <- position_dodge(width = 0.6)
- ggplot(dat, aes(x = Angle,
- y = RT,
- color = Congruence,
- shape = Perspective,
- group = interaction(Congruence, Perspective))) +
- stat_summary(
- aes(y = RT), # ??? breaks Cong line at 180
- fun = mean,
- geom = "line",
- size = 1.2,
- position = pd,
- na.rm = TRUE
- ) +
- stat_summary(
- fun = mean,
- geom = "point",
- size = 4,
- position = pd,
- na.rm = TRUE
- ) +
- stat_summary(
- fun.data = mean_se,
- geom = "errorbar",
- width = 0,
- size = 1.2,
- position = pd,
- na.rm = TRUE
- ) +
- scale_color_manual(values = c("Cong" = "#0072B2", "Incong" = "#E69FBB")) +
- scale_shape_manual(values = c("SPJ" = 16, "VPT" = 17)) +
- labs(x = "Angle (°)", y = "RT (S)", shape = "Perspective") +
- theme_classic(base_size = 14) +
- theme(
- axis.text.x = element_text(size = 14, angle = 0, hjust = 0.5, color = "black"),
- axis.text.y = element_text(size = 14, color = "black"),
- axis.title.x = element_text(size = 16, face = "bold", color = "black"),
- axis.title.y = element_text(size = 16, face = "bold", color = "black"),
- axis.line = element_line(size = 1.2, color = "black"),
- legend.title = element_text(size = 14),
- legend.text = element_text(size = 13),
- legend.position = "right"
- )
- ## LMM for Horizontal/Overhead View Plane effect on Accuracy
- dat <- read_excel("datapath")
- rintercept <- lmer(Accuracy ~ Perspective*View + (1|ParticipantID), data = dat, REML = FALSE)
- summary(rintercept)
- rslope <- lmer(Accuracy ~ Perspective*View + (1+View|ParticipantID), data = dat, REML = FALSE)
- summary(rslope)
- anova (rintercept, rslope)
- # comparing marginal means for the effect of Perspective averaged over both levels of View plane
- lsmeans(rslope, pairwise~Perspective, lmer.df = "satterthwaite", lmerTest.limit = 5777)
- # comparing marginal means for the effect of Perspective averaged over both levels of Perspective
- lsmeans(rslope, pairwise~View, lmer.df = "satterthwaite", lmerTest.limit = 5777)
- #Posthoc on View Plane
- lsmeans(rslope, pairwise~View|Perspective, adjust="tukey", lmer.df = "satterthwaite", lmerTest.limit = 5685) # lmerTest.limit - number may need adjustment- if R recommnds
- #Posthoc on Perspective
- lsmeans(rslope, pairwise~Perspective|View, adjust="tukey", lmer.df = "satterthwaite", lmerTest.limit = 5685) # lmerTest.limit - number may need adjustment- if R recommnds
- # Plot
- bxp <- ggerrorplot(
- dat, x = "Perspective", y = "Accuracy", size = 1.3,
- color = "View", palette = c("#E69F00", "#56B4E9")
- )
- bxp
- # Plot for each VPT target angle (is different from Degree because all 8 anglees are separatelly without clockwise- counterclockwise grouping) separatelly
- bxp <- ggerrorplot(
- dat, x = "Perspective", y = "Accuracy", size = 1.3,
- color = "View", palette = c("#E69F00", "#56B4E9"),
- facet.by = "Angle"
- )
- bxp
- ## LMM for View Plane effect on RT
- dat <- read_excel("datapath")
- rintercept <- lmer(RT ~ Perspective*View + (1|ParticipantID), data = dat, REML = FALSE)
- summary(rintercept)
- rslope <- lmer(RT ~ Perspective*View + (1+View|ParticipantID), data = dat, REML = FALSE)
- summary(rslope)
- anova (rintercept, rslope)
- # comparing marginal means for the effect of Perspective averaged over both levels of View plane
- lsmeans(rslope, pairwise~Perspective, lmer.df = "satterthwaite", lmerTest.limit = 5777)
- # comparing marginal means for the effect of Perspective averaged over both levels of Perspective
- lsmeans(rslope, pairwise~View, lmer.df = "satterthwaite", lmerTest.limit = 5777)
- # posthoc on the effect of View
- lsmeans(rslope, pairwise~View|Perspective, adjust="tukey", lmer.df = "satterthwaite", lmerTest.limit = 5685) # lmerTest.limit - number may need adjustment- if R recommnds
- # posthoc on the effect of Perspective
- lsmeans(rslope, pairwise~Perspective|View, adjust="tukey", lmer.df = "satterthwaite", lmerTest.limit = 5685) # lmerTest.limit - number may need adjustment- if R recommnds
- # Plot
- bxp <- ggerrorplot(
- dat, x = "Perspective", y = "RT", size = 1.3,
- color = "View", palette = c("#E69F00", "#56B4E9")
- )
- bxp
- # Plot for each VPT target angle (is different from Degree because all 8 anglees are separatelly without clockwise- counterclockwise grouping) separatelly
- bxp <- ggerrorplot(
- dat, x = "Perspective", y = "RT", size = 1.3,
- color = "View", palette = c("#E69F00", "#56B4E9"),
- facet.by = "Angle"
- )
- bxp
- ## LMM for Degree effect on Accuracy
- dat <- read_excel("datapath")
- rintercept <- lmer(Accuracy ~ Perspective*Degree+ (1|ParticipantID), data = dat, REML = FALSE)
- summary(rintercept)
- rslope <- lmer(Accuracy ~ Perspective*Degree + (1+View|ParticipantID), data = dat, REML = FALSE)
- summary(rslope)
- anova (rintercept, rslope)
- #Posthoc on Degree
- lsmeans(rintercept, pairwise~Degree|Perspective, adjust="tukey", lmer.df = "satterthwaite", lmerTest.limit = 5685) # lmerTest.limit - number may need adjustment- if R recommnds
- #Posthoc on Perspective
- lsmeans(rintercept, pairwise~Perspective|Degree, adjust="tukey", lmer.df = "satterthwaite", lmerTest.limit = 5685) # lmerTest.limit - number may need adjustment- if R recommnds
- # Plot
- bxp <- ggerrorplot(
- dat, x = "Perspective", y = "Accuracy", size = 1.3,
- color = "Degree", palette = c("#7A7E8A", "#009E73", "#CC79A7")
- )
- bxp
- # Plot for each VPT target angle (is different from Degree because all 8 anglees are separatelly without clockwise- counterclockwise grouping) separatelly
- bxp <- ggerrorplot(
- dat, x = "Perspective", y = "Accuracy", size = 1.3,
- color = "Degree", palette = c("#7A7E8A", "#009E73", "#CC79A7"),
- facet.by = "Congruence"
- )
- bxp
- ## LMM for Degree effect on RT
- dat <- read_excel("datapath")
- rintercept <- lmer(RT ~ Perspective*Degree + (1|ParticipantID), data = dat, REML = FALSE)
- summary(rintercept)
- rslope <- lmer(RT ~ Perspective*Degree + (1+View|ParticipantID), data = dat, REML = FALSE)
- summary(rslope)
- anova (rintercept, rslope)
- # posthoc on the effect of View
- lsmeans(rslope, pairwise~Degree|Perspective, adjust="tukey", lmer.df = "satterthwaite", lmerTest.limit = 5685) # lmerTest.limit - number may need adjustment- if R recommnds
- # posthoc on the effect of Perspective
- lsmeans(rslope, pairwise~Perspective|Degree, adjust="tukey", lmer.df = "satterthwaite", lmerTest.limit = 5685) # lmerTest.limit - number may need adjustment- if R recommnds
- # Plot
- bxp <- ggerrorplot(
- dat, x = "Perspective", y = "RT", size = 1.3,
- color = "Degree", palette = c("#7A7E8A", "#009E73", "#CC79A7")
- )
- bxp
- # Plot for each level of left/right Congruence
- bxp <- ggerrorplot(
- dat, x = "Perspective", y = "RT", size = 1.3,
- color = "Degree", palette = c("#7A7E8A", "#009E73", "#CC79A7"),
- facet.by = "Congruence"
- )
- bxp
- ###### simulation based sensitivity power analysis for lmer to justify the sample size
- library(simr)
- #### for accuracy
- ## the effect of Congruence in SPJ, Effect of Perspective in Congruent trials
- ## and Congruence Perspective interaction
- m <- lmer(
- Accuracy ~ Congruence * Perspective +
- (1 + Congruence | ParticipantID),
- data = dat,
- REML = FALSE
- )
- fixef(m)
- ### to determine with what power the analysis can detect 5% change
- fixef(m)["CongruenceIncong:PerspectiveVPT"] <- 0.05 # 0.05 depends on the unit of data, for accuracy it's 5% change
- ### test power for the interaction
- powerSim(m, test = fixed("CongruenceIncong:PerspectiveVPT", "sa"), nsim = 1000) # "sa" - satherwhite, nsim - number of simulations
- # as the results of the above code showed that
- # the 5% change in Accuracy can be detected with 92% power
- # now we test what difference can be detected with 80%, thus we decrease the effect size
- # https://thechangelab.stanford.edu/tutorials/power-analysis/post-hoc-power-sensitivity-analysis-using-the-sesoi/
- fixef(m)["CongruenceIncong:PerspectiveVPT"] <- 0.042
- powerSim(m, test = fixed("CongruenceIncong:PerspectiveVPT", "sa"), nsim = 1000)
- ### Congruence effect in SPJ
- m_acc<-fixef(m)["CongruenceIncong"] <- 0.05 # as this gives less than 80% power, below we increase the effect size
- powerSim(m, test = fixed("CongruenceIncong", "sa"), nsim = 1000)
- m_acc<-fixef(m)["CongruenceIncong"] <- 0.0551
- powerSim(m, test = fixed("CongruenceIncong", "sa"), nsim = 1000)
- ### Perspective effect in Congruent trials
- m_persp<-fixef(m)["PerspectiveVPT"] <- 0.05 # as this gives 100% power, below we decrease the effect size
- powerSim(m, test = fixed("PerspectiveVPT", "sa"), nsim = 1000)
- m_persp<-fixef(m)["PerspectiveVPT"] <- 0.03 # as this gives 100% power, below we decrease the effect size
- powerSim(m, test = fixed("PerspectiveVPT", "sa"), nsim = 1000)
- ### Congruence effect in VPT
- dat$Perspective <- factor(dat$Perspective,
- levels = c("SPJ", "VPT"))
- levels(dat$Perspective)
- dat$Perspective <- relevel(dat$Perspective, ref = "VPT") # so that reference level is VPT in the data to receive the identical results as
- # lsmeans(rslope, pairwise~Congruence, lmer.df = "satterthwaite", lmerTest.limit = 5777)
- # for VPT does and because simr can not woork with lsmeans
- # model for the reference level perspective
- m_VPTref <- lmer(
- Accuracy ~ Congruence * Perspective +
- (1 + Congruence | ParticipantID),
- data = dat,
- REML = FALSE
- )
- # with what power can the analysis detect the 4.2% change between Congruent and Incongruent conditions during VPT
- fixef(m_VPTref)["CongruenceIncong"] <- 0.055
- powerSim(m_VPTref, test = fixed("CongruenceIncong", "sa"), nsim = 1000)
- ### Perspective effect in Incongruent
- dat$Perspective <- factor(dat$Perspective,
- levels = c("SPJ", "VPT"))
- dat$Congruence <- factor(dat$Congruence,
- levels = c("Cong", "Incong"))
- levels(dat$Congruence)
- levels(dat$Perspective)
- dat$Congruence <- relevel(dat$Congruence, ref = "Incong") # changing the reference level
- m_IncongRef <- lmer(
- Accuracy ~ Congruence * Perspective +
- (1 + Congruence | ParticipantID),
- data = dat,
- REML = FALSE
- )
- fixef(m_IncongRef)["PerspectiveVPT"] <- 0.03
- powerSim(m_IncongRef, test = fixed("PerspectiveVPT", "sa"), nsim = 1000)
- ##### sensitivity power analysis for RT
- m_rt <- lmer(
- RT ~ Congruence * Perspective +
- (1 | ParticipantID),
- data = dat,
- REML = FALSE
- )
- # to determine with what power can the analysis detect 0.05 second change
- fixef(m_rt)["CongruenceIncong:PerspectiveVPT"] <- 0.05 # 0.05 depends on the unit of data, for accuracy it's 5% change
- ### test power for the interaction
- powerSim(m_rt, test = fixed("CongruenceIncong:PerspectiveVPT", "sa"), nsim = 1000) # "sa" - satherwhite, nsim - number of simulations
- # as the results of the above code showed that
- # the 0.05 second change in RTs can be detected with below 80% power
- # now we test what difference can be detected with 80%, thus we increase the effect size
- fixef(m_rt)["CongruenceIncong:PerspectiveVPT"] <- 0.0524
- powerSim(m_rt, test = fixed("CongruenceIncong:PerspectiveVPT", "sa"), nsim = 1000)
- ### Congruence effect in SPJ
- fixef(m_rt)["CongruenceIncong"] <- 0.05
- powerSim(
- m_rt,
- test = fixed("CongruenceIncong", "sa"),
- nsim = 1000
- )
- fixef(m_rt)["CongruenceIncong"] <- 0.037 # decreasing the effect size as 0.05 showed 97% power
- powerSim(
- m_rt,
- test = fixed("CongruenceIncong", "sa"),
- nsim = 1000
- )
- ### Perspective effect in Congruent trials
- fixef(m_rt)["PerspectiveVPT"] <- 0.037
- powerSim(
- m_rt,
- test = fixed("PerspectiveVPT", "sa"),
- nsim = 1000
- )
- ### Congruent in VPT
- ## relevel the model to VPT reference
- dat$Perspective <- factor(dat$Perspective,
- levels = c("SPJ", "VPT"))
- levels(dat$Perspective)
- dat_VPTref <- dat
- dat_VPTref$Perspective <- relevel(dat_VPTref$Perspective, ref = "VPT")
- m_rt_VPTref <- lmer(
- RT ~ Congruence * Perspective +
- (1 | ParticipantID),
- data = dat_VPTref,
- REML = FALSE
- )
- fixef(m_rt_VPTref)["CongruenceIncong"] <- 0.038
- powerSim(
- m_rt_VPTref,
- test = fixed("CongruenceIncong", "sa"),
- nsim = 1000
- )
- ### Perspective in Incongruent
- ## relevel the model to Incongruent reference
- dat$Perspective <- factor(dat$Perspective,
- levels = c("SPJ", "VPT"))
- dat$Congruence <- factor(dat$Congruence,
- levels = c("Cong", "Incong"))
- levels(dat$Congruence)
- levels(dat$Perspective)
- dat_IncongRef <- dat
- dat_IncongRef$Congruence <- relevel(dat_IncongRef$Congruence, ref = "Incong")
- m_rt_IncongRef <- lmer(
- RT ~ Congruence * Perspective +
- (1 | ParticipantID),
- data = dat_IncongRef,
- REML = FALSE
- )
- fixef(m_rt_IncongRef)["PerspectiveVPT"] <- 0.037
- powerSim(
- m_rt_IncongRef,
- test = fixed("PerspectiveVPT", "sa"),
- nsim = 1000
- )
- ## Sensitivity analysis to justify the sample size using t test and anova model
- # using t test
- library(pwr)
- pwr.t.test(
- n = 26, # number of participants
- sig.level = 0.05,
- power = 0.80,
- type = "paired"
- )
- ## using anova to test interaction terms
- pwr.anova.test(
- k = 4, # 2 (Congruence) × 2 (Perspective)
- n = 26,
- sig.level = 0.05,
- power = 0.80
- )
R code for Congruency Beh analysis to share.R, no license · at the source
Overview
- Institute of Physiology, The Czech Academy of Sciences,Prague, Czech Republic
- Institute of Psychology, The Czech Academy of Sciences,Prague, Czech Republic
- Third Faculty of Medicine, Charles University,Prague, Czech Republic
- Department of Neurology, Second Faculty of Medicine, Charles University, Motol University Hospital,Prague, Czech Republic
Abstract
Daily, we make visuospatial self-perspective judgments from our actual perspective (SPJ). However, social contexts often require imagining another viewpoint—visuospatial perspective-taking (VPT). VPT is costlier than SPJ, and gets even costlier in autism, schizophrenia, and aging. One explanation is interference from self-related representations. This interference may reflect a mechanism that processes various self- and other-related representations, supported by the temporoparietal junction (TPJ). Moreover, reportedly other-related representations also influence SPJ, though this remains debated. An additional explanation for VPT difficulty in literature is the mental body-schema transformation needed to adopt another perspective at greater angular disparities between perspectives. However, studies often confounded angle with left/
Supplementary Information: The online version contains supplementary material available at https://
Reproduced under the paper's license (CC BY), from the paper cited above.
Repository
Its files are read in the Code ↔ Paper reader above, with 1 match between paragraphs and lines of code.
OSF wuapg
Availability: 1 check, the latest on 27 September 2026: the link answers (HTTP 200)
- 27 September 2026: the link answers (HTTP 200)
2 files
- yk2d9/
R code for Congruency Beh analysis to share.R , R, 892 lines, 1 match - yk2d9/
Removing IEDtrials_extracting cummulativ xls.m , MATLAB, 223 lines
The paper's code and data availability statement is in the Data section.
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 2 scripts, each with its path and the digest of its content;
- 1 match between paragraphs of the paper and lines of the code (method lexical-v1);
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
No dataset and no data link were found in the paper.
Data availability
The data and code that support the findings of this study are available in the Open Science Framework at https://
Reproduced under the paper's license (CC BY), from the paper cited above.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 2, 28 September 2026
- Publisher: n/a → Springer Science+Business Media
Version 1, 27 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 4 authors, 12 MeSH terms, 4 funders, 62 references.
Cite
This paper
Gunia, A., Kalina, A., Javůrková, A., & Vlček, K. (2026). The behavioral evidence of processing congruences and incongruences between Self- and Other-perspective-relate
BibTeX
@article{gunia2026behavi
author = {Gunia, Anna and Kalina, Adam and Javůrková, Alena and Vlček, Kamil},
title = {{The behavioral evidence of processing congruences and incongruences between Self- and Other-perspective-relate
journal = {Psychological research},
year = {2026},
month = jul,
volume = {90},
number = {4},
pages = {134},
publisher = {Springer Science+Business Media},
issn = {0340-0727},
doi = {10.1007/
url = {https://
pmid = {42439946},
pmcid = {PMC13364830}
}
RIS
TY - JOUR
AU - Gunia, Anna
AU - Kalina, Adam
AU - Javůrková, Alena
AU - Vlček, Kamil
TI - The behavioral evidence of processing congruences and incongruences between Self- and Other-perspective-relate
T2 - Psychological research
J2 - Psychol Res
PY - 2026
DA - 2026/
VL - 90
IS - 4
SP - 134
SN - 0340-0727
PB - Springer Science+Business Media
DO - 10.1007/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1007/
"type": "article-journal",
"title": "The behavioral evidence of processing congruences and incongruences between Self- and Other-perspective-relate
"container-title": "Psychological research",
"author": [
{
"family": "Gunia",
"given": "Anna"
},
{
"family": "Kalina",
"given": "Adam"
},
{
"family": "Javůrková",
"given": "Alena"
},
{
"family": "Vlček",
"given": "Kamil"
}
],
"container-title-short":
"volume": "90",
"issue": "4",
"page": "134",
"DOI": "10.1007/
"PMID": "42439946",
"PMCID": "PMC13364830",
"ISSN": "0340-0727",
"publisher": "Springer Science+Business Media",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
7,
13
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.1111/psyp.70265 [code]
- Neurocognitive Dynamics of Translating Information From a Spatial Map Into Action.Journal: PsychophysiologyIn common: nlme, car, emmeans, 5 other tools, cognitive, 5 references
- [2] doi:10.1126/sciadv.aec9291 [code]
- Computational mechanisms of perception in autism revealed using games inspired by rodent operant tasks.Journal: Science advancesIn common: nlme, rstatix, car, 5 other tools, cognitive
- [3] doi:10.1016/j.neuroimage.2026.122115 [code]
- Midfrontal theta power relates to response speeding following frustrative nonreward.Journal: NeuroImageIn common: rstatix, car, emmeans, 5 other tools, cognitive
- [4] doi:10.1038/s41467-026-73865-9 [code]
- Histamine shapes the neurocomputational dynamics of human learning.Journal: Nature communicationsIn common: rstatix, car, emmeans, 5 other tools, cognitive
- [5] doi:10.1016/j.nicl.2026.104012 [code]
- Structural-functional multilayer brain network properties and outcome of combined repetitive transcranial magnetic stimulation and psychotherapy for obsessive-compulsive disorder.Journal: NeuroImage. ClinicalIn common: nlme, rstatix, car, 5 other tools
- [6] doi:10.1038/s41398-026-04010-9 [code]
- Bullying victimization and brain development: a longitudinal structural magnetic resonance imaging study from adolescence to early adulthood.Journal: Translational psychiatryIn common: nlme, rstatix, emmeans, 5 other tools
- [7] doi:10.1073/pnas.2606871123 [code]
- Oxytocin modulates the neurocomputational mechanisms engaged in learning rank relationships in social networks.Journal: Proceedings of the National Academy of Sciences of the United States of AmericaIn common: nlme, car, emmeans, 5 other tools
- [8] doi:10.1038/s41467-026-72934-3 [code]
- Multi-focal ultrasound neuromodulation to the dorsal anterior cingulate cortex disrupts behavioural and neural pain processing.Journal: Nature communicationsIn common: rstatix, car, emmeans, 5 other tools
- [9] doi:10.3390/ijms27135713 [code]
- Chronic Administration of Marinobufagenin in Mice Causes Hyperlocomotion and Decrease in Anxiety by Altering Monoamine Turnover Unaccompanied by Motor Deficits or Oxidative Stress.Journal: International journal of molecular sciencesIn common: rstatix, car, emmeans, 5 other tools
- [10] doi:10.1126/sciadv.aeb8106 [code]
- A thyroid hormone-mediated opsin switch initiates metamorphosis in a proto-vertebrate.Journal: Science advancesIn common: rstatix, car, emmeans, 5 other tools
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 2 scripts, and 1 match between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:64f6b494c16e9f9e…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[.
Discussion, reproductions, activity
Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.
Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
