0
$\begingroup$

I'm having trouble with finding the most suitable analysis for my data. I'm investigating the behaviour of wild animals in nature. More specifically, I'm looking at animals scavenging from carcasses left out in nature and whether or not the animal is a bird or mammal (no other possibilities). So I basically watched video's of all the animals and behaviours at the 34 carcasses, then filtered for only animals performing a scavenging event. Then I counted the number of birds and mammals per carcass performing such a scavenging event, so basically: is the animal a bird (YES/NO)? Because the data were taken from different national parks, I use Area as a random effect.

The idea is that I want to test the effect of overhead cover on the proportion bird/mammal. Data to reproduce:

df_prop_birds_eating <- data.frame(Birds = c(2, 111, 10, 0, 0, 1, 12, 80, 58, 21, 34, 185, 2, 19, 66, 0, 4, 15, 360, 9, 54, 253, 67, 37, 1, 0, 0, 0, 0, 78, 38, 183, 1, 0),
                                   Mammals = c(5, 154, 6, 104, 11, 34, 44, 31, 40, 4, 3, 203, 91, 33, 68, 105, 151, 50, 107, 9, 0, 0, 1, 31, 9, 29, 195, 143, 304, 496, 422, 136, 131, 64),
                                   ProportionBirdsScavenging = c(0.292016806722689, 0.421254162042175, 0.621323529411765, 0.0147058823529412, 0.0147058823529412, 0.042436974789916, 0.222689075630252, 0.71422893481717, 0.589135654261705, 0.83, 0.906597774244833, 0.477486355366889, 0.0355787476280835, 0.369343891402715, 0.492756804214223, 0.0147058823529412, 0.039753320683112, 0.23868778280543, 0.762910945962968, 0.5, 0.985294117647059, 0.985294117647059, 0.971020761245675, 0.542820069204152, 0.111764705882353, 0.0147058823529412, 0.0147058823529412, 0.0147058823529412, 0.0147058823529412, 0.146597663455626, 0.0948849104859335, 0.571501014198783, 0.0220588235294118, 0.0147058823529412),
                                   pointWeight = c(7, 265, 16, 104, 11, 35, 56, 111, 98, 25, 37, 388, 93, 52, 134, 105, 155, 65, 467, 18, 54, 253, 68, 68, 10, 29, 195, 143, 304, 574, 460, 319, 132, 64),
                                   pointWeight_scaled = c(0.0000001, 0.45502650952381, 0.0158731142857143, 0.171075920634921, 0.00705477301587302, 0.0493828111111111, 0.0864198444444444, 0.183421598412698, 0.160493911111111, 0.0317461285714286, 0.0529101476190476, 0.671957704761905, 0.15167556984127, 0.0793651714285714, 0.223985968253968, 0.172839588888889, 0.261023001587302, 0.102292858730159, 0.811287496825397, 0.0194004507936508, 0.0828925079365079, 0.43386249047619, 0.107583863492063, 0.107583863492063, 0.00529110476190476, 0.0388008015873016, 0.331569731746032, 0.239858982539683, 0.523809571428571, 1, 0.798941819047619, 0.550264595238095, 0.220458631746032, 0.10052919047619),
                                   OverheadCover = c(0.7, 0.671, 0.6795, 0.79, 0.62, 0.62, 0.6413, 0.089, 0.4603, 0.04, 0.0418, 0.46, 0.5995, 0.532, 0.65, 0.6545, 0.74, 0.74, 0.02, 0.02, 0, 0, 0, 0.45, 0.8975, 0.92, 0.89, 0.86, 0.69, 0.755, 0.775, 0.585, 0.585, 0.55),
                                   Area = c("Markiezaat", "Hamert", "Hamert", "Hamert", "Hamert", "Hamert", "Hamert", "Hamert", "Hamert", "KempenBroek", "KempenBroek", "KempenBroek", "KempenBroek", "KempenBroek", "KempenBroek", "KempenBroek", "KempenBroek", "KempenBroek", "Markiezaat", "Markiezaat", "Markiezaat", "Markiezaat", "Markiezaat", "Meinweg", "Meinweg", "Meinweg", "PlankenWambuis", "PlankenWambuis", "PlankenWambuis", "PlankenWambuis", "PlankenWambuis", "Valkenhorst", "Valkenhorst", "KempenBroek"))

Previously I used a beta distribution on the manually calculated transformed proportions (so no true 0's or 1's), with a weight argument.

myglmm <- glmmTMB(ProportionBirdsScavenging ~ OverheadCover + (1|Area), data = df_prop_birds_eating, beta_family(link = "logit"), weights = pointWeight_scaled)

However, recently I found out that I actually am using discrete count data and I created the need for weights by converting my raw data into proportions. I solved the problem by analysing the data directly, thereby avoiding any need for weights at all.

I tried the following binomial distribution, with cbind(Birds, Mammals) as response variable.

