File Exchange

image thumbnail

Homogeneity test of Global Trends using Chi-Square on Mann-Kendall

version 1.3.0.0 (12.1 KB) by Jeff Burkey
Test for homogeneity of trends in different seasons-stations,and global trends using Chi-Square.

1 Download

Updated 19 Feb 2009

View Version History

View License

GlobalTrends- Homogeneity tests for multiple seasons and stations. This function will test for trends when seasonality is present and over multiple observation stations, all of which are Chi-square statistics. There are so many statistical tests being done, this function is more like a script or program than a function, but I prefer operating with functions.

This function relies heavily on Matlab's Statistical Toolbox for obtaining Chi-square values and ktaub.m function.

These tests will allow for ties, missing data, and multiple observations per time index, since it uses the enhanced ktaub.m function that was recently updated.

There are numerous narratives as part of the output to the screen providing supporting interpretation of the results.

This function is based on Chapter 17.5 in Gilbert.

Syntax:
[ChiOutput K M sig] = GlobalTrends( datain, alpha )

Inputs:
To stay consistent with the previous trend statistics posted (ktaub, sktt, and SenT), data are expected to be in the following structure:
datain(:,1) = Year
datain(:,2) = season
datain(:,3) = value
datain(:,4) = station
alpha = scaler (e.g. 0.05)

Outputs:
ChiOutput structure is like the following (labels are not included)
Total: Chi-square df p-value
Homogeneity: Chi-square df p-value
Season: Chi-square df p-value
Station: Chi-square df p-value
Station-Season: Chi-square df p-value
Trend: Chi-square df p-value

And depending on significances of Stations, Seasons, and StationSeasons, one of three other outpus may occur:
K: significance of Seasons per station
M: significance of Stations for seasons

And when seasonal trend tests should not be done
sig: individual station-season p-values are given by row

There is a lot of output to the screen as well, but using fprintf, one could easily redirect output to a file.
Requirements
- Matlab Statistical Toolbox
- ktaub.m

Reference:
Richard O. Gilbert, Pacific Northwest National Laboratories,
"Statistical methods for Environmental Pollution Monitoring", 1987, Van Nostrand Reinhold, New York Publishing, ISBN 0-442-23050-8.

One last note. I’ve posted enough functions that it makes sense to constitute forming a Matlab toolbox…so it’s in the works (slowly).

Written by:
Jeff Burkey
King County- Department of Natural Resources and Parks
email: Jeff.Burkey@kingcounty.gov
12/13/2008

Cite As

Jeff Burkey (2020). Homogeneity test of Global Trends using Chi-Square on Mann-Kendall (https://www.mathworks.com/matlabcentral/fileexchange/22440-homogeneity-test-of-global-trends-using-chi-square-on-mann-kendall), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (3)

omer durdu

I think I am missing something and having the following error:

Error in GlobalTrends>HowSigIsIt (line 237)
p01 = 'All but absolute there is a trend.';

Output argument "answer" (and maybe others) not assigned during call to
"C:\Users\faruk\Documents\menderes\GlobalTrends.m>HowSigIsIt".

Error in GlobalTrends (line 140)
fprintf('Homogeneity\t\t%7.6f\t%4.0f\t%6.4f\t\t%s\n',ChiOutput(2,:),HowSigIsIt(ChiOutput(2,3)));

Do I have a problem with data table.

The program is running well with your (ex1c) data.

omer durdu

Jeff
this is a great routine. It is really useful and efficient.

Jeff Burkey

I've included a MAT file with example data to run the function. I hope this helps.

MATLAB Release Compatibility
Created with R2008b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!