Chapter 12 Trend Analysis BAE 5333 Applied Water Resources Statistics Biosystems and Agricultural Engineering Department Division of Agricultural Sciences and Natural Resources Oklahoma State University Source Dr. Dennis R. Helsel & Dr. Edward J. Gilroy 2006 Applied Environmental Statistics Workshop and Statistical Methods in Water Resources
No Signal, Only Random Noise Over Time Null Hypothesis For All Trend Tests No Signal, Only Random Noise Over Time
First Alterative Hypothesis Linear Trend Over Time
Second Alterative Hypothesis Nonlinear (Monotonic) Trend Over Time
Third Alterative Hypothesis Step Trend, Shift at One Point in Time
Seasonal Variation A Common Pattern in Natural Systems Seasonality – within each year Trend – over multiple years
How to Find a Trend Visual (graphical) May be easy to identify and easy to communicate to others Can not quantify Statistical Gives a number Can identify trends with messy data Technically difficult Be vewwy, vewwy quiet ….. I’m hunting for a twend.
Trend Topics Tests where time is an explanatory variable Parametric versus nonparametric trend tests How to add other variables besides time How to deal with seasonal variation
Is an Explanatory Variable Tests Where Time Is an Explanatory Variable If time is measured continuously (i.e. decimal time - 1997.5) Regression (parametric) Kendall-Theil (nonparametric) If time is a grouped variable (1980s, pre- versus post-) t-test (parametric) rank-sum (nonparametric)
Trend Tests Time is Continuous
Trend Tests - Time is Continuous (cont.)
Nonparametric Trend Tests With Other Variables Compute Lowess of Y vs. X Store residuals R Test residuals R for trend using Kendall’s tau
Parametric Trend Tests With Other Variables If both time (T) and X are continuous Use multiple regression Y = b0 + b1T + b2X If time is grouped Use ANCOVA Time (T) is a 0 or 1, binary variable
Decision Rules for Using Continuous or Grouped Measures of Time
Parametric vs. Nonparametric Test Distribution of residuals? Linear or monotonic? Kendall-Theil Slope is Median of All Pairwise Slopes Kendall –Theil compares the change in value vs. time (slope) for each point on the chart and takes the median slope as the a summary statistic describing the magnitude of the trend.
Step Trends
Step Trend Tests
Nonparametric Step Trend Tests with Other Variables Compute Lowess of Y vs. X Store residuals R Test residuals R for trend using rank-sum test
Nonparametric Step Trend Tests with Other Variables For a continuous X variable and time (T) is a grouped variable Use ANCOVA Time (T) is a binary variable, 0 or 1 Y = b0 + b1T + b2X
Dealing with Seasonal Variation Parametric methods Build a better model Nonparametric methods Only compare within the same season
Continuous Trend Tests with Seasonal Variation
Seasonal Kendall Test Compare all data within the same season to one another DO NOT compare data across different seasons Slope is the median of all within-season pair wise slopes.
Seasonal Kendall Test
Computing the Seasonal Kendall Test The test statistic Si for EACH SEASON is the number of plusses (Pi) minus the number of Minuses (Mi) comparing data only within that season. For season i we have: Si = Pi − Mi
Seasonal Kendall Test Statistic Sk
Summary: Nonparametric Trend Tests Simplest Y = b + mT (Kendall-Theil) Adjusted for another variable R = b + Mt R = Lowess residuals of Y vs. X With seasonal variation Y = b + mT m is Seasonal-Kendall slope
Regression with Sine and Cosine Two new explanatory variables are created, and added to the regression equation These are the sine and cosine of 2πT T is time in decimal years (1997.5) Resulting in one revolution every year
Regression with Sine and Cosine The term 2πT produces one cycle per year, with a minimum and maximum Slope coefficients times the sine and cosine terms fit the cycle function to the data Both variables are required, as there are two unknowns for the year Amplitude “phase shift” (day of the peak)
Regression with Sine and Cosine Y = b0 + b1T + b2X + b3sin(2πT) + b4cos(2πT) Keep both sin and cos, or drop both. Base decision on b3 and b4. If either are significantly different than zero, keep both terms.
Summary: Parametric Trend Tests Simplest Y = b0 + b1T Adjusted for another variable Y = b0 + b1T + b2X With seasonal variation Y = b0 + b1T + b2X + b3 sin(2πT) + b4 cos(2πT)
Results of a Seasonal Model
MINITAB Laboratory 11 Reading Assignment Chapter 12 Trend Analysis (pages 323 to 355) Statistical Methods in Water Resources by D.R. Helsel and R.M. Hirsch MINITAB Laboratory 11