# GLM of proportions with offset

I am fitting a glm with a binomial family to consider the relationship between the proportion of trials in which courtship of a female type $A$ occurs (successes) and male genotype (a two level factor).

model  <- glm(cbind(successes, failures) ~ genotype, family = binomial)


The experiment actually includes two types of female ($A$ and $B$) and I want to account for the amount of courtship activity (i.e. courtships of female types $A$ OR $B$) as this will obviously influence the proportion of trials in which courtship of $A$ occurs. For clarification, during each trial, a male can court no female, female type A, female type B, or both. I was wondering if the correct way to do this was using an offset, i.e.:

model  <- glm(cbind(success, failure) ~ genotype + offset(num_trials_with_act), family = binomial)


or perhaps:

model  <- glm(cbind(success, failure) ~ genotype + offset(log(num_trials_with_act)), family = binomial)


Would this be correct? Or would it be better just to include the proportion of trails with activity as a further explanatory variable:

model  <- glm(cbind(success, failure) ~ genotype + prop_trials_with_act, family = binomial)


I could model the trails with courtship towards $A$ as a proportion of only trials with courtship towards $A$ or $B$, but I feel I will lose information.

• Would it not be simpler to include a factor which distinguishes between type A and type B females? If I have completely misunderstood your question perhaps you could edit it to clarify? – mdewey Nov 18 '16 at 11:49

## 1 Answer

The trials where the male mates with both A and B are not really informative about his preference for A over B so your choice of just analysing the subset with either A or B would be appropriate. If you still have a nagging feeling that males who mate with A twice and B once are different from those who mate with A twice, B once, and both ten times then you could check for some sort of propensity to mate by including either total number of mating trials or number of mating with both trials as a covariate. I would definitely not do this as an offset as it assumes you know the value of the coefficient.