I'm trying to investigate if the proportion of muzzle contact(mc) in primates tends to be directed more towards the mother than other group members (Adults or Juveniles). I have data over 5 years in 4 different groups. This is an exemple for 3 different initiators (those initiating the mc):
age1data
| initiator | receiver | count | total_init | prop_mc | subgroupsize | group |
|---|---|---|---|---|---|---|
| Aaa | Mother | 1 | 3 | 0.333 | 1 | 1 |
| Aaa | Adult | 2 | 3 | 0.666 | 40 | 1 |
| Aaa | Juvenile | 0 | 3 | 0 | 20 | 1 |
| Hee | Mother | 0 | 2 | 0 | 1 | 1 |
| Hee | Adult | 0 | 2 | 0 | 40 | 1 |
| Hee | Juvenile | 2 | 2 | 1 | 20 | 1 |
| Awa | Mother | 2 | 10 | 0.2 | 1 | 2 |
| Awa | Adult | 3 | 10 | 0.3 | 7 | 2 |
| Awa | Juvenile | 5 | 10 | 0.5 | 13 | 2 |
count: number of mc directed to an individual belonging to each receiver subgroups total_init: total number of mc by this individual subgroupsize: number of individuals within the group that belong to the receiver subgroup (for exemple, each individual has 1 mother but the group1 has 40 adults (other than the mother) and 20 juveniles
This is the model I tried:
glmm_ages <- glmer(((count_init/total_init)/subgroupsize)~receiver + (1|group) + (1|initiator),
data = age1data,
family = binomial)
This gives me this error message:
Error in pwrssUpdate(pp, resp, tol = tolPwrss, GQmat = GQmat, compDev = compDev, :
Downdated VtV is not positive definite
In addition: Warning message:
In eval(family$initialize, rho) : non-integer #successes in a binomial glm!
The model works when I do a simple GLM without group and initiator as random variables but I really think I need to include them.
From what I understand, the error message means that some categories are all 1 or all 0, which is the case when an individual is only recorded muzzle contacting its mother once, for exemple (dependent variable becomes 1/1/1 = 1).
I'm trying to understand what I should do from this thread I found http://bbolker.github.io/mixedmodels-misc/ecostats_chap.html#digression-complete-separation In this section, I'm not sure how to find the number I should be putting instead of "10"?
newdat <- subset(age1data,
abs(resid(glmm_ages,"pearson"))<10)
I'm also not sure what all this means and how can I figure out what is my own variance and standard deviation in my dataset:
impose zero-mean Normal priors on the fixed effects (a 4 × 4 diagonal matrix with diagonal elements equal to 9, for variances of 9 or standard deviations of 3)
Can anyone help me figure out if I'm doing the right thing and this is the solution for me?
I apologize for the length of this post, I wanted to make sure everything was there, hope it's clear!