myglmmbino <- glmmTMB(cbind(Birds, Mammals) ~ OverheadCover + (1|Area), data = df_prop_birds_eating, family = binomial)

One of the assumptions of using a binomial family is that the data should be independent. It's basically whether or not the probability of a bird scavenging affects the probability of a mammal scavenging, right? I find this difficult to say. I statistically checked with a Chi Square test. Is this a valid way? Here we have to reject the null hypothesis, so does that mean that they are dependent on each other?

tbl <- cbind(df_prop_birds_eating$Birds, df_prop_birds_eating$Mammals)
chisq.test(tbl, simulate.p.value = TRUE)
# Pearson's Chi-squared test with simulated p-value (based on 2000 replicates)
#
# data:  tbl
# X-squared = 2356.7, df = NA, p-value = 0.0004998

As far as I know, the other assumptions are met -> Each trial of the experiment has two possible outcomes (Bird or Mammal) and the probability of success is the same for each trial.

My true question is whether or not I am allowed to use the binomial family here.

$\endgroup$
  • $\begingroup$ Really interesting question. I take it every carcass has scavenging animals? And you don't feel the need to model the total number of scavenging animals? $\endgroup$ – Paul Hewson Mar 2 at 10:08
  • 2
    $\begingroup$ I think you need to be a little more cautious about what you mean by independent. You want the observations to be conditionally independent, given your model. So that Chi-squared test on the top level data won't help. You think that the proportion of birds is conditional on the overhead cover and the area? What other non-independence do you think you might have missed? $\endgroup$ – Paul Hewson Mar 2 at 10:10
  • $\begingroup$ Yes, every carcass has scavenging animals. And no, I don't feel the need to model the total number of scavenging animals, I'm only interested in the proportion bird / not bird. You are absolutely right: doing a Chi-squared test on the top level data won't give me what I'm looking for, since it is conditional on OverheadCover and Area. I don't have any other variables in my dataset which I expect the proportion of birds is conditional on. Is there a way of testing for independence which controls for the effect of OverheadCover and Area? $\endgroup$ – Peter Mar 2 at 13:49
1
$\begingroup$

If you are sure that at each event you did not count the same bird or mammal twice or more, then I think your approach using the binomial family is correct. From my point of view, you measure the proportion of birds (compared to non-birds) coming to a carcass. Each carcass seems to be independent of each other and your main predictor (OverheadCover) varies between carcass events. So I would consider that you can safely use the binomial distribution in your case. For me, the correct syntax to specify the model is the one with cbind() and no weights.

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ Thanks for your reply. My data consists of cameratrap video's. Whenever an animal arrives, it starts recording for 60s. If an animal performs a scavenging event, it gets noted ("Bird"/"Mammal"). It can, however, happen (and is definitely the case sometimes) that one individual animal stays scavenging for several minutes, therefore resulting in several scavenging events in a row from one individual. However, I'm sure that, as you state, at each event (i.e., video) I did not count the same bird or mammal twice or more. Just counted several events per individual. Does this change your answer? $\endgroup$ – Peter Mar 2 at 14:08
  • 1
    $\begingroup$ Ecologically, I expect your data to be non-independent. If, for example, a big mammal is at the carcass, no small bird will come near it. Hence the probability of observing birds at the carcarss is dependent on whether you observe big mammals there. Does that matter for your question? If you want to know, what the proportion of birds at a carcass is, and nothing more, it does not matter why they are there (or not), only to which proportion. So to me the independence strongly rests on which hypothesis exactly you want to test. $\endgroup$ – Carsten Mar 2 at 15:34
  • $\begingroup$ Interesting. For this study I hypothesise that the probability of a carcass being scavenged by birds is influenced by overhead cover. Since, most bird scavengers are visual predators, I expect overhead cover to be affecting this proportion. So basically, I'm only interested in the measured proportion of birds in relation with the overhead cover. I don't have data to test for the interspecific competition which is probably going on at the carcasses. This study is purely observational and I won't be able to say anything about causation -- only the fact that the results support the hypothesis. $\endgroup$ – Peter Mar 2 at 16:15
  • $\begingroup$ Also, if there was a lot of interspecific competition going on (the presence of one group scares away the other), one would expect the model to be overdispersed. But, this is not the case. $\endgroup$ – Peter Mar 2 at 16:21
  • 1
    $\begingroup$ @Peter, I did not fully understand. If you counted several events per individual at the same carcass (but on different videos), you may fall in the trap of non-independence. If such is the case, I would rerun the analysis after keeping only one event maximum per individual for each carcass. Ecologically, for me, it is not so clear that there is always competition between different species of scavengers: I have already seen several species of birds and mammals scavenging at the same time the same carcass. For this aspect, you will have to use your domain knowledge to justify your approach. $\endgroup$ – KrisAnathema Mar 2 at 19:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.