In a study per-field disease incidences were collected by sampling 35 plants in each field and counting proportion of infected ones (# of infected/total sampled). In result, each sampling location corresponds to a value between 0 and 1. I have about 100 locations in total, each sampled in the same way.

I have then a column representing two groups of growers knowledge. There are people who have a knowledge and I have a set of disease incidences in their field and I have a group of people who have no knowledge and I have a set of incidence scores in their fields.

What test do I use to see if there is a significant difference in the mean incidence between the groups?

Data are not normally distributed.

My data looks like in those barplots: enter image description here

  • $\begingroup$ "counting proportion of infected ones" means count the # of infected plants and calculate the proportion by # of infected divided by 35? $\endgroup$
    – user158565
    Commented Nov 20, 2018 at 16:41
  • $\begingroup$ Yes, made it more explicit in the question now @user158565 $\endgroup$
    – MIH
    Commented Nov 20, 2018 at 16:45
  • $\begingroup$ Is it reasonable to treat incidence within a location as independent? Would disease in one plant imply disease is more likely in the others? That would have implications for a binomial assumption $\endgroup$
    – Glen_b
    Commented Nov 21, 2018 at 1:43

1 Answer 1


Mixed effect logistic regression is a good choice.

Let $Y_i$ be the number of infected plants in field $i$. The model is:

$$Y_i \sim Binomial(35,\pi_i)$$

$$\mathrm{logit}(\pi_i)=\log(\frac {\pi_i}{1-\pi_i})=\beta_0 + \beta_1 X_i +\gamma_i$$ where $X_i =1$ if grower on the $i$-th field is have a knowledge, = 0 for otherwise. $\gamma_i$ is random intercept for field $i$ to account for possible over-dispersion. $\beta_1$ is log odds ratio between knowledge vs no knowledge. The mean proportion of infected is $\frac{\exp(\beta_0)}{1 + \exp(\beta_0)}$ for no knowledge grower, and $\frac{exp(\beta_0+\beta_1)}{1+\exp(\beta_0+\beta_1)} $ for knowledge grower.

Data format:

    field    plant   infected     knowledge   
      1       1        0            0
      1       35       1            0
      2       1        1            1
     100      35       0            0
  • $\begingroup$ Is it really a mixed model or just GLM? How would that be structured in R? m <- glmer(incidence ~ knowledge, data = Data, family = binomial(logit)) ? how do i put fixed effect here? ` $\endgroup$
    – MIH
    Commented Nov 20, 2018 at 17:08
  • $\begingroup$ knowledge is fixed effect. knowledge = $X_i$ in my formula. After you fitting the model, the estimated coefficient of knowledge is $\hat\beta_1$. incidence can not be response variable. The response variable is infected or not, 0-1 variable. 35 planes/fields needs 35 lines in data per field. $\endgroup$
    – user158565
    Commented Nov 20, 2018 at 17:18
  • $\begingroup$ Thanks so much for your time! I think there is a misunderstanding. My data look following: incidence = c(0.19, 0.50, 0.75, 0.34, ....) knowledge = c("yes","no","yes",.... etc) Thus, I am interested in per field incidence, not per plant infection. My column (response variable) is a proportion (between 0 and 1) but I know this proportion has been taken from 35 plants in that field. I want to see if farmers with more knowledge had higher incidence or lower in their fields. Does it make sense? $\endgroup$
    – MIH
    Commented Nov 20, 2018 at 17:29
  • $\begingroup$ But based on "# of infected/total sampled", you know the # of infected, and # of total sampled. So it is feasible to recreate the data frame I added in the answer. c(0.19, 0.50, 0.75, 0.34, ....) is regenerated variable and will not be used as response variable if possible, because it has some bad properties, for example, unequal variance. $\endgroup$
    – user158565
    Commented Nov 20, 2018 at 17:35
  • $\begingroup$ Structured the model in the following way in R. Had to supply incidence and weights. m <- glmer(incidence ~ knowledge+(1|knowledge), data = DataTest, weights =rep(30,nrow(DataTest)),family = binomial(logit)) $\endgroup$
    – MIH
    Commented Nov 21, 2018 at 10:39

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.