I am trying to model behaviour data using the mgcv
package. I am using a beta distribution because the data ranges between $[0,1]$. Here is the GAM output:
Family: Beta regression(4.134)
Link function: logit
Formula:
FA ~ s(contrastGroupForTable, bs = "cs", by = experimentalGroupForTable,
k = 2) + s(animalGroupForTable, bs = "re") + experimentalGroupForTable +
rigGroupForTable + sexGroupForTable
Parametric coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -0.6834 0.3655 -1.870 0.0615 .
experimentalGroupForTableeYFP 0.5792 0.3659 1.583 0.1135
rigGroupForTableRigB(Right) 0.8689 0.3659 2.375 0.0176 *
sexGroupForTableMale 0.4624 0.3659 1.264 0.2063
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Approximate significance of smooth terms:
edf Ref.df Chi.sq p-value
s(contrastGroupForTable):experimentalGroupForTableCasp3 1.991 2 1888 <2e-16 ***
s(contrastGroupForTable):experimentalGroupForTableeYFP 1.993 2 2000 <2e-16 ***
s(animalGroupForTable) 19.669 20 1401 <2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
R-sq.(adj) = 0.765 Deviance explained = 81%
-REML = -1694.5 Scale est. = 1 n = 1681
I believe that I am fitting two splines, one for each experimentalGroupForTable
, smoothing across contrastGroupForTable
. I also have a random effect s(animalGroupForTable, bs = "re")
and a couple of fixed effects.
The question I wanted to answer was: does the two GAM models fitted for each experimentalGroupForTable
significantly differ from each other for predicting the value of FA
? My interpretation now is since the $p$-value for experimentalGroupForTableeYFP
is $> 0.05$, at this confidence interval, that my null hypothesis would be rejected. Rather, it looks like rigGroupForTable
as a fixed effect has a significant effect to the model fit of the GAM.