-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path02_GAMM.R
More file actions
53 lines (43 loc) · 2.24 KB
/
Copy path02_GAMM.R
File metadata and controls
53 lines (43 loc) · 2.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# GAMM data:
require(itsadug)
options(show.signif.stars=FALSE)
load("gammDat.rda")
summary(gamm1 <- bam(LogRT ~
VerbInConstruction +
te(PC.Learning, VerbPositionScaled, by=VerbInConstruction) +
s(TrialScaled, Participant, bs='fs', m=1),
data=gammDat))
# Parametric coefficients:
# Estimate Std. Error t value Pr(>|t|)
# (Intercept) -0.316380 0.058555 -5.403 8.82e-08
# VerbInConstructionMiddle -0.029765 0.027337 -1.089 0.277
# VerbInConstructionLate -0.005668 0.020182 -0.281 0.779
#
# Approximate significance of smooth terms:
# edf Ref.df F p-value
# te(PC.Learning,VerbPositionScaled):VerbInConstructionEarly 3.995 4.629 8.337 4.02e-07
# te(PC.Learning,VerbPositionScaled):VerbInConstructionMiddle 4.339 5.113 1.797 0.10511
# te(PC.Learning,VerbPositionScaled):VerbInConstructionLate 3.808 4.380 4.261 0.00135
# s(TrialScaled,Participant) 35.264 340.000 5.117 < 2e-16
# R-sq.(adj) = 0.697 Deviance explained = 71.6%
# fREML = 47.09 Scale est. = 0.053303 n = 794
summary(gamm1.trimmed <- bam(LogRT ~
VerbInConstruction +
te(PC.Learning, VerbPositionScaled, by=VerbInConstruction) +
s(TrialScaled, Participant, bs='fs', m=1),
data=gammDat,
subset=abs(scale(resid(gamm1)))<2.5))
# Parametric coefficients:
# Estimate Std. Error t value Pr(>|t|)
# (Intercept) -0.33354 0.05852 -5.699 1.76e-08
# VerbInConstructionMiddle -0.02495 0.02428 -1.028 0.305
# VerbInConstructionLate -0.01747 0.01659 -1.053 0.293
#
# Approximate significance of smooth terms:
# edf Ref.df F p-value
# te(PC.Learning,VerbPositionScaled):VerbInConstructionEarly 4.733 5.984 4.750 9.58e-05
# te(PC.Learning,VerbPositionScaled):VerbInConstructionMiddle 4.945 5.796 2.001 0.07116
# te(PC.Learning,VerbPositionScaled):VerbInConstructionLate 4.383 5.174 3.278 0.00596
# s(TrialScaled,Participant) 35.500 340.000 7.795 < 2e-16
# R-sq.(adj) = 0.781 Deviance explained = 79.6%
# fREML = -103.5 Scale est. = 0.034906 n = 769