I have data on sex and age of a population in different periods of the year, for several years. I want to test if age and sex ratios are the same across different moments of a year. I think a log linear model would be appropiate, beginning with something like (in R)

glm(counts~year * period * sex * age, data=databirds,family='poisson')

I would test the different interactions until I could select a model.

My doubt is about independence of my data. All the samples are extracted from the same population. I assume that there are migration and mortality processes, and a reproductive season, so the population is not exactly the same across the year, but some individuals were catched more than once in different periods (and in ifferent years). That is, I have determined the sex once for some individuals and more than once for others (there are birds, so the sex of an individual is always the same).

Should I add a random factor? Something like

glmer(counts~year * period * sex * age+(1|bird), data=databirds,family='poisson')

If so, the interpretation of fixed effects is the same as log-linear models, that is, should I look to interactions?

If there are some difference, should I contrast effects or interactions?

Finally, as I will fit several models, should I correct the significance level? I thought this was made for contrasts, but recently I read something about correcting significance level for nested models (as models including 2-way interactions, that are evaluated after selecting a 3-way interaction).

Thanks in advance!

Edit: Well, now I think it would be better to use a repeated measures glm, with a binomial distribution, something like


I think this should solve the independence problem...Is this correct?


1 Answer 1


(Caveat: unclear from your question if you are simply interested in the proportions of sex, or of age thresholds independently of one another. Assuming you are, this answer should hold.)

You could simply use Cochran's Q test of equality of proportions in blocked data (it is an extension of McNemar's test to blocked, rather than paired data). It has been implemented in:

  • $\begingroup$ Thank you very much for your answer. I'm interested in 1) the proportion of sex for each age threshold and 2) changes in each of these proportions in different moments of the year. I’m also interested in changes of each age proportion during the year. $\endgroup$
    – mmv
    Commented Sep 23, 2015 at 9:05
  • $\begingroup$ blocked data (it is an extension of McNemar's test to blocked, rather than paired data) Do by "blocked data" here you mean simply repeated measures settings with k RM treatments? $\endgroup$
    – ttnphns
    Commented Dec 29, 2015 at 10:16
  • $\begingroup$ @ttnphns Mostly... I think of "blocking" as a more general concept of which "repeated measures" is an example. For example, in the matched case-control design for which McNemar's test is so often used in epidemiology, the (two) repeated measurements aren't being made in the same subject, but once each in matched subjects. Likewise, blocked data may entail repeated measures within the same subject, or may entail measures made in ($k$) matched subjects. tl;dr: Yes, but with semantic quibbles. :) As it so happens my answer is a poor one given the revisions to the question. $\endgroup$
    – Alexis
    Commented Dec 30, 2015 at 22:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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