setwd("C:/Users/Owner/desktop")
library(lme4)
## Warning: パッケージ 'lme4' はバージョン 4.1.1 の R の下で造られました
## 要求されたパッケージ Matrix をロード中です
You can also embed plots, for example:
library(lmerTest)
## Warning: パッケージ 'lmerTest' はバージョン 4.1.1 の R の下で造られました
##
## 次のパッケージを付け加えます: 'lmerTest'
## 以下のオブジェクトは 'package:lme4' からマスクされています:
##
## lmer
## 以下のオブジェクトは 'package:stats' からマスクされています:
##
## step
data=read.delim("1103.txt", header=TRUE)
lmerTest.limit = 10000
fit_RT = lmer(RT ~ condition + (1|participant) + (1|item), data = data, control=lmerControl(optimizer="bobyqa",optCtrl=list(maxfun=100000)))
summary(fit_RT)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: RT ~ condition + (1 | participant) + (1 | item)
## Data: data
## Control: lmerControl(optimizer = "bobyqa", optCtrl = list(maxfun = 1e+05))
##
## REML criterion at convergence: 18610.9
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -2.7254 -0.5564 -0.1710 0.3009 6.6038
##
## Random effects:
## Groups Name Variance Std.Dev.
## item (Intercept) 27553 166.0
## participant (Intercept) 111490 333.9
## Residual 185637 430.9
## Number of obs: 1235, groups: item, 48; participant, 29
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 1106.14 82.26 58.89 13.446 <2e-16 ***
## conditionB 118.73 76.28 42.59 1.556 0.1270
## conditionC 67.38 76.44 42.89 0.881 0.3830
## conditionD 255.37 76.22 42.39 3.350 0.0017 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) cndtnB cndtnC
## conditionB -0.466
## conditionC -0.465 0.501
## conditionD -0.466 0.503 0.501
library(ggplot2)
## Warning: パッケージ 'ggplot2' はバージョン 4.1.1 の R の下で造られました
ggplot(data=read.delim("1103.txt",header=TRUE),aes(x=condition,y=RT,fill=condition),show.legend=FALSE)+geom_boxplot()+stat_summary(fun=mean,geom="point",size=4,fill="white",pch=21)+ xlab("condition")+ ylab("RT")
fit_front = lmer(front ~ condition + (1|participant) + (1|item), data = data, control=lmerControl(optimizer="bobyqa",optCtrl=list(maxfun=100000)))
summary(fit_front)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: front ~ condition + (1 | participant) + (1 | item)
## Data: data
## Control: lmerControl(optimizer = "bobyqa", optCtrl = list(maxfun = 1e+05))
##
## REML criterion at convergence: 314.1
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -2.8337 -0.5649 -0.1414 0.3456 6.2439
##
## Random effects:
## Groups Name Variance Std.Dev.
## item (Intercept) 0.01705 0.1306
## participant (Intercept) 0.03534 0.1880
## Residual 0.06410 0.2532
## Number of obs: 1235, groups: item, 48; participant, 29
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 0.52725 0.05344 67.72927 9.866 9.87e-15 ***
## conditionB 0.09732 0.05715 43.19691 1.703 0.0958 .
## conditionC 0.05320 0.05723 43.40527 0.930 0.3577
## conditionD 0.12583 0.05713 43.09980 2.203 0.0330 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) cndtnB cndtnC
## conditionB -0.536
## conditionC -0.535 0.501
## conditionD -0.536 0.502 0.501
library(ggplot2)
ggplot(data=read.delim("1103.txt",header=TRUE),aes(x=condition,y=front,fill=condition),show.legend=FALSE)+geom_boxplot()+stat_summary(fun=mean,geom="point",size=4,fill="white",pch=21)+ xlab("condition")+ ylab("AOI front")
fit_back = lmer(front ~ condition + (1|participant) + (1|item), data = data, control=lmerControl(optimizer="bobyqa",optCtrl=list(maxfun=100000)))
summary(fit_back)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: front ~ condition + (1 | participant) + (1 | item)
## Data: data
## Control: lmerControl(optimizer = "bobyqa", optCtrl = list(maxfun = 1e+05))
##
## REML criterion at convergence: 314.1
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -2.8337 -0.5649 -0.1414 0.3456 6.2439
##
## Random effects:
## Groups Name Variance Std.Dev.
## item (Intercept) 0.01705 0.1306
## participant (Intercept) 0.03534 0.1880
## Residual 0.06410 0.2532
## Number of obs: 1235, groups: item, 48; participant, 29
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 0.52725 0.05344 67.72927 9.866 9.87e-15 ***
## conditionB 0.09732 0.05715 43.19691 1.703 0.0958 .
## conditionC 0.05320 0.05723 43.40527 0.930 0.3577
## conditionD 0.12583 0.05713 43.09980 2.203 0.0330 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) cndtnB cndtnC
## conditionB -0.536
## conditionC -0.535 0.501
## conditionD -0.536 0.502 0.501
ggplot(data=read.delim("1103.txt",header=TRUE),aes(x=condition,y=back,fill=condition),show.legend=FALSE)+geom_boxplot()+stat_summary(fun=mean,geom="point",size=4,fill="white",pch=21)+ xlab("condition")+ ylab("AOI back")
fit_sacade = lmer(front ~ condition + (1|participant) + (1|item), data = data, control=lmerControl(optimizer="bobyqa",optCtrl=list(maxfun=100000)))
summary(fit_back)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: front ~ condition + (1 | participant) + (1 | item)
## Data: data
## Control: lmerControl(optimizer = "bobyqa", optCtrl = list(maxfun = 1e+05))
##
## REML criterion at convergence: 314.1
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -2.8337 -0.5649 -0.1414 0.3456 6.2439
##
## Random effects:
## Groups Name Variance Std.Dev.
## item (Intercept) 0.01705 0.1306
## participant (Intercept) 0.03534 0.1880
## Residual 0.06410 0.2532
## Number of obs: 1235, groups: item, 48; participant, 29
##
## Fixed effects:
## Estimate Std. Error df t value Pr(>|t|)
## (Intercept) 0.52725 0.05344 67.72927 9.866 9.87e-15 ***
## conditionB 0.09732 0.05715 43.19691 1.703 0.0958 .
## conditionC 0.05320 0.05723 43.40527 0.930 0.3577
## conditionD 0.12583 0.05713 43.09980 2.203 0.0330 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) cndtnB cndtnC
## conditionB -0.536
## conditionC -0.535 0.501
## conditionD -0.536 0.502 0.501
ggplot(data=read.delim("1103.txt",header=TRUE),aes(x=condition,y=sacade,fill=condition),show.legend=FALSE)+geom_boxplot()+stat_summary(fun=mean,geom="point",size=4,fill="white",pch=21)+ xlab("condition")+ ylab("sacade")