Marine Regis
2016-Nov-16 20:43 UTC
[R] GAMs: test of simple effects following a significant interaction
Hello, I am a novice in Generalized Additive Models (GAMs) and I would need some advice on these models. From capture data, I would like to assess the effect of longitudinal changes in proportion of forests on abundance of skunks. To test this, I built this GAM where the dependent variable is the number of unique skunks and the independent variables are the X coordinates of the centroids of trapping sites (called "X" in the GAM) and the proportion of forests within the trapping sites (called "prop_forest" in the GAM): mod <- gam(nb_unique ~ s(x,prop_forest), offset=log_trap_eff, family=nb(theta=NULL, link="log"), data=succ_capt_skunk, method = "REML", select = TRUE) summary(mod) Family: Negative Binomial(13.446) Link function: log Formula: nb_unique ~ s(x, prop_forest) Parametric coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) -2.02095 0.03896 -51.87 <2e-16 *** --- 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(x,prop_forest) 3.182 29 17.76 0.000102 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 R-sq.(adj) = 0.37 Deviance explained = 49% -REML = 268.61 Scale est. = 1 n = 58 Should I include the simple effects of independent variables "X" and "prop_forest" into the GAM when the interaction is significant? I ask this question because the longitude and latitude are often included as an interaction term in a GAM (i.e., s(X,Y)) without the simple effects (however, I tested for the simple effects and they were not significant in my case). Is it correct to include the interaction between X and proportion of forests when my objective is to test longitudinal changes in proportion of forests? Thanks a lot for your time. Have a nice day. Marine [[alternative HTML version deleted]]