# Testing equality of proportions in several samples of the same individuals

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).

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

glmer(ratio~period+age+(1|year),family=binomial)

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

• 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? Dec 29, 2015 at 10:16
• @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. Dec 30, 2015 at 22:49