R
codefamily="binomial"
R
: plogis(x)
mgcv
version 1.9.3, itsadug
version 2.4.1)Parametric coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -0.247 0.0033 -75.1 <2e-16 ***
Approximate significance of smooth terms:
edf Ref.df Chi.sq p-value
s(Lon,Lat) 28.2 29 1591 <2e-16 ***
te()
, which can model an \(N\)-way non-linear interaction:te(Lon, Lat, ConceptFreq, d=c(2,1))
te(Lon, Lat, ConceptFreq, YearBirth, d=c(2,1,1))
system.time(
m <- bam(NotStd ~ te(Lon, Lat, ConceptFreq.log.z, SpeakerBirthYear.z, d=c(2,1,1)) +
CommunitySize.log.z + SpeakerJob_Farmer + SpeakerEduLevel.log.z + SpeakerIsMale +
s(Speaker,bs="re") + s(Location,bs="re") + s(Concept,bs="re") +
s(Concept,CommunityRecordingYear.z,bs="re") + s(Concept,CommunitySize.log.z,bs="re") +
s(Concept,CommunityAvgIncome.log.z,bs="re") + s(Concept,CommunityAvgAge.log.z,bs="re") +
s(Concept,SpeakerJob_Farmer,bs="re") + s(Concept,SpeakerJob_Executive_AuxiliaryWorker,bs="re") +
s(Concept,SpeakerEduLevel.log.z,bs="re") + s(Concept,SpeakerIsMale,bs="re"),
data=tuscan, family="binomial", discrete=T, nthreads=2)
)
user system elapsed
632.4 12.2 361.3
Parametric coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -0.4249 0.1265 -3.36 0.000781 ***
CommunitySize.log.z -0.0641 0.0223 -2.87 0.004 **
SpeakerJob_Farmer 0.0447 0.0168 2.66 0.008 **
SpeakerEduLevel.log.z -0.0669 0.0126 -5.32 1.06e-07 ***
SpeakerIsMale 0.0378 0.0128 2.95 0.003 **
Approximate significance of smooth terms:
edf Ref.df Chi.sq p-value
te(SpeakerBirthYear.z,ConceptFreq.log.z,Lon,Lat) 224 268 3289 <2e-16 ***
# chance for a male farmer in a
# very small village (z-scored
# population size = -2) for which
# the location is unknown with a
# very low education level
# (z-score = -2) to use a
# non-standard lexical form
(logit <- coef(m)["(Intercept)"] +
coef(m)["SpeakerIsMale"] +
coef(m)["SpeakerJob_Farmer"] +
-2 * coef(m)["CommunitySize.log.z"] +
-2 * coef(m)["SpeakerEduLevel.log.z"])
(Intercept)
-0.0803
(Intercept)
0.48
user system elapsed
1759.9 17.7 1808.4
edf Ref.df Chi.sq p-value
s(Speaker) 83.2 2005 89.5 2.25e-02
s(Location) 175.2 209 5314.3 0.00e+00
s(Concept) 166.9 168 437444.8 0.00e+00
s(CommunityRecordingYear.z,Concept) 158.9 170 156924.5 0.00e+00
s(CommunitySize.log.z,Concept) 149.9 169 30138.8 0.00e+00
s(CommunityAvgIncome.log.z,Concept) 158.1 170 143131.3 0.00e+00
s(CommunityAvgAge.log.z,Concept) 154.4 170 110864.3 0.00e+00
s(SpeakerJob_Farmer,Concept) 86.0 169 26203.2 6.46e-07
s(SpeakerJob_Executive_AuxiliaryWorker,Concept) 53.3 170 3315.0 7.56e-04
s(SpeakerEduLevel.log.z,Concept) 139.1 169 9347.8 0.00e+00
s(SpeakerIsMale,Concept) 85.5 169 111596.1 0.00e+00
s()
to model two-dimensional interactions on the same scalete()
family="binomial"
)Thank you for your attention!
https://www.martijnwieling.nl
m.b.wieling@rug.nl