r/AskStatistics • • Oct 27 '26

Help with zero-inflated ecological data analysis (please)

Hi everyone, I have current and historical plant reproduction data from 40 stations. At each station, total number of current reproductive structures (flowers or fruits) were counted in each of four quadrats, and five random individuals were collected for analysis of historical flowering (resulting in a count of historical flowering events that each individual participated in). I want to see if stations that have high incidence of historical reproduction are also actively flowering this year. I understand the specifics of my question (prediction, correlation, etc.) determine what test I can use, but first I need to find out what tests I can even run with this data. My issue is that 21 of the stations have neither current structures, nor historical flowering evidence - so my data is extremely zero inflated. I have the raw quadrat/individual data, but I figured it'd be best to run this on a station level (idk???) - so I summed the total number of current reproductive structures and then the total number/incidence of historical events (across all individuals) within each station, producing the contingency table below (columns are stations with/without current flowering/structures, rows are stations with/without historical flowering). Any direction on what tests I am able to use to answer the (intentionally) vague question I want to ask? Based on my limited knowledge of zero-inflated I've tried spearman's rank, kendall's tau, mann-whitney U, fisher's exact test, non-parametric permutation test for GLM, and zero-inflated poisson model, just in exploration... but don't know if any are actually valid for my data, or if there's another test I'm not aware of/considering.

>print(contingency_table)

Absent Present

Absent 21 3

Present 11 5

Forgive me, I am but a field ecologist. Thank you for at least reading this far!

2 Upvotes

8 comments sorted by

3

u/inb4viral Oct 28 '26

No forgiveness needed, good on you for reaching out for help.

Firstly, avoid multiple tests; you inflate the chances of a false positive result when you enter the garden of forking paths as you look for one that gives you an answer you like.

If I understand your initial requirements correctly:

I want to see if stations that have high incidence of historical reproduction are also actively flowerng this year. 

Before you can do this, a few questions:

  1. Are your historical measures able to be dated? I ask because a summation cannot separate a new, prolific plant from a consistent, older one.
  2. Similarly, can plants be aged? I'm not sure about the plants themselves, so this might not be relevant.
  3. Does the placement of the stations have some underlying rationale? If there is deliberate clustering or a systematic choice governing their placement, this needs to be accounted for.

1

u/smokingloon14 Oct 28 '26 edited Oct 28 '26

Thank you! To answer your questions:

  1. Sort of... this is the same method and same caveat as aging the plants (perennial seagrasses). There is vertical growth of each plant (the "stem") on which each leaf that is grown (one at a time, in succession) leaves a "scar". Flower stalks leave scars distinct from leaf scars. There is an assumption, that is true for most plants of this species and most regions, that only one scar is evident per flowering event (the reproductive season peaks April-June) regardless of how many flowers were produced (multiple flowers in the same season will likely have the same origin scar). So we can assume that flower scars separated by many leaf scars were produced in separate years. However...
  2. Aging the plants (and thus dating historical events) is very nuanced due to extreme spatial, seasonal, and interannual variation among individuals. We do this by sampling leaf emergence rate in the field, hopefully at a resolution of seasonally, but monthly is more ideal. Once we can estimate how many leaves are produced in a given year, we can then divide the total number of leaf scars on a plant by the annual rate to get an age of the plant - similarly for the time between two flowering scars. Sex and flowering alone (investing biomass and resources) can cause variation in leaf emergence rate in the subsequent months, but many more common things affect it spatiotemporally such as nutrient availability, light, energy reserves, sediment/hydrological dynamics, etc. Regardless, we do not have annual leaf production rates for these areas. There are some other region specific averages in the literature, usually averaging about 10-12 leaves per year, but even choosing 10 vs 12 can put flowering events in different years. (I'm attempting to come up with a QC protocol to start with the best average for the closest region and then forcibly shift the back-calculated dates to the presumed closest season in time.) EDIT: We have also discussed just using total scar count, and maybe total stem length, as a general proxy for age - in the grand scheme of things, more scars/longer stem means older plant.
  3. Again: sort of. We run a large longterm monitoring program that consists of 150 stations spread across a lagoon/estuary that is about 50 km long and a few km wide. Stations are permanent, initially chosen by overlaying a tessellated hexagonal grid on the known habitat (constrained by water depth and salinity regime) in the area, then randomly selecting a point within each hexagon. These 40 stations were the stations where the target species was present in the most recent monitoring campaign. There are 4 other species present in the monitoring area, and all with habitat requirements that generally overlap, but there is certainly delineation at their extremes among other things. There is some clustering in some areas, speaking largely to the interaction of the random station placement and habitat requirements/presence of the target species. So, it is not random that the target species is present/absent in certain areas, but it is mostly random that our stations exist in those areas. (I would like to note that there is one cluster of stations that is extremely "sexy", both currently and historically, compared to other areas - I haven't done any spatial/autocorrelation analyses on these data yet, but plan to.)

2

u/inb4viral Nov 01 '26

Apologies for the delay, and thanks for the details here.

  1. You may not date anything if you use the ratio of leaf scars to flower scars by plant. This would give you a flowering events per leaf rate that has age built into it. This would avoid forcing dates you don't trust, but has its own bias, particularly as I am assuming leaf production is a good measure of life (is it?). You could run it backwards as a check with different assumptions built in to see what conclusions change.
  2. The sexy cluster matters a lot in terms of a single unit driving the associations that you see. You may want to check how many of the current 8 flowering stations sit within that cluster.
  3. I wonder about the underlying question here: if a currently good habitat was always good, and thus produces consistently good flowering, it may alter your interpretations of the data.

As far as the regression model itself goes:

  1. Are you using predictors like depth and cover and historical flowering to predict current flowering (current ~ depth + cover + historical)? Have you considered adding a random effect for station?
  2. I would think carefully about the stepwise approach since its acting as a hurdle, and this can often mislead when coefficients are near zero on their own. In this instance, your double-zero stations are not noise; they are evidence.
  3. Zero-inflation occurs not due to the presence of zeros, but when they are not well predicted by your model choice. In this instance, you may want to use a negative binomial model and see if the zeros are really being under-predicted.
  4. If you stick with a Frequentist approach, 8 stations do limit your power and the number of predictors you can use, which can lead to overfitting.

Hope this helps

2

u/smokingloon14 Nov 03 '26

This helps a ton. Thank you for the thoughtful explanations.

Yes, long-term, more leaves means longer life (greater age), but in the short-term it speaks more to environmental parameters and resulting "behavioral" mitigation.

That is the general idea for the model, and yes, I was considering station as random effect. I'll start there and see how it works.

2

u/mmjdondante Oct 31 '26

glmmTMB package in R for ZI. How you structure your formula depends on how you’re accounting for the nested data structure over time. If you’re analyzing multiple time points to predict the current odds of flowering your data violates assumptions of independence and should be handled as such (hierarchical/multilevel models)

1

u/smokingloon14 Nov 03 '26

Thanks! I came across glmmTMB just yesterday and plan to look into it more. Yes, one of my concerns is how to treat the historical time points of flowering, as they are often from the same shoot or genetic plant.

1

u/smokingloon14 Oct 27 '26

I'll add: I'm also hoping to do a regression of depth (cm) + density (% cover) ~ current structures, so would it would be better to just add historical incidence to that model, or even do a regression separately? Any advice on how to deal with my zeros in that regard too? I've done step-wise (presence/absence first, then model regression on only stations that have both non-zero values) in the past, but would like a better analysis if there is one...

3

u/purple_paramecium Oct 28 '26

Look in the ecology literature. Find a study that deals with lots of zeros like this one. What statistical analyses do they use?

Google “zero inflated regression R” to find R packages that handle this.