JamesSample / icpw2

New decade, new workflows
http://www.icp-waters.no/
0 stars 0 forks source link

Trend analyses for N report #1

Closed kariaust closed 1 year ago

kariaust commented 4 years ago
  1. Calculate TON, TOC/TON and TOTN/TOTP. We have discussed whether to calculate ratios on sample basis or calculate it based on time aggregated values, e.g. annual TOC and TON if doing an analysis on annual level. I did a quick check of some RESA data for sites with different sample frequency, using average to summarise. Generally the differences were very small, and not systematic as far as I could see. Where there were larger differences it was because TOC was available for more samples than TON. And that is exactly why I think it is not correct to calculate the ratio on aggregated values. The others think it is more robust, though, and I saw that for one year for one site, where there was one deviating sample affecting the annual average strongly when averaging across samples. But that problem would be avoided by using medians.. And I suppose this is what we will be using for the trend analysis, as in the recent trend report? Do you have an opinion on this? Or can you do a check of this, i.e. do both, so that we can see the difference (using medians then, I suppose)? An alternative would of course be first to select the samples where both parameters are analysed and then make the two different calculations. Then there should not be big differences, but useful to see if they are systematic
  2. Select time periods for the parameter set (TOTN, NH4, NO3, TON, TOC, TOC/TON, TOTP, TOTN/TOTP, TOC/TOTP, NO3/TOTP). From my quick check, and using the same criteria as in the trend report (data from at least one of the first and last five years, data from at least 65% of the years), I came up with the following suggestions:
    • Start in 2000: This seems to be a good best trade-off for number of stations vs length of time series for the whole set of parameters. It did not seem to help much to shorten the time period with just a few more years
    • Start in 1996: This could be OK if we define TON as TOTN-NO3. Then we also have the possibility to include stations where NH4 has only been monitored recently. But we have to exclude stations with a high NH4. It will be a bit arbitrary, but what about excluding stations with median NH4/NO3 >0.1 and median NH4/TOTN >0.05 for 2007-2016?
    • Start in 1990: We should at least do this for NO3 (as we have already done). But it can be useful to do this time range for all parameters where it is possible. Then we can use stations with long time series for all/several parameters as case studies I did not come up with the years 2000 and 1996 in a very systematic way, though. If you have a neat way of doing this, it would be good – i.e. to optimize number of stations vs length of time series
  3. Calculate trends per station for the different time ranges. I do not think we can aggregate by the geographic regions this time, as there are so much fewer stations, at least for the 2000 time series (maybe it works for the others?). But as a start it would be good to get trend maps, as well as data per station in the long and wide format as for the trend/TOC report, with median, sen slope and significance level
  4. Some issues to consider: a. What do we do with detection limits? This may be an issue especially for TOTP. Do we have this kind of information at all? For the NO data we do. In RESA the value is set to the detection limit if below. But for this purpose, when we look also at ratios, maybe it is better to use half the detection limit? b. Do you consider distribution of data throughout the year at all? Especially at the start of time series, there may be data only for the second half of the year. Should we exclude such years based on some criteria, or is this too much..? c. How have you dealt with data given for different depths for the same site/date/par?
kariaust commented 4 years ago

An update to the above points after further discussions:

  1. Skip the exploring. Just calculate the ratios using samples where both parameters are measured only and then calculate the median
  2. Do we risk getting too short time series if we use the five year criterion also for the time series starting in 2000? The minimum would be nine years. Maybe it is just OK, since we also have the 65% criterion? 4a. If we have detection limits - we suggest leaving out values with very high detection limits, cutoff of 10 for NO3, NH4 and TotP and 50 for TOTN (all ug/l). And we will make it simple and just use the detection limit as value when values are reported as <LOD
JamesSample commented 4 years ago

I've made a start on this here. Based on this preliminary exploration, I'd say the most promising time periods to consider are 1990 to 2016 and 2000 to 2016 (see the plot here).

Regarding your points above:

Do we risk getting too short time series if we use the five year criterion also for the time series starting in 2000?

My code for the Mann-Kendall test (like most other implementations) uses some statistical approximations to calculating significance values that are only really valid for n >= ~10. My M-K code will print warning for n < 10, so we'll be able to see if and where this is a problem.

4a. If we have detection limits...

We have some LOD data, but it's patchy. Some Focal Centres don't highlight LOD values at all, and some do, but only sometimes. In several cases, it's pretty obvious from the data that values are at the LOD, but they're not flagged as such. I'll check to see how complete the LOD information is, but I suspect it may be so patchy and inconsistent that it will be difficult to use effectively.

kariaust commented 4 years ago

Do you have a response to 4b and 4c as well?

And a nw point 5. What should we do about QC of the less used parameters? Are there any automatic outlier tests that could be used? Or shall we just wait until we discover some strange results..?

JamesSample commented 4 years ago

Regarding 4b, for the 2019 report, Øyvind and I initially defined much stricter selection criteria to ensure the annual means/medians were broadly representative (see here for full details):

For lakes. Aggregate to seasonal frequency and require that fewer than 25% of the seasonal values within the period from 1995 to 2011 are missing

For rivers. Aggregate to monthly frequency and require that fewer than 25% of the monthly values within the period from 1995 to 2011 are missing

Then calculate annual means/medians for the selected time series

The problem with this is that you end up with data from just a few countries with good monitoring. This reduces our ability to detect spatial patterns and may also be off-putting for Focal Centres (e.g. if they feel their data isn't being used). Unfortunately, I don't think we can do this in a meaningful way unless we're willing to ignore/remove data from many of the Focal Centres.

Regarding 4c, we typically request that Focal Centres only submit "surface" samples, although from the data in the database it seems that wasn't always the case (and, regardless, some FCs add a depth column to the input template and submit everything anyway).

The vast majority of ICPW data is entered in the database as depth1 = depth2 = 0 m. For the current preliminary analysis, I'm selecting all samples ("mixed" or otherwise) within 1 m of the surface and then taking annual medians - see the last code cell in Section 2 here.

Finally, regarding QC, we can run some outlier tests etc. if you like. However, my recommendation initially is to begin with the analysis and then see how things develop. I generally end up producing lots of intermediate plots as "sense checks" anyway (histograms, box plots, time series etc.) and these should help to identify at least the worst outliers. The fact that we're aggregating to annual medians (rather than e.g. trying to fit a seasonal model) will make things more robust too.

kariaust commented 4 years ago

OK, this sounds reasonable

Not sure if this is ever an issue, but if there are more than one sample within the upper 1 m I would prefer if one value (median?) is selected before taking the annual median