I'm trying to compare proportions of male (M) beetles from two groups - one 'general' site with high rainfall (R) and one 'general' site without it (A).
I'm using museum records, so the span across countries. So, I could lump groups over the whole country (e.g. specimens in Sydney are grouped with specimens from Michigan) but that seems incorrect because they don't share other similar features.
Thus, there are 'specific' groups (subgroups) - R1 (all high rainfall from sydney) with a proportion of 0.2; R2 (all high rainfall from Melbourne) with a proportion of 0.3 etc. Such that the data looks like:
Site ; M ; n
R1 ; 0.2 ; 10
R2 ; 0.3 ; 12
R3 ; 0.5 ; 7
A1 ; 0 ; 8
A2 ; 0.3 ; 20
A3 ; 0.7 ; 12
I hope that makes sense!
I guess my question is - is there a way to now group these proportions, taking account the number of individuals in each group (n) and compare A with R.
I've looked at doing a glm (see code below)- but I have issues with the multiple subgroups - and I can't seem to wrap my head around what to do/how to get around binomial.
glm(PM~Site, data=Data, family=binomial, weights=n)