# Comparing yearly data that has different $n$ values per year?

I have been collecting soil moisture data at my research site for almost 20 years. However, I have not been consistent with the number of times that I have been taken these measurements. The problem that I am having right now is that I am trying to compare my data throughout the years.

If I do this by the average, my comparison is not going to “real”, because in some years, I have 10 measurements, and in other years I have only 2 measurements. Due to that my question is, what would be a good way to make this comparison with my data? Normalize my data? If so how?

Just as an example I am attaching a plot of what I have so far.

• What is the goal? Only to compare the yearly means? MIght there be some variation within years? If you have the date for each measurement, can you show us a time series plot of the series? ... or share (a link to) the data? Commented Sep 26, 2020 at 14:12
• @kjetilbhalvorsen my goal is to analyze the data, find something meaningful (I know that sounds broad, but I just want to get some info about the data). That is the reason why I am doing the yearly means. What else would you suggest me to do? Thank you Commented Sep 27, 2020 at 3:59
• Plot the data as a time series as a start, and show us! Commented Sep 27, 2020 at 4:20
• Analyzing data without knowing what pattern to analyze is extremely difficult/tricky. You could compare the means per year, but aside from differences in $n$ per year, a much larger problem is that the measurements are not a good reflection of the mean moisture levels for a particular year. If you took samples during a hot summer in one year and samples just after a rainy day in another year then the observed mean values for these two years will be different, but they do not have anything to do with some meaningful model (e.g. climate change or soil structure change). Commented Sep 30, 2020 at 14:02

You want to do some exploratory data analysis with an unclear (to readers here) objective. What you have (assuming you have the individual measurements dates) is a . So I will assume you have data in two-column format like

date         value
12-jan-2003   95
.
.
.


Then make a plot of value versus date (maybe interpolate for readability.) Is there some signs of non-stationarity or seasonality? For soil moisture, for many locations I would expect some seasonality (rainy season?) and for other locations, not. As for the boxplot you have shown us, with so few observations I would replace that with vertical dotcharts. Pleas show us this!

• In this kind of situation, you'll need to use unpaired tests. For example, the unpaired $$t$$-test lets you compare the means of two different data sets. The two sets do not need to have the same number of data points, so this is particularly useful to you. Have a look at https://www.statstutor.ac.uk/resources/uploaded/unpaired-t-test.pdf for more information.

• You might want to ignore the cases where you have very few data points.

• Another option is using a Bayesian approach, although that will require you come up with a suitable prior and a distribution for each year's sample. For example, you might use a Gamma distribution for each individual sample taken, with a fixed shape and a scale that is some linear function of the year number; you can then find a distribution over possible slopes. This kind of approach requires several assumptions and takes a bit more work, but you might get more information out of it if you know how to use it properly.

• Thank you for your response. Could you please elaborate of the first bullet point? Thank you Commented Sep 25, 2020 at 22:17
• I edited and added a link to a site with more information on the unpaired $t$-test. Commented Sep 25, 2020 at 22:28
• Once again thank you for your response. However, if I am properly understanding this t-test that you mentioned is to compared two groups. In my case, I have 9 groups to compare. Commented Sep 26, 2020 at 3:45
• I see. Good point. In that case, check out graphpad.com/guides/prism/7/statistics/… Commented Sep 26, 2020 at 4:11
• Thank you for your response Commented Sep 26, 2020 at 4:58