I am trying to model the visitation frequency of bird to a plant species along an elevational gradient and two season. Moreover I have the number of flowers each observed plant had. My response variable was calculated as follows Frequency= number of visits/(observed time * number of flowers). This, variable it is not normally distributed and plus it has an inflation of zeros (see histogram). To normalize the variable I log-tranformed it and a small constant to avoid getting "inf" values for the zeros. before the transformation and after exploring the dataset with a boxplot, I realised that the relationship between frequency and elevation might not be linear picking at the middle elevation. Thus, I thought of using the General Additive Mixed Effect Models (GAMM). For this purpose I am using the R package mgcv and the function gamm(). My model looks like this:

gam_elevation_all_plants|t|) (Intercept) -7.68425 0.32117 -23.926 < 2e-16 *** flowers 0.07511 0.01624 4.625 6.17e-06 *** seasonWet-dry 1.49145 0.42153 3.538 0.000485 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Approximate significance of smooth terms: edf Ref.df F p-value s(elevation) 3.373 3.373 40.08 %

ggplot(aes(x=elevation, y=log_frequency_f)) +

geom_point(alpha=.3) +

geom_ribbon(data=pred_elevation, alpha=.4, aes(ymin=fit-CI, ymax=fit+CI), show.legend = F, fill='forestgreen') +

geom_line(data=pred_elevation, aes(y=fit), show.legend = F, color='forestgreen') +

theme_classic()

; whereas this the one used to back transformed the estimates:

ggplot(hypericum_all_plants, aes(x = elevation, y = frequency_f) ) +

geom_point() +

geom_smooth(aes(y = exp(predict.gam(gam_elevation_all_plants$gam))), size = 1)

Am I misunderstanding something? is it okay if I report my results with the log_tranformed variable. Also I would to understand which distribution sould I used for my model. Also Can someone help out to interprete the model summary? Basically which of the summaries should I use to plot my estimations the ones of GAM or Lme?

Can someone help me out?

Thank you

More Guillermo Uceda Gómez's questions See All
Similar questions and discussions