Skip to content

Using multiple species data for gam

2 messages · Greg Guerin, Rajendra Mohan panda

#
Hello,

not sure if you are looking to run the GLM/GAMs individually but in one
run, or as a community composition type model to test main
drivers/correlates of combined species occurrences. If the latter, another
option is a GLMM with species having random slope to allow responses to
differ. For this, you would need to stack the occurrence matrix into a
?long? format (a row for the presence/absence of each species in each plot
with corresponding predictor variables and a field for species).

Response Species Temp Pptn

0	Sp1	30	1000
1	Sp2	30	1000
1	Sp3	30	1000

In lme4, something like:
lmer(Response ~ Temp + Pptn + (1 + Temp + Pptn|Species),
family=binomial(link="logit"), data)

An example with R code in the Appendix:
http://dx.doi.org/10.1111/jvs.12111

Greg

--
Dr Greg Guerin
Postdoctoral Fellow
School of Biological Sciences, Faculty of Science
The University of Adelaide

CRICOS Provider Number 00123M
-----------------------------------------------------------
IMPORTANT: This message may contain confidential or legally privileged
information. If you think it was sent to
you by mistake, please delete all copies and advise the sender. For the
purposes
of the SPAM Act 2003, this
email is authorised by The University of Adelaide.
4 days later
#
Dear Dr Greg Guerin

Lot many thanks for the advise. I have tried the code (not with 1000sp)
successfully but I find some warning messages which I need some help
regarding the same. Mentioned here for your kind advise:

 glmer(Response ~ Temp + Pptn + Moisture+Soil+Slope+Aspect+Altitude+(1 +
Temp + Pptn+
Moisture+Soil+Slope+Aspect+Altitude|Species),family=binomial(link="logit"),
data = SP)
Generalized linear mixed model fit by maximum likelihood (Laplace
Approximation) ['glmerMod']
 Family: binomial  ( logit )
Formula: Response ~ Temp + Pptn + Moisture + Soil + Slope + Aspect +
Altitude +
    (1 + Temp + Pptn + Moisture + Soil + Slope + Aspect + Altitude |
   Species)
   Data: SP
      AIC       BIC    logLik  deviance  df.resid
 470.1219  748.2537 -191.0610  382.1219      4066
Random effects:
 Groups  Name        Std.Dev. Corr
 Species (Intercept) 1.19992
         Temp        0.77083   0.27
         Pptn        0.07742  -0.91 -0.64
         Moisture    0.30603  -0.50 -0.91  0.79
         Soil        1.17142  -0.44 -0.93  0.75  0.99
         Slope       0.67329  -0.39 -0.53  0.56  0.32  0.31
         Aspect      0.21153  -0.90 -0.65  1.00  0.82  0.78  0.50
         Altitude    0.24942  -0.92 -0.63  1.00  0.78  0.74  0.55  1.00
Number of obs: 4110, groups:  Species, 5
Fixed Effects:
(Intercept)         Temp         Pptn     Moisture         Soil
 Slope       Aspect     Altitude
 -8.8215831    0.3879856    0.0002847   -0.0816050   -0.1431987
-0.6200528    0.0116070   -0.0003179
Warning messages:
1: Some predictor variables are on very different scales: consider
rescaling
2: In commonArgs(par, fn, control, environment()) :
  maxfun < 10 * length(par)^2 is not recommended.
3: In (function (fn, par, lower = rep.int(-Inf, n), upper = rep.int(Inf,  :
  failure to converge in 10000 evaluations
4: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
  Model failed to converge with max|grad| = 37.0466 (tol = 0.001, component
1)
5: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
  Model failed to converge: degenerate  Hessian with 7 negative eigenvalues

When I run nlmer, I find the following error message for which I also need
some help also because my data are mostly non-linear.

Your guidance will be highly appreciated



With Best Regards
Rajendra M Panda
SWR, IIT Kharagpur, India

On Thu, Feb 12, 2015 at 5:08 AM, Greg Guerin <greg.guerin at adelaide.edu.au>
wrote: