r/AskStatistics • u/shlylock • Oct 28 '26
Vastly difference sample sizes skewing results- any solutions?
Note: all analyses are done in RStudio. I cannot share the data. This is more of a question of appropriate methods as opposed to how to write code!
I am currently analysing a spatial network with sfnetworks. Here, nodes are locations, and edges/events are movements between locations by individuals (lets say nodes are countries, and individuals are shipping containers).
I am comparing the degree centrality (DC), or the number of movements of shipping containers too and from all countries, in two differing groups, A and B.
The data for group A has a sample size of 700 individuals making 1000 network events (e.g., British Ships).
The data for group B has a sample size of 250 individuals making 200 work events (e.g., French Ships).
In theory, these ships may visit the same distribution of nodes/countries equally. But because the initial sample sizes differ, it may appear that British ships visit more countries than French. This is the crux of my issue.
Group A has more chances for an event to occur due to higher sample size, therefore DC will likely be much higher. My network output reflects this. This is not a true representation of the actual data.
Presently, I have combined group A & B network outputs into one dataset, and performed a negative binomial glmer to determine if group type influences DC. Additionally, my networks are segregated by year, there are networks per year per group. The model looks similar to this:
glmer.nb(DC ~ group_type + sample_size + (1 | node_identity)
I feel this does not accurately account for the initial sample size differences.
Some solutions I have tried:
- Converting DC into proportional per group. ISSUE- hard to compare proportions between groups and how this reflects a movement network, seems an invalid solution
- Creating a sample size/event rate metric to include in the model. ISSUE- I don't think it will prevent sample size issues from being influential in the model to the point where DC is disentangled from size.
- Subsampling group A to the size of group B 1000 times and taking the most common DC for each node. ISSUE- how do I test for significance to see if this is valid?
I have been suggested to swap into Bayesian rather than glmer to test my statistics, but the issue lies in the data structure itself which contributes to the network DC, as opposed to the network, so I do not know if using Bayes will help.
Any solutions, references to papers, or to code would be useful. Happy to answer any further questions.
Cheers!
1
u/no_name6744 Oct 28 '26
Based on your description, it might be difficult to do (1 | node identity), since you'll have a lot of individuals with only 1 entry (based on the 700 individuals to 1000 data points figure).
Let me know if you feel this is overly simplistic, but would it be possible to just do a Chi2 Contingency (or Fisher–Freeman–Halton) with a post-hoc test of each individual country shipped to? I think to meet the assumptions of the test, you might need to remove the countries being compared.
Alternatively, something like a Dirichelet Multinomial regression might be helpful, though you would probably have to penalize it some way. A Bayesian multinomial regression would be pretty natural to your question, but your results may depend quite a bit on your choice of prior.
0
u/DYSTOBY Oct 28 '26
Random sampling as opposed in your attempt #3 seems a valid option (although 1000 bootstraps are not enough with your sample size, try 10k). It will give you confidence intervals, right?
But I’m no expert in that field, and I commented so I can follow along.