I have a very large dataset that has 3 variables I'm interested in: year, place, and observation. Every year, at the same time per year, people go out and survey different areas for fruits. They then record what type and how many fruits they saw. The dataset goes for about 20 years. Here's a small example:

Year   Place       Type of fruit  Number of fruits
2000   Orchard     Apple          5
2000   Beach       Apple          0
2000   Mountains   Apple          2
2001   Orchard     Apple          30
2001   Beach       Apple          3
2001   Mountains   Apple          3
2000   Orchard     Orange         18
2000   Beach       Orange         5
2000   Mountains   Orange         0
2001   Orchard     Orange         6
2001   Beach       Orange         1
2001   Mountains   Orange         5
2000   Orchard     Coconut        0
2000   Beach       Coconut        50
2000   Mountains   Coconut        0
2001   Orchard     Coconut        1
2001   Beach       Coconut        52
2001   Mountains   Coconut        2

I'm interested in looking at how much the abundance of each fruit has changed over time within each place. Unfortunately I don't have data for each place every year and sometimes there are new places that pop in and out but the majority were surveyed each year. I thought a multiple regression of year ~ number with place as an error term makes the most sense using lmer in R. I would do this separately for each fruit. Something like this:

fit <- lmer(year~number + (1|place), data=fruits, REML=FALSE)

Is this the appropriate analysis?

  • 1
    $\begingroup$ In 2000, you have two Orchard. What is the relationship between them? $\endgroup$
    – user158565
    Dec 12, 2018 at 19:59
  • $\begingroup$ Yes, every year there is a survey at the orchard, in the mountains, at the beach etc. This is just an example dataset that reflects what I have. The survey at the orchard in 2000 found 5 apples, 18 oranges, and 0 coconuts. Does that make it more clear? $\endgroup$ Dec 12, 2018 at 22:09
  • 1
    $\begingroup$ All of the "Orchard" in your data set mean the exact same Orchard? or different orchard? Or how many different orchards? $\endgroup$
    – user158565
    Dec 12, 2018 at 22:13
  • $\begingroup$ They are the same orchard. Each place name that is the same is the same place :) $\endgroup$ Dec 13, 2018 at 3:02
  • 1
    $\begingroup$ Assume that "the abundance of each fruit" is represented by "Number of fruits" in the data set. The model should be `lmer(number~year + type + (1|place), data=fruits, REML=FALSE) $\endgroup$
    – user158565
    Dec 13, 2018 at 5:05


Your Answer

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

Browse other questions tagged or ask your own question.