# What methods are appropriate for testing correlations between binomial count (but not presence/absence) data?

Is it appropriate to analyze the relationship between a proportional explanatory variable and a proportional response variable (as cbind(option 1, option 2), or as a proportion with weights) using logistic regression? If so, is there a way to weight the proportional explanatory variable to account for different sample sizes for each trial?

Here are the details of my study:

I would like to evaluate whether individual insect preferences for pairs of host plants are correlated. Insect preference was tested using three separate choice assays:

1: plant A vs. plant B, 2: plant A vs. plant C, and 3: plant A vs. plant D.

In each assay, we recorded the number of eggs laid on the two available plants. Each individual was tested on all three assays. Assay 1 was diagnostic, so all insects started on that assay, after which they were moved onto assays 2 and 3 in random order. A total of 79 individuals laid eggs in all three assays. The total number of eggs laid in assay 1 ranged from 2 to 126; in assays 2 and 3, from 2 eggs to 178.

My main questions are, is preference (proportion of eggs laid on plant A) in assay 1 correlated with preference in assay 2 and/or with preference in assay 3?

Possible solutions (and associated concerns):

1. Use logistic regression with proportion of eggs laid on plant A in assay 1 as an explanatory variable, including only those females that meet a minimum threshold for total eggs laid in assay 1 (>15). This both reduces my total sample size (down to n = 53), and does not take into account the greater confidence I have in the preference of an insect that lays 30/75 eggs on plant A in assay 1 compared to an insect that lays 6/15 eggs on plant A in assay 1.

2. Use a negative binomial mixed model (glmer.nb) with the rough form: plant A eggs ~ log(total eggs) * Assay + (1|insect ID). While this can tell me whether the eggs laid on plant A as a function of total eggs laid differs between the three assays, I don't believe it is informative about how similar the preferences are. I also looked at poisson and quasipoisson, but these models had worse fits than the negative binomial model.

• Welcome to the site, @rstewa03. Please could you elaborate a little on your concern about the sample sizes - what were your sample sizes for each assay? Were different insects used for each assay?
– Izy
Commented Jun 3, 2019 at 22:38
• Thank you! Each individual was tested on all three assays: assay 1 was diagnostic, so all insects started on that assay, after which they were moved onto assays 2 and 3 in random order. A total of 79 individuals laid eggs in all three assays. The total number of eggs laid in assay 1 ranged from 2 to 126; in assays 2 and 3, from 2 eggs to 178. Commented Jun 4, 2019 at 14:09
• Thanks, that's clearer. I think that structure should be reflected in your analysis, so suggest you edit your question to include that information. Hopefully someone will have a good suggestion for how to analyse this sort of data.
– Izy
Commented Jun 4, 2019 at 14:29
• You could also search for previously published papers that had this kind of experimental structure and see what methods they used. If you find a good answer, please come back and explain it here (you are allowed to answer your own question).
– Izy
Commented Jun 4, 2019 at 14:34
• Thanks @Izy, I will continue to look for similar experimental designs described in the literature and on different forums. Commented Jun 5, 2019 at 20:16

One approach could be to treat individual eggs, instead of entire "clutches", as your units of observation, with the dependent variable coding for whether an egg has been laid on plant A ("success" = 1) or not (0). Such data is appropriately modelled by Binomial logistic regression. In addition, it will reflect the fact that you have intuitively more confidence in data coming from bigger clutches, because there will be as many data points as eggs per insect and assay.

Regarding the correlation between insect preferences across assays, it is reflected by the variance of the random intercept for insects. The role of the random intercept is to model the lack of independence between observations (eggs in assays) in a level of the grouping factor (individual insects), i.e. their general idiosyncratic preference for, or reluctance towards, plant A across assays.

• +1, good suggestions. This (and @rstewa03 's suggestions too I believe) rely on the simplifying assumption that each egg-laying event is independent. Any thoughts on how/whether to reflect the ordering of the assays in the analysis?
– Izy
Commented Jun 10, 2019 at 11:34
• I think it would be sensible to consider ordering either as a random or fixed effect - the fact that it has been included in the experimental design suggests that it is considered as something that may be an issue. I don't think the complete factorial of ordering was carried out though - it was either 1-2-3 or 1-3-2. As you note, individual is nested within order, so I think the random intercept would be (1|Ordering/Individual) in R (glm) parlance?
– Izy
Commented Jun 10, 2019 at 14:37
• Order is of considerable interest, and I have included it in my models thus far as a fixed effect with two groups (as @Izy noted). Commented Jun 12, 2019 at 15:55
• @Izy To add Odering as a random effect with Individuals nested within, (1|Ordering/Individual) is correct indeed. It expands to (1|Ordering) + (1|Ordering:Individual). The latter implies that one variance of Individual intercepts will be estimated separately for each Ordering.
– Ous
Commented Jun 13, 2019 at 21:06
• @rstewa03 The variance of the random intercept of ID is not directly link to variance explained, and I would not know how to get that. If you only need to convince yourself (or someone else) that preferences are correlated across assays, you can qualitatively compare the value of the variance to the estimate of the Assay fixed effect, just like Ben Bolker suggested in your second link. If you need numbers and a more rigorous criterion, Bayesian estimation of lmm provide credible intervals (the Bayesian equivalent of confidence intervals) for random parameters.
– Ous
Commented Jun 13, 2019 at 21:13