+ Reply to Thread
Results 1 to 7 of 7

Thread: GLMM - fitting random effects to a complex field design

  1. #1
    Points: 19, Level: 1
    Level completed: 37%, Points required for next Level: 31

    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts

    GLMM - fitting random effects to a complex field design




    Dear forum users,

    Id be very grateful to hear about any opinions on a problem Im having with the random effects side of my generalised linear mixed effects model. Im trying to model the abundance of certain insects caught using pan traps, with explanatory variables that describe the landscape and land management practices. The general aim of the project is to find out which land use factors are most important to these groups of insects at the landscape scale.

    The sampling design is rather complicated, and I want to fit a model that best takes this into account. The data were collected over 2 summers (April to Sept), and in each year insects were caught during 3 sampling rounds. However, I have 96 field sites clustered in 6 regions of the UK which made it impossible to sample the sites simultaneously within rounds, because certain weather criteria had to be met on trapping days and the sites were very far apart. Therefore, the 6 sampling occasions varied quite widely from site to site within the rounds, although time intervals between sampling occasions were similar.

    So, I know I should include Region as a random intercept effect because of the spatial clustering of sites and the fact that I would like to generalise my results to the whole country. Im thinking that I should also incorporate some kind of time aspect year and/or round number. I get the best AIC if I use the following (random effects in brackets, Im using R with the glmmADMB package):

    y ~ x1 + x2 +x3 +(1|Region) + (1|Round)

    where Round is a factor with values 1 -6 (1-3 being the 3 rounds in year 1, and 4-6 the 3 rounds in year 2). But Im wary of selecting the best model based solely on something like AIC Id like to also make sure that such a model makes sense. Also, I dont think this configuration takes into account the different dates on which the sites were sampled, and Im not sure how to do that.

    Its likely also that the weather played a part in the insect catches, given that the sites ranged the full length of the country. However, Im not interested per se in the effect of weather on insects, and as such variables like temperature and rainfall are nuisance variables. I read somewhere that this would make them random effects is this correct, and if so, how best to incorporate them? Again, my best attempt is this:
    y ~ x1 + x2 +x3 +(Dday|Region) + (1|Round)

    where Dday is the number of cumulative degree days between 1st April (an arbitrary date chosen as the start of the flight season) and the day the pan traps were collected. This model has a much better AIC than that above. Is this a reasonable configuration though? I guess this accounts in some way for the effect of sampling on different days, but Im concerned that as Dday also accounts for round and region effects to a certain extent Im in danger of over-parameterising my model.

    Id be extremely grateful for any input.

    Best regards
    Mark

  2. #2
    Cookie Scientist
    Points: 13,431, Level: 75
    Level completed: 46%, Points required for next Level: 219
    Jake's Avatar
    Location
    Austin, TX
    Posts
    1,293
    Thanks
    66
    Thanked 584 Times in 438 Posts

    Re: GLMM - fitting random effects to a complex field design

    Why do you have random effects for Regions but not Sites?

    Also, I think the way your model incorporates "Rounds" is not quite right. Rounds are nested in Sites (which are nested in Regions), right? But the way you have the variable coded currently, going from 1 to 6 (i.e., only 6 unique values of Round), your model assume that Rounds are crossed with Regions/Sites, so that the random effect of each numbered Round is constrained to be the same in every Region/Site. You want to specify a nested model, not a crossed model.

    I would not agree that if you don't care about the effect of a variable then that means it should go into the random effects part of the model. Very rarely does it make sense to have a predictor have a random component but no fixed component. I don't think the way "Dday" is included here makes sense.

    Do your predictors vary across regions (but constant across sites), or do they vary across sites (but constant across rounds)? Are there any that vary from round to round?

    Finally, do you have only a single observation for each unique Round (i.e., 6 rows in the data.frame per Site), or are there multiple rows per Round per Site? If it is the former then you cannot estimate random effects for Rounds in a nested model, because the Round variance is confounded with the residual variance. But you can in the latter case where you have multiple observations per Round.

    Here is what I would try:

    If you have only a single observation per Round:
    y ~ x1 + x2 + x3 + Dday + season + (1|region/site)

    If you have multiple observations per Round:
    y ~ x1 + x2 + x3 + Dday + season + (1|region/site/round)

    where "season" is a 2-level fixed factor indicating the summer in which the samples were collected.

    Note that these models only includes random intercepts and not any random slopes. Depending on how exactly the predictors vary (between regions or between sites, etc.), it is also technically possible to estimate various random slopes, but with only 6 Regions and overall a not-so-large dataset, you're going to have a pretty hard time computationally estimating all the random slopes. I would start with one of the models above and then maybe try a few specification that include random slopes. It would be most important to include random slopes for the x1-x3 predictors (the ones you care most about studying), it's not as important to have random season or Dday slopes.
    In God we trust. All others must bring data.
    ~W. Edwards Deming

  3. The Following User Says Thank You to Jake For This Useful Post:

    Mark Kusk (08-02-2014)

  4. #3
    Points: 19, Level: 1
    Level completed: 37%, Points required for next Level: 31

    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: GLMM - fitting random effects to a complex field design

    Hi Jake,

    Thanks so much for replying so quickly. I have had model versions with site nested within Region, but rejected it on the basis of AIC for the model including Round. It didn't sit right with me though, hence my concern.

    Your explanations make a lot of sense, and I'm glad to have that "nuisance" variable matter cleared up. Most of my predictors vary across sites, but are constant between rounds, but some such as the amount of floral resource available vary across rounds too.

    I only have single observations per site for each round, so I will use the first configuration as you suggest.

    One further question though - do you think there is a way to account for the fact that observations within rounds were collected on different days? Should Dday account for that, or should I perhaps include Julian Day of trapping as a predictor?

    Thanks very much again - you've stopped me from going round in circles!

    Mark

  5. #4
    Cookie Scientist
    Points: 13,431, Level: 75
    Level completed: 46%, Points required for next Level: 219
    Jake's Avatar
    Location
    Austin, TX
    Posts
    1,293
    Thanks
    66
    Thanked 584 Times in 438 Posts

    Re: GLMM - fitting random effects to a complex field design

    Quote Originally Posted by Mark Kusk View Post
    One further question though - do you think there is a way to account for the fact that observations within rounds were collected on different days? Should Dday account for that, or should I perhaps include Julian Day of trapping as a predictor?
    Well, adding Julian day would only account for a linear time effect, and it's not obvious to me that that will do much (but you probably have better intuitions about this than I do). Actually it seems to me that because of the way Dday is constructed, it is mostly a linear time predictor already. Really it's some kind of weird amalgam of time and temperature. So anyway one possibility could be to remove Dday, compute Julian day for the days in both seasons and multiply the second season by 2 (so that it indexes continuous time across both seasons), and add a smooth term for Julian day in the model using the gamm4 package, which would look something like:
    Code: 
    mod <- gamm4(y ~ x1 + x2 + x3 + s(Jday), random=~(1|region/site))
    summary(mod$mer)
    summary(mod$gam)
    plot(mod$gam)
    In God we trust. All others must bring data.
    ~W. Edwards Deming

  6. The Following User Says Thank You to Jake For This Useful Post:

    Mark Kusk (08-02-2014)

  7. #5
    Points: 19, Level: 1
    Level completed: 37%, Points required for next Level: 31

    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: GLMM - fitting random effects to a complex field design

    Thanks again Jake,

    Since my last post I've been playing around and trying your suggestions. I'm getting good, sensible and interpretable results with some nice validation plots so I'm happy and feel more confident in the model construction. I've been using gamm from the mgcv package, and have a significant smoother for Dday. I did try playing around with Julian days, but nothing is as good as Dday.

    Thanks again, much appreciated indeed.

  8. #6
    Cookie Scientist
    Points: 13,431, Level: 75
    Level completed: 46%, Points required for next Level: 219
    Jake's Avatar
    Location
    Austin, TX
    Posts
    1,293
    Thanks
    66
    Thanked 584 Times in 438 Posts

    Re: GLMM - fitting random effects to a complex field design

    My feeling is that estimating the effects of time and temperature separately would be cleaner than the Dday approach that combines the two variables in what seems to me a rather ad hoc fashion, but I'm sure you have a better idea than me what makes the most sense given the nature of your data and the norms in your field.
    In God we trust. All others must bring data.
    ~W. Edwards Deming

  9. #7
    Points: 19, Level: 1
    Level completed: 37%, Points required for next Level: 31

    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: GLMM - fitting random effects to a complex field design


    OK, I have other response variables to model next so I'll try it with those. I have used degree days before in repeated measures ANOVA but in an Arctic climate change context - its used mainly in such fields where differences in degree days are more vital to species survival and reproduction. In the UK, its perhaps less relevant so I'll consider it carefully and run it by some colleagues too.

    Best wishes
    Mark

+ Reply to Thread

           




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts






Advertise on Talk Stats