NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope...

107
See discussions, stats, and author profiles for this publication at: https://www.researchgate.net/publication/277719484 Nonparametric Tests for Trends in Water-Quality Data Using the Statistical Analysis System (SAS) Technical Report · January 1983 CITATIONS 12 READS 157 3 authors, including: Some of the authors of this publication are also working on these related projects: Publication: Long-Term Changes in Sediment and Nutrient Delivery from Conowingo Dam to Chesapeake Bay: Effects of Reservoir Sedimentation View project Dissolved Oxygen Modeling of Indiana Streams View project Charles G Crawford United States Geological Survey 66 PUBLICATIONS 1,080 CITATIONS SEE PROFILE Robert M. Hirsch United States Geological Survey 86 PUBLICATIONS 10,121 CITATIONS SEE PROFILE All content following this page was uploaded by Charles G Crawford on 05 June 2015. The user has requested enhancement of the downloaded file.

Transcript of NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope...

Page 1: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

See discussions, stats, and author profiles for this publication at: https://www.researchgate.net/publication/277719484

Nonparametric Tests for Trends in Water-Quality Data Using the Statistical

Analysis System (SAS)

Technical Report · January 1983

CITATIONS

12

READS

157

3 authors, including:

Some of the authors of this publication are also working on these related projects:

Publication: Long-Term Changes in Sediment and Nutrient Delivery from Conowingo Dam to Chesapeake Bay: Effects of Reservoir

Sedimentation View project

Dissolved Oxygen Modeling of Indiana Streams View project

Charles G Crawford

United States Geological Survey

66 PUBLICATIONS   1,080 CITATIONS   

SEE PROFILE

Robert M. Hirsch

United States Geological Survey

86 PUBLICATIONS   10,121 CITATIONS   

SEE PROFILE

All content following this page was uploaded by Charles G Crawford on 05 June 2015.

The user has requested enhancement of the downloaded file.

Page 2: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

NONPARAMETRIC TESTS FOR TRENDS IN WATER-QUALITY DATA USING THE STATISTICAL ANALYSIS SYSTEM

by Charles G. Crawford, James R. Slack, and Robert M. Hirsch

U.S. GEOLOGICAL SURVEY Open-File Report 83-550

1983

Page 3: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

U.S. DEPARTMENT OF THE INTERIOR

JAMES G. WATT, Secretary

GEOLOGICAL SURVEY

Dallas L. Peck, Director

For additional information write to: Copies of this report can bepurchased from:

Chief HydrologistU.S. Geological Survey, WRD Open-File Services Section 410 National Center Western Distribution Branch Restion, Virginia 22092 U.S. Geological Survey

Box 25425, Federal Center Lakewood, Colorado 80225 (Telephone: [303] 234-5888)

Page 4: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

TABLE OF CONTENTS

Page

Abstract.................................................................. 1

Introduction.............................................................. 1

Retrieving data from the WATSTORE daily values and water quality files.... 2

Determining the relationship between water-quality constituents and streamf1ow.............................................................. 10

Plotting water-quality data as a time series.............................. 44

Statistical procedures to test for trends in water-quality time series.... 49

Appendix A. PROC SEASKEN user's guide with examples...................... 56

Appendix B. PROC SEASRS user's guide with examples....................... 69

Appendix C. Source code for SAS procedures............................... 82

References................................................................ 101

ILLUSTRATIONS

Figure 1. Example input for WATSTORE retrieval of water-quality data by the QWRETR and QWSAS procedures.................................... 4

2.--Example input for WATSTORE retrieval of streamflow data by theDVRETR and DVINPUT procedures.................................. 6

3.--Example input and output of a SAS procedure to do flow adjust­ ment regressions-abbreviated version........................... 14-21

4.--Example input and output of a SAS procedure to do flow adjust­ ment regressions-extended version.............................. 23-42

5.--Example input and output of SAS statements t plot water-qualitydata and regression residuals as time series................... 45-48

6. Example input and output of SAS statements to do the Seasonal Kendall test and slope estimator procedure on a water-quality data time series............................................... 51-52

7.--Example input and output of SAS statements to do the Seasonal Mann-Whitney-Wilcoxon rank sum test and slope estimator pro­ cedure on a water-quality data time series..................... 54-55

m

Page 5: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

CONTENTS (continued)

Figure Al.--Example input and output using PROC SEASKEN to test fora trend in annual mean streamflow............................. 63-64

A2.--Example input and output using PROC SEASKEN to test fortrends in water-quality constituents.......................... 65-68

Bl.--Example input and output using PROC SEASRS to test for astep in annual mean streamflow................................ 76-77

B2.--Example input and output using PROC SEASRS to test for steptrends in water-quality constituents.......................... 78-81

Cl.--Parsing module for the Seasonal Kendall test and slopeestimator procedure........................................... 83

C2.--Procedure module for the Seasonal Kendall test and slopeestimator procedure........................................... 84-90

C3.--Parsing modeule for the Seasonal Mann-Whitney-Wilcoxon ranksum test and slope estimator procedure........................ 91

C4.--Procedure module for the Seasonal Mann-Whitney-Wilcoxon ranksum test and slope estimator procedure........................ 92-100

iv

Page 6: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

TESTING FOR TRENDS IN WATER-QUALITY DATA USING THE STATISTICAL ANALYSIS SYSTEM

By Charles G. Crawford, James R. Slack, and Robert M. Hirsch

ABSTRACT

Two nonparametric procedures to test for trends in water-quality data

(SEASKEN AND SEASRS) have been developed for the Statistical Analysis System*

(SAS). The procedure SEASKEN tests for a monotonic trend in time by a modified

form of Kendall's tau, the Seasonal Kendall test. The procedure SEASRS tests

for a step trend between two different periods in a time series using a modi­

fied form of the Wilcoxon (Mann-Whitney) rank sum test, the Mann-Whitney-

Wilcoxon rank sum test for seasonal data. Examples are presented using the

two procedures. The source code and user's guide for each of the two procedures

are also presented.

Procedures for flow adjusting water-quality data by the SAS procedures

REG and SYSREG and techniques for plotting water-quality data as a time series

by the SAS procedure PLOT are presented.

Additionally, examples are presented to demonstrate the use of the U.S.

Geological Survey procedures QWRETR, DVRETR, QWSAS, and DVINPUT to retrieve

data from the Geological Survey WATSTORE system and make it available to SAS.

INTRODUCTION

Increased public concern over the quality of the Nation's rivers in the

past several decades has led Federal, State, and local officials to implement

or greatly expand existing water-quality monitoring programs. Examples of

such programs are the Geological Survey's Benchmark and NASQAN networks

(see Briggs, 1978). Most of these monitoring programs have as a goal the

detection of trends in water quality.

* Use of brand and firm trade names in this report is for identification pur­ poses only and does not constitute endorsement by the U.S. Geological Survey.

Page 7: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

Techniques of trend detection in water-quality data have correspondingly

received much attention recently in the literature (see, for example, Fuller

and Tsokos, 1971; Lettenmaier, 1976; and Hirsch and others, 1982). Most of

the trend detection methods presented to date are based on classical (para­

metric) hypothesis testing. However, because of the nature of water-quality

data (typically skewed, serially correlated, and showing seasonality), many

of the assumptions underlying classical hypothesis tests are not met, rendering

them inappropriate. (For a discussion of the problems associated with these

tests, the reader is referred to Smith and others, 1982.) Recently, however,

thinking has begun to shift toward distribution-free (nonparametric) tests

that have less restrictive assumptions than their classical counterparts and

are therefore less sensitive to the distribution of the water-quality time

series.

This report describes procedures in the Statistical Analysis System (SAS)

that can appropriately be used to detect trends in water-quality data. The

report describes the use of both the standard procedures provided with SAS and

two additional procedures, SEASKEN and SEASRS. A working knowledge of SAS by

the reader is assumed. The report was written primarily for user's of the

U.S. Geological Survey's WATSTORE data base and Amdahl computer system; however,

the source code for the SAS macros and procedures are included in the appendices.

The user's guide for the SEASKEN and SEASRS procedures are also included in the

appendices.

RETRIEVING DATA FROM THE WATSTORE DAILY VALUES AND WATER QUALITY FILES

In order to use SAS on water-quality data, it is first necessary to get the

data into a SAS data set. A SAS data set is a collection of data observations

addressable by SAS procedures. Each observation has one or more variables asso­

ciated with it. For more information about SAS data sets, see SAS Institute, Inc.

2

Page 8: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

(1979) or SAS Institute, Inc. (1982a). Data can be entered into a SAS data set

from data cards in the job stream or by reading data stored on disk or tape

files. When using data from the WATSTORE file, one of the standard Survey

retrieval procedures must first be used. One of two Survey applications programs

(PROC QWSAS or the DVINPUT macro) is then called to convert the standard retrieval

output into a SAS data set. PROC QWSAS is a SAS procedure that produces a SAS

data set from the standard water quality file retrieval procedure QWRETR.

PROC QWSAS is described in detail in the WATSTORE user's guide, volume 3,

chapter IV, section R. DVINPUT is a SAS macro that converts output from the

WATSTORE daily values file retrieval, DVRETR, to a SAS 4 ata set. Use of the

DVINPUT macro is described in the WATSTORE message SAS documentation section

(member WRD06). The standard retrieval procedures, DVRETR and QWRETR, are

discussed in the WATSTORE user's guide, volumes 1 and 3, respectively.

Figure 1 shows example input using the QWRETR and QWSAS procedures. This

example retrieves twelve parameters - two streamflow parameters (00060 & 00061)

and ten water-quality constituents - for three stations from the water quality

file. Both daily mean streamflow (parameter code 00060) and instantaneous stream-

flow (00061) should be retrieved. For purposes of this test, the mean streamflow

may be used if the instantaneous streamflow is missing. PROC QWSAS creates a

SAS data set named DATA1 containing the station identification number and the

eleven parameters requested in the QWRETR procedure. The parameter values are

stored in variables named Pnnnnn where nnnnn is the WATSTORE parameter codes

given in the retrieval list. In addition, the variables YEAR, MONTH, DAY, DATE,

DECTIME, and SNAME were requested in the QWSAS statement. The variable DATE is

the day on which the sample was collected, in days since January 1, 1960.

DECTIME is a decimal number representing the time the sample was collected, in

Page 9: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

1 //F1 JOB

2 // CLASS

3 /*SETUP

118545/H

4 //PROCLIB 00 DSNsWRD.PROCLIB/DISP=SHR

5 // EXEC QWRETR/VOL1=118545

6 //HDR.SYSIN 00

*7

M3

1968100119810930

8 XQWSASX

9 R000600006100410006300066500915009250093000940009450095070300

10

0000600006100410006300066500915009250093000940009450095070300

11

0 03276500

12

0 03374100

13

0 03378500

14

/*

15

// EXEC WROSAS

16

//TREND DO DSN = USERI 0.FILENAME/DISP = OLD

17

//SYSIN DO

*18

PROC Qh

/SAS

YEAR MONTH DAY DATE DECTIME SNAME;

19

DATA;SET;IF

P00061=. THEN pooo6i=P0006o;oROp P0

0060

;20

PROC

SO

RT;a

Y STATION

YEAR MONTH

DAY;

21

PROC

PR

INT;

BY ST

ATIO

N;22

VA

R YE

AR MONTH

DAY

DECT

IME

DATE

P0

0061

P0

0410

P0

0630

P0

0665

P0

0915

P0

0925

P009

23

30 P00940 P00945 P00950 P70300;

24

DATA TREND.MONTHLY;SET;

25

/*26

//

Fig

ure

1. E

xam

ple

inpu

t fo

r W

ATST

ORE

retr

iev

al

of w

ater

-qu

alit

y

data

by

the

QW

RETR

and

QW

SAS

proc

edur

es.

Page 10: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

years. These two forms of sample collection time are useful in plotting the

data as time series. Additionally, the variable DATE may be formatted in

several different ways (see SAS Institute, Inc., 1982a, p. 409). SNAME is the

variable containing the station name.

The variable DECTIME is required to use the SAS procedures SEASKEN and

SEASRS. For data sets that do not already include the variable DECTIME, it

can be easily generated using the following statement in a SAS data step:

DECTIME = YEAR(DT)+(JULDATE(DT)-YEAR(DT)*1000)/365;, (1)

where DT is the date the observation was made.

An example use of this is shown in figure 2.

The example in figure 1 also sorts and prints the information retrieved

by station. Finally, the data is stored as file TREND.MONTHLY in the data set

USERID.FILENAME on a direct access device for later analysis. Line 16 describes

the existing file to be used for data storage, and line 24 copies the data to

the disk file. For information on creating disk data sets on the USGS Amdahl

computer system, see the USGS Computer Users Manual, Chapter 5.

To adapt this example input to a specific application, the user will need

to (1) substitute the six digit volume number of the appropriate water quality

back file tape for 118545 in lines 3 and 5; (2) substitute the appropriate re­

trieval dates on the master control card on line 7; (3) change the retrieval and

output list as desired on lines 9 and 10; (4) substitute the desired station

numbers in lines 11 through 13 (and delete or add D cards as required);

(5) substitute an appropriate data set name in the DSN = field on line 16;

and (6) change the variables list in lines 22 and 23 to agree with the parameters

listed in the retrieval list and PROC QWSAS optional variables.

Page 11: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

1 Iff2 JOB

2 II CLASS

3 /*SETUP

115620/H

4 //PROCLId DD DSN=WRD.PROCLIB,DISP=SHR

5 // EXEC DVRETR,AGENCY*USGS*VOL1=115620

6 //HOR.SYSIN DD

*7

M3

1970100119800930

& R000608015480155

9 F00003

10

D 03365500

11

/*12

// EXEC WRDSAS,MACRO=DV*DSNs'&&8KREC',DSNl=NULLFILE,DSN2=NULLFILE

13

//TREND DD DSN=USERID.FILENAME*DISP=OLD

U

//SYSIN DD

*15

DVINPUT _SNAME

16

DATA DATAA<RENAME=<VALUE = P00060» DATAB(RENAME=(VALUE=P80154)) DATAC(RENAME=(VAL

17

UE=P80155»;SET;

18

IF PA

RMCO

DE*6

0 TH

EN OUTPUT DATAA/'

19

IF PA

RMCO

DE=8

0154

THEN OU

TPUT

DA

TA8,

'20

IF PARM

CODE

*801

55 TH

EN OU

TPUT

DATAC;

21

DROP PA

RMCO

DE;

22

PROC

SORT DA

TA=D

ATAA

;BY

STATION

DATE;

23

PROC

SORT DA

TA=D

ATAB

;BY

STATION

DATE;

24

PROC

SORT OATA = DA

TAC;

t3Y

STATION

DATE;

25

DATA

TE

MP/'

flER

GE DATAA

DATA8

DATAC/'BY

STAT

ION

DATE

/'26

FORM

AT DA

TE YY

MMDD

8.;

27

JSJULDATE(DATE);Y=YEAR(DATE);

28

DECT

IME = Y

-KJ-Y*1000)/365;

29

LABEL

P801

54=S

USPE

NDED

SE

DIME

NT CO

NCEN

TRAT

ION

(MG/

L)30

P80155=SUSPENDED SE

DIME

NT DI

SCHA

RGE

(TONS/DAY)

31

P0006U»STREAMFLOU

(CFS);

32

PROC

SORT;aY

STATION

DATE

;33

PROC

PRINT;BY ST

ATIO

N;VA

R DATE DECTIME

P00060 P80154 P80155;

34

DATA

TR

END.

DAIL

Y;SE

T TEMP;

35

/*3o

//

Fig

ure

2.-

-Exa

mple

in

put

for

WAT

STO

RE re

trie

va

l o

f st

ream

-flo

w

data

by

th

e

DVRE

TR

and

DVI

NPU

T p

roce

du

res

Page 12: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

The lines in the QWRETR example in figure 1 do the following:

Line 1. Job control.

2. Class (extension of line 1).

3. Instructs the computer operator to mount the specified backfile

tape.

4. Invokes the WRD cataloged procedure library.

5. Invokes the procedure QWRETR and specifies the mounted backfile

tape to be used in the retrieval.

6. Establishes that data for QWRETR follow.

7. Specifies that data from both the current and backfile are to be

retrieved for the period October 1, 1968, to September 30, 1981.

8. Specifies that QWSAS will be invoked as an application program.

9. Restricts the retrieval to the listed parameters only.

10. Restricts the output list to the listed parameters only.

11-13. Specifies the stations to be included in the retrieval.

14. Job control language step separator card (step delimiter).

15. Invokes the procedure WRDSAS (WRD modified version of SAS).

16. Defines existing direct access data set to be used for storage

of the retrieved data.

17. Establishes that SAS instructions follow.

18. Invokes the procedure QWSAS and requests the variables YEAR,

MONTH, DAY, DATE, DECTIME, and SNAME to be included in the data set

created in line 23 below.

19. Uses mean streamflow (parameter code 00060) if instantaneous

streamflow (00061) is missing, and discards the mean streamflow

parameter.

20. Sorts data set in order of variables listed in BY statement.

21. Prints data set.

7

Page 13: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

22-23. Selects and orders variables to be included in print of data set.

24. Creates file TREND.MONTHLY containing the retrieved data and

stores it in the data set USERID.FILENAME.

£5. Step delimiter.

26. End of job.

Figure 2 shows example input using the DVRETR and DVINPUT macro procedures.

This example retrieves streamflow, suspended-sediment concentration, and suspended-

sediment discharge from the daily values file for one station. The DVINPUT

macro creates a SAS data set containing the station identification number,

parameter code, value, date, and the optional variable requested on the DVINPUT

statement, station name. The variable PARMCODE contains the values of the

WATSTORE parameter codes in the retrieval list. This format of the data set

is awkward since all the variables requested in the retrieval list are combined

into different observations of the variable PARMCODE. The statements in lines

16 through 31 convert the initial SAS data set into one containing the station

identification number, station name, date, P00060, P80154, and P80155. In

addition, lines 27 and 28 add the variables Y (year), J (Julian date), and

DECTIME for each observation, and lines 29 through 31 add variable labels for

suspended-sediment concentration, suspended-sediment discharge, and streamflow.

This example also sorts and prints the data contained in the modified

data set named TEMP. Finally, the data set is stored as the file TREND.DAILY

on the data set USERID.FILENAME on a direct access device.

Note that DVINPUT is a SAS macro and not a SAS procedure. It is not

preceded by the statement PROC or followed by a semicolon.

Page 14: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

To adapt this example setup to a specific application, the user will need

to 1) substitute the six-digit volume number of the appropriate daily values

backfile tape for 115620 in lines 3 and 5; 2) substitute the appropriate

retrieval dates on the master control card on line 7; 3) change the retrieval and

output list as desired on lines 8 and 9; 4) substitute the desired station numbers

in line 10 (add or delete D cards as required); 5) change lines 18-20 and 29-31

appropriately; 6) substitute an appropriate data set name in the DSN = field

on line 13; and 7) change the variable list in line 33 to agree with the para­

meters listed in the retrieval list and the DVINPUT optional variables.

The lines in the DVRETR example input of figure 2 do the following:

Line 1. Job control.

2. Class (extension of line 1).

3. Instructs the computer operator to mount the specified backfile

tape.

4. Invokes the WRD cataloged procedure library.

5. Invokes the procedure DVRETR with AGENCY=USGS being the agency

code and specifies the mounted backfile tape to be used in the

retrieval.

6. Establishes that data cards for DVRETR follow.

7. Establishes that data from both the current and backfile are to

be retrieved for the period October 1, 1970, to September 30, 1980.

8. Restricts the retrieval t@ the listed parameters only.

9. Restricts retrieval to listed statistics codes only.

10. Specifies the station to be included in the retrieval.

11. Step delimiter.

12. Invokes the procedure WRDSAS and defines the temporary data set

containing retrieval data and supplies the macro DV.

Page 15: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

13. Defines existing direct access data set to be used for storage of

the retrieved data.

14. Establishes that SAS instructions follow.

15. Invokes the macro DVINPUT and requests that the variable SNAME

be included in the created SAS data set.

16-31. Converts the SAS data set.

32. Sorts data set in order of variables listed in BY statement.

33. Prints the variables in the VAR statement in the order they are

listed in the VAR statement.

34. Creates file TREND.DAILY containing the retrieved data and stores

it in the data set USERID.FILENAME.

35. Step delimiter.

36. End of job.

DETERMINING THE RELATIONSHIP BETWEEN WATER-QUALITY CONSTITUENTS AND STREAMFLOW

Quite frequently, concentrations of water-quality constituents are related

to streamflow. When a water-quality constituent and streamflow are related,

apparent trends in water quality may be due only to fluctuations in streamflow

rather than to changes in the processes that affect the introduction and fate

of a given constituent in the stream. For example, consider a stream where

dissolved solids and streamflow are negatively correlated. That is, as stream-

flow increases dissolved solids decrease and vice versa. During a period of

drought, high dissolved solids concentrations would be expected. If this period

of drought was followed by a period of wet weather, a decrease in dissolved

solids concentrations would be expected. If such a time series was tested

for trend in dissolved solids concentration, a significant downtrend would be

10

Page 16: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

indicated. However, such a trend could be entirely attributable to the

fluctuation in streamflow during the period. In order to test for trends in

the processes affecting dissolved solids during the period, it would be necessary

to remove the effect of streamflow. Flow adjustment is an attempt to remove

a major source of variation in water quality (streamflow) which may be masking

those variations attributable to changes in the constituent inputs to the

stream or in the processes occurring in the stream.

Smith and others (1982) described a flow-adjustment procedure suitable for

this purpose. Their approach is to develop a time series of flow-adjusted

concentrations (FAC) and to test that series for trend. FAC is defined as theA

actual concentration (C) minus the expected concentration (C) predicted from

the discharge (Q) relationship. The FAC should be randomly distributed with a

mean of zero over the period of record if no change in the processes that

affect the water-quality constituent have occurred. Of course, for some con­

stituents - e.g., biological - adjustment by some other variable - e.g., solar

radiation or air temperature - might be appropriate. Where some of the data

are reported as "less than" a detection limit, these approaches to flow adjust­

ment are not valid. If only a very few values are reported as "less than," then

flow adjustment could be used provided some sensitivity analysis were done to

check that the choice of values to use in place of the "less than" was not very

influential in the overall results.

Some common models used for flow adjustment include the following:

(2) C = a+b Q linearA

(3) C = a+b In (Q) log-linearA

(4) C = a+b 1 hyperbolic, 3 a constant typically in the range1+ SQ 10-3 TH <. 3 j< 102 TJ-1, where TJ is mean discharge

(5) C = a+b 1 inverse

(6) C = a+bQ+bQ quadratic

11

Page 17: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

A good guide to selecting a flow adjustment equation is the R 2 value, butA

one should check plots of the predicted (C) and observed (C) values versus Q

(a log Q scale is usually desirable), and plots of the residual versus the pre­

dicted (Q) to confirm that the relationship fits well and is not excessively

heteroscedastic (e.g., variance increases as predicted concentrated increases).

For many constituents (particularly suspended constituents or biological ones

like bacteria or plankton), these models may be inadequate, because the constituents

are very heteroscedastic. In these cases, models based on fitting the log concen­

trations may be preferred.

Candidate models include the following:

(7) In C = a+b In Q log-log

(8) In C = a+bj In Q+b 2 (In Q) 2 log-quadratic log

Deciding between a model based on concentration (equations 2-6) and one

based on log concentration (equation 7 or 8) should not be based on R 2 values.

Rather, the decision should be based on examination of residuals plots.

If none of the models considered results in a significant fit, as deter­

mined from the probability values for the t statistics in the cases with one

explanatory variable (equations 2-5 or 7) or the probability value of the F

statistic (equations 6 or 8), then no flow adjustment should be performed.

If one of the linear models (equations 2-6) is used, the residuals (Flow/N

Adjusted Concentrations) are defined as C - C. If one of the log models

(equations 7 - 8) is used, the residuals are In C - In C. Note that in the

former case the residuals have the dimensions of C (typically mg/L), but in the

latter case they are dimensionless. This has important implications for the

interpretation of trend test results. If log models are used and a slope is

estimated in Proc SEASKEN, it must be transformed as follows: If B is the slope

12

Page 18: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

value reported by Proc SEASKEN, then (eB-l)-100 is the change in percent per

year. If log models are used and a step change is being considered and 0 is the

difference (mean FAC of period 2 minus mean FAC of period 1), then the percentage

change from period 1 to period 2 would be (eD-l)-lOO.

The following section provides two examples of SAS jobs to search for

appropriate flow adjustment models. The first, using the macro ABREGMAC, simply

estimates the regression equation and computes the usual summary statistics;

the second, using the macro REGMAC, provides extensive diagnostics on the

results. These macros are intended to be illustrative of the kinds of analyses

one may want to run. Knowledge gained by working with a particular data set

should dictate variations of these that one may choose to pursue.

The SAS job listing and output in figure 3 follow the procedures used

by Smith and others (1982) but includes several other models as well. It

considers all of the models defined by equations 2-8. Plots of C versus Q

and log C versus log Q are produced to aid in model selection.

Simple regression is used to estimate the coefficients a and b of each

model, to calculate R 2 (the fraction of the variance of the dependent variable

explained by the given function of Q) and p (the probability of erroneously

rejecting the null hypothesis that b = 0). Bis equal to 10(- 2 « 5 - &*) where B*

is the interger part of log^o^I* where "Q" is the mean streamflow. Eight different

hyperbolic models are generated by incrementing the initial value of B by a

factor of 10°- 5 seven times.

The macro REGDATA (lines 6-43) calculates the necessary functions of Q

needed for the linear regressions. The macro ABREGMAC (lines 44-64) does

the linear regressions using the SAS regression procedure SYSREG (SAS Institute,

Inc., 1979, p. 403). Lines 65-67 create a data set named DATAA with only

sulfate and streamflow data for station 03374100. Line 68 sorts this newly

13

Page 19: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

1 //F3 JOd

2 // CLASS

3 //PROCLld

DD DSN=dK D .

PROCL I

3, D I

SP = SHR

4 //A EXtC WRi)SAS,DSNl=NULLFILE,DSN2 =

5 //TREND OD DSN=USERID.FILENAME,DISP=OLD

6 //SYSIN UD

*Y

MACRO

RE60ATA

8 OPTIONS

NOMA

CROG

EN;

9 PROC MEANS

DA T A= F ILE NAME NOPRINT

MEAN

/'BY

ST

ATIO

N;VA

R P0

0061

,'1

0

OU

TP

UT

O

UT

= i1

EA

NQ

M

EA

N=

M0

00

6i;

11

PROC SORT OATA=MEANQ;SY

STATION;

12

DATA INPDATA;MERGE

MEANQ

FILE

NAME

;BY

STATION;

13

*GET

LOG

OF DE

PEND

ENT

VARI

ABLE

/*14

LN

DEPV

AR = LO

o(DE

PVAR

) ;

15

*GET

LOG

OF TH

E FL

OW;

16

L00061=LOG(P00061);

17

*BETA =

THE INTEGER PORTION OF THE BASE 10 LOG OF THE MEAN FL

OW/'

18

BETA*INT CLOG10(MOOU61 »;

19

*ON = DIFFERENT VALUES USED IN THE HYPERBOLIC FUNCTIONS/'

20

81=10**(-2.5-BETA) ;

21

82 = 81 *10**0.5/'

22

Q3 = B2*1 0**0.5/*

23

B4=B3*10**0.5;

24

B5=B4*1U**0.5;

25

86=85*10**J. 5;

26

07 = B6*10**0.5/'

27

88=87*1 U**0.5/'

26

*HYPERUNQ=DIFFERENT HYPERBOLIC FUNCTIONS/'

29

HYPERdlQ=1/C1+Bl*P00061)

30

HYPERB2Q = 1 /(1

+t32

* P00061 )

31

HYPERB3U=1/(1+U3*P00061

32

HYPERB4Q=1/(1+B4*P00061)

33

HYPERd5Q=1/(1+B5*POU061

34

HYPERB6U=1/(1+B6*P00061)

35

HYPERd7u=1/(1+B7*P00061

36

HYPERd8u=1/(1+B8*P00061

37

*INVQ* THE INVERSE OF THE FLOW/'

38

INVQ = 1/POOJ61/'

39

*Q2=SQUARE OF THE FLOW;

40

Q2 = P00061 **2

/'41

*LQ2 = SQUARE OF THE LOG OF THE FL

OW/'

42

LQ2 = L00061 **2

/'43

PROC SORT DAT A* I

NPD AT A;

BY STATION/'

44

%45

MACRO AdREGMAC

46

OPTIONS NOilACROGEN/'

47

PROC SYSKEb DATA=INPDATA;8Y STATION;

/. n

i T MC

AQ

MO

n( '

i

49

I. OGI. IN: MOO EL

Fig

ure

3.-

-Exa

mple

in

pu

t an

d o

utp

ut

of

a SA

S pro

cedure

to

do

flo

w a

dju

stm

en

t re

gre

ssio

ns'

a

bb

revi

ate

d

ve

rsio

n.

Page 20: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

51

HYPER2:MOD£L DEPVAR=HYPERB2Q;

52

HYPER3:MOOtL OEPVAR = HYPER83Q ;

53

HYPER4:MODEL DEPVAR=HYPER343 ;

54

HYPER5:MOOEL DEPVAR=HYPERB5Q ;

55

HYPER6:MODEL DEPVAR=HYPERB6Q I

56

HYPER7:MODEL DEPVAR = HYPERB7Q ;

57

HYPERb:MODEL OE

P\l A R=H YPE R88Q ;

5tt

IN\/ERS:MODEL DEPV AR= I

NVQ ;

5V

QUAD:

MODbL DE

P\l AR = P00061 «2;

60

LOGLO(,:MOUEL LNO EPVAR = I_00061 ;

61

LO&QAO:HODEL LNOEPVAR=L00061

62

PROC PLOT OATA=INPOATA;BY STATION,

63

PLOT DEPVAR*P00061 ;

64

PLOT LNOEPVAH*L00061;

65

%66

DATA UA

TAA;

SET

TREN

D.MO

NTHL

Y;67

IF ST

ATIO

NS'

0337

4100

;

6tt

KEEP STATION SNAME P00945 P00061;

69

PROC SO

RT;B

Y STATION;

70

MACRO

FILE

NAME

DA

TAAX

71

MACR

O OE

PVAR

P00945%

72

MACRO

LNOE

PVAR

LO

Q9A5

X7.

3 R

EC

iOA

TA

7A

AO

RE

GM

AC

75

/*76

//

Page 21: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

ST

AT

IS

TIC

AL

A

NA

LY

SIS

S

YS

TE

M

ST

AT

ION

ID

EN

TIF

ICA

TIO

N

NU

rBE

R*D

33

74

10

0T

HU

RS

DA

Y,

AU

GU

ST

IB,

HCDE

L:

LINE

AR

DtP

V

AR

: P

00

94

5

SU

LFA

TE

VA

RIA

BL

E

INT

ER

CE

PT

P

00

06

1

MODE

L: LO

GLIN

DE

P

VA

R*

P00945

SU

LFA

TE

VA

RIA

BL

E

INT

ER

CE

PT

L

00

06

1

MP

OE

L:

HY

PE

R1

OF.

P V

AR

: P

00945

SU

LFA

TE

VA

RIA

BL

E

INT

ER

CE

PT

H

YP

ER

B10

MODE

L: HY

PER*

PF

P

VA

R:

P00945

SU

LFA

TE

VA

RIA

BL

E

INT

ER

CE

PT

H

YP

ER

82

0

SS

E

OFE

M

SF

DIS

SO

LV

ED

<

MG

/L

DF 1 1

PA

RA

ME

TE

R

ES

TIM

AT

E

60

.28

88

24

-0

.0005675

SS

E

DFE

M

SE

DIS

SO

LV

ED

C

MG

/L

OF 1 1

PA

RA

ME

TE

R

ES

TIM

AT

E

136*4

55261

-9.3

173B

4

SS

E

DFE

M

SE

DIS

SO

LV

ED

(M

G/L

DF 1 1

PA

RA

ME

TE

R

ES

TIM

AT

E

-1771.4

7

18

31

.05

*

SS

E

OFE

M

SE

DIS

SO

LV

ED

(M

G/L

DF 1 1

PA

RA

ME

TE

R

ES

TIM

AT

E

-54

4.0

97

24

0

604.6

67673

99

81

. 852

96

10

3.9

77

62

9

AS

S

04

)

ST

AN

DA

RD

E

RR

OR

1.4

18811

.000067133B

5

7440.

6P

2

96

77

.50

71

01

A

S

S04

1

STA

ND

AR

D

ER

RO

R

7.4

95

37

6

O.B

21471

9943.3

72

96

103.5

76787

AS

S

D41

ST

AN

DA

RD

E

RR

OR

21

4.7

48

41

4

215.7

27945

9064.2

29

96

10?.7

5238B

A

S

50

5)

ST

AN

DA

RD

E

RR

OR

69.5

6*1

1?

70.5

51800

F R

AT

IOP

RO

B>F

R

-SO

UA

RE

T R

AT

IO

42

.49

25

-B

.45

33

F R

AT

IO

PR

OB

>F

R-S

QU

AR

E

T R

AT

IO

18.2

053

-11

.34

23

F R

AT

IO

PR

OB

>F

R-S

OU

AR

E

T R

AT

IO

-8.2

491

8.4

91

5

F R

AT

IO

PR

3B>

F

R-S

OU

AR

E

T R

AT

IO

-7.B

2I5

B

.57

05

71

.46

0

.00

01

0.4

267

VA

PIA

PL

E

»R

OB

>|T

| L

AB

EL

0.0

001

0.0

00

1

ST

RE

AM

fLO

H,

INS

TA

NT

AN

EO

US

(C

FS

)

12

8.6

5

0.0

001

0.5

727

VA

RIA

BL

E

PR

OB

MT

I L

AB

EL

0.0

00

1

0.0

001

72

.11

0.0

00

1

0.4

28

9

VA

RIA

BL

E

PR

OB

>|T

| LA

BF

L

0.0

00

1

0.0

00

1

73

.45

0.0

001

0.4

335

VA

RIA

BL

E

>R

OB

>|T

| L

AB

fL

0.0

001

0.0

00

1

Page 22: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

ST

AT

IS

TIC

AL

A

NA

LY

SIS

S

YS

TE

M

ST

AT

ION

ID

EN

TIF

ICA

TIO

N

NU

MB

FR

*03374100

15:41 THURSDAY, AUGUST IB, 1983

MO

DEL

: H

YPFR

3

DFP

VA

R:

P00

945

SU

LFA

TF

VA

RIA

BLE

INT

ER

CE

PT

H

YP

ER

B30

MODE

L: HY

PER*

OF

F

VA

R:

P00945

SU

LFA

TE

VA

RIA

BLE

INT

ER

CE

PT

H

YP

ER

B40

MBD

EL:

HYPE

RS

OFF

V

AR

: P

00945

SU

LFA

TE

VA

RIA

BL

E

INT

ER

CE

PT

H

YP

ER

B5Q

MP

DE

L:

HY

PE

R6

PE

P

VA

R:

P00945

SU

LFA

TE

VA

RIA

BLE

INT

ER

CE

PT

H

YP

ER

B60

SS

E

DFE

M

SE

DIS

SO

LV

ED

(M

G/L

OF 1 1

PA

RA

ME

TE

R

ES

TIM

AT

E

-155.2

41972

216.3

7B

395

SSE

DFE

M

SE

DIS

SO

LV

ED

(M

G/L

DF 1 1

PA

RA

ME

TE

R

ES

TIM

AT

E

-30.5

63720

93.2

18221

SS

E

DFE

M

SE

DIS

SO

LV

ED

(M

G/L

DF 1 1

PA

RA

ME

TE

R

ES

TIM

AT

E

11

.60

35

*7

5*

.32

06

65

SS

E

DFE

M

SE

DIS

SO

LV

ED

(M

G/L

DF 1 1

PA

RA

ME

TE

R

ES

TIM

AT

E

2B

. 67

05

*6

44

. 30

35

6?

964*.

02

9

96

1

00

.46

90

55

A

S

S0

4)

ST

AN

DA

RD

E

RR

OR

23

.59

70

84

24.6

09842

91

56

.53

4

96

95.3

P0563

AS

S

04)

ST

AN

DA

RD

E

RR

OR

8.9

33707

10

.01

99

71

8437.5

29

96

87.8

90932

AS

S

04)

ST

AN

DA

RD

E

RR

OR

4.0

93053

5.3

75720

7884.8

15

96

8

2.1

33

48

6

AS

S

04)

ST

AN

DA

RD

E

RR

OR

2.3

55140

4.1

13

5P

3

F R

AT

IO

PR

OB

>F

R

-SO

UA

RE

T R

AT

IO

-6.5

7P

9

B.7

92

4

F R

AT

IO

PR

OB

>F

R

-SQ

UA

RE

T R

AT

IO

-3.4

21

29

.30

33

F R

AT

IO

PR

OB

>F

R

-SO

UA

RE

T R

AT

IO

2.B

B3

B

10

.10

48

F R

AT

IO

PR

OB

>F

R

-SO

UA

RF

T R

AT

IO

12.1

736

10

.77

01

77

.31

0.0

001

0.4

461

PR

OB

>|T

|

0.0

001

0.0

001

86

.55

0.0

001

0.4

74

1

PR

OB

>|T

|

0.0

009

0.0

00

1

10

2.1

10

.00

01

0.5

154

PR

08

>lT

l

0.0

049

0.0

00

1

115.9

9

0.0

001

0.5

47

2

PR

HP

>|T

|

0.0

00

1

0.0

001

VA

RIA

BLE

LA

BE

L

VA

RIA

BLE

L

AB

EL

VA

RIA

BLE

LA

BE

L

VA

RIA

BLE

L

AB

EL

Page 23: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

ST

AT

ION

ID

EN

TIF

ICA

TIO

N

NU

MO

DE

L*

HY

PF

R7

DFP

VAR

: P0

0945

SU

LFA

TE

VA

RIA

BL

E

INT

ER

CE

PT

H

YP

ER

B70

MO

DEL:

HY

PERB

DFP

VAR

: P0

0945

SU

LFA

TE

VA

RIA

BL

E

INT

ER

CE

PT

H

YP

ER

B80

MOD

EL:

INVE

RS

DE

P

VA

R:

P00945

SU

LFA

TE

VA

RIA

BL

E

INT

ER

CE

PT

IN

VO

MO

DEL:

QU

AD

DE

P

VA

R:

P00945

SU

LFA

TE

VA

RIA

BL

E

INT

ER

CE

PT

P

00061

02

SSE

DFE

U

SE

D

ISS

OL

VE

D

(MG

/L

DF 1 I

PA

RA

ME

TE

R

ES

TIM

AT

E

36.9

01791

49.3

06521

SSE

DFE

U

SE

D

ISS

OL

VE

D

(MG

/L

DF 1 1

PA

RA

ME

TE

R

ES

TIM

AT

E

41. 5

62157

72

.20

66

30

SS

E

DFE

M

SE

DIS

SO

LV

ED

(M

G/L

OF 1 1

PA

RA

ME

TE

R

ES

TIM

AT

E

46

.11

72

72

27004.9

2

SS

E

DFE

M

SE

DIS

SO

LV

ED

(M

G/L

DF 1 1 I

PA

RA

ME

TE

R

ES

TIM

AT

E

64

.40

55

30

-0

.00

11

76

88

1.0

6125E

-08

78B

9.6

06

96

P

2.1

83394

AS

504)

ST

AN

DA

RD

E

RR

OR

1.6

78

29

*54.5

80650

8576.0

29

96

P9. 3

33636

AS

S

04

)

ST

AN

DA

RD

E

RR

OR

1.4

21870

7.2

68

46

0

10538.9

7

96

109.7

80918

AS

S

04

I

ST

AN

DA

RD

E

RR

OR

1.2

96412

3514.1

16

PB

25

.4P

2

95

5

2.8

99

80

8

AS

504)

ST

AN

DA

RD

E

RR

OR

1.7

77655

0.0

00184011

3.0

0799E

-09

F R

AT

IO

PR

3B>

F

R-S

QU

AR

F

T R

AT

IO

21.9

B77

10.7

641

F R

AT

IO

PR

OB

>F

R-S

OU

AR

E

T R

AT

IO

29.2

306

9.9

45

2

F R

AT

IO

PR

OB

>F

R-S

QU

AR

E

T R

AT

IO

35.5

730

7.9

124

F R

AT

IO

PR

OB

>F

R-S

QU

AR

E

T R

AT

IO

36.2

306

-6.3

957

3.5

281

11

5.8

7

0.0

001

0.5

46

9

PR

OB

>|T

|

0.0

00

1

0.0

00

1

98.9

1

0.0

00

1

0.5

07

5

PR

OB

XT

I

0.0

00

1

0.0

00

1

62

.61

0.0

00

1

0.3

947

PR

OB

>|T

|

0.0

00

1

0.0

00

1

46

.21

0

.00

01

0

.49

31

PR

OB

>|T

|

0.0

00

1

0.0

00

1

0.0

00

6

15

:41

T

HU

RS

DA

Y,

AU

GU

ST

IS

, 1983

VA

RIA

PL

E

LA

BF

L

VA

RIA

BL

E

LA

BF

L

VA

RIA

BL

E

LA

BE

L

VA

RIA

BL

E

LA

BF

L

ST

RE

AM

FL

OW

, IN

ST

AN

TA

NE

OU

S

(CF

S)

Page 24: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

ST

AT

IS

TIC

AL

A

NA

LY

SIS

S

Y S

T F

ST

AT

ION

ID

EN

TIF

ICA

TIO

N

NU

MB

FR

=0337*1

00

THURSDAY, AUGUST

Jflt

1963

KCDE

L:

LDCI

OG

DfP

V

AR

: L00945

VA

RIA

BLE

INT

ER

CE

PT

L

00

06

1

MCD

EL:

LOGQ

AD

Dtp

VAR

: L0

0945

VA

RIA

BL

E

INT

ER

CE

PT

L

C0

06

1

LO?

DF 1 1

DF 1 1 1

SSE

OFE

U

SE

PA

RA

ME

TE

R

ES

TIM

AT

E

5.5

P2

35

8

-0.1

83890

SS

E

DFE

M

SE

PA

RA

ME

TE

R

ES

TIM

AT

E

4.4

07

20

3

0. 0

82

7*9

-0

.01

*90

1

3.5

7709B

96

0.0

37

26

1

ST

AN

DA

RD

E

RR

OR

0.1

6*3

43

O

.D1

80

12

3.5

30233

95

0.0

37160

ST

AN

DA

RD

E

RR

OR

1.0

59222

0.2

38112

0.0

13269

F R

AT

IO

PR

OB

>F

R

-SQ

UA

RE

T R

AT

IO

33.9

676

-10.2

096

F R

AT

IO

PR

OB

>F

R

-SO

UA

PE

T R

AT

IO

4.1

60

B

0.3

47

5

-1.1

23

0

10

4.2

4

0.0

00

1

0.5

206

PR

On

>|T

|

0.0

00

1

0.0

00

1

52

.89

0

.00

01

0

.52

6B

PR

OB

>lT

l

0.0

00

1

0.7

29

0

0.2

64

3

VA

R1

AP

LE

LA

BF

L

VA

RIA

PL

E

LA

BF

L

Page 25: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

ST

AT

ION

ID

EN

TIF

ICA

TIO

N

NU

KB

FR

*03

37

4 1

00

90.0

80

.0S u L F A

70.0

T r D I 60.0

S S 0 L V

50.0

F.rx

: D

o( M

40.0

G / L A 3

0.0

S S 0 4 2

0.0

<

1

10.0

0.0

<

PLO

T O

F P

00945*P

00061

LE

GE

ND

: A

« 1

DB

S,

B =

? O

BS

, E

TC

.

t-

A AA

A AA A

t A

AA

BA

BB

A A

A A

AB

A A

A

AA

A A

A

AA

AA

AB

B A

B A

AA

A

A A

AA

AA

A

AA

A A

A A

A A

A

A A

A

A A

A

AA

AA

AA

A

AA

A A

A A

AA

A A

AA

A

A A

AA

A A

A

A

\>

0.0

0

9000.0

0

1BO

OO

.OO

P

70

00

.00

3

60

00

.00

45000.0

0

54

00

0.0

0

63090.0

0

7?000.0

0

PIO

OO

.OO

Nfl

TE

«5

PB

S

HA

D

MIS

SlK

'C

VA

LU

ES

STRFAMFLOW, INSTAMT»NFDUS (CF5)

Page 26: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

ro

10

09

45

4.4

4.2

4.0

3.8

3.6

3.4

3.2

3.0

2.8

2.6

* I

ST

AT

IS

TIC

AL

A

NA

LY

SIS

S

YS

TE

M

ST

AT

ION

ID

EN

TIF

ICA

TIO

N

NU

MB

ER

=0

3 3

74

130

PL

OT

O

F

L0

09

45

*L0

00

61

L

EG

EN

DS

A

= 1

OB

S,

B *

2 D

BS

, E

TC

.

15:4

1

TH

UR

SD

AY

, A

UG

US

! IB

, 1

99

3

6

AA

A A

A A

BA

A

A

AA

A

AA

A

A A

A A

AA

A A

A A

AA

A

9 A

A A

A A

AA

A A

A A

A A

A AA

A A

A A

A A

AA

A

AA

AA

A

A

AA

A

A A

AA

A

A A

AA

A

A A

AA

6.0

6.5

7.0

7.5

n.o

8.5

9.0

L00061

9.5

10.0

10.5

1

1.0

1

1.5

12.0

NPTF

: 5

OBS

HAD

MIS

SIN

G V

ALUE

S

Page 27: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

created data set by station and SNAME (sorting by station and SNAME are required

by REGDATA and ABREGMAC). The macros REGDATA and ABREGMAC are written with

dummy names for the data set and dependent variables. Lines 69-71 substitute

the desired data set and variable names into these macros. In this example,

the flow-adjustment procedure will be done on the data set DATAA for the variable

P00945 (sulfate). The macro LNDEPVAR inserts a name for the natural logarithm

of the dependent variable. The argument of this macro may be any unused variable

name the user chooses for the log of the variable given in line 70. The procedures

could have been done on any number of variables by repeating the statements in

lines 69-73 and making changes in the data set and dependent variables. (For

more information on the use of a macro to substitute a variable for dummy

names, see SAS Institute, Inc., 1979, p. 12.) The statement in line 72 executes

the macro REGDATA and the statement in line 73 executes the macro ABREGMAC.

SYSREG (line 46) outputs for each of the models: (1) the error sum of

squares (SSE); (2) the error degrees of freedom (DFE); (3) the error mean square

(MSE); (4) the model F ratio and Prob >F (test and significance probability

that all parameters except the intercept are zero); (5) the model R-square

(R 2 ); and (6) the degrees of freedom, estimate, standard error, and T ratio

and Prob >|T| for parameters in the model. The R-square and Prob >|T| for the

function of Q in the model correspond to the R 2 and p value in the Smith and

others (1982) flow-adjustment procedure. Plots of streamflow versus sulfate,

in both arithmetic and log form, are shown in figure 3.

Figure 4 shows a listing and output of a sample SAS job that does the

flow-adjustment procedure using the macro REGMAC (line 44). In addition to

providing R 2 and p for each model, the program provides several diagnostic

22

Page 28: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

1 //F4 JOB

2 // CLASS>

3 //PROCLIB

DD DSN=WRD.PROCLIB*DISP=SHR

4 //A

EXfc

C WKDSAS,DSN1=NULLFILE*DSN2=NULLFILE

5 //TREND DD DSN=USERID.FILENAME,DISP=OLD

6 //SYSIN DD

*7

MACRO

REGDATA

8 OPTIONS

NOMACROGEN;

9 PROC MEANS

DAT A=

F ILENAME

NOPRINT

MEAN/'BY STATION/'VAR P00061/'

10

OUTP

UT OU

T=ME

ANQ

MEAN

=M00

061;

11

PROC

SORT DATA=MEANU;BY

STAT

ION;

12

DATA

INPDATA;MERGE

MEANQ

FILE

NAME

^Y STATION;

13

*GET LOG

OF DE

PEND

ENT

VARI

ABLE

;14

LNDEPV

AR=L

OG(D

EPVA

R);

15

*GET

LOG

OF THE

FLOW

;16

L00061=LOG(P00061>;

17

*3ETA =

THE INTEGER PORTION OF THE BASE 10 LOG OF THE MEAN FLOW/'

18

BETA=INT(LOb10(M00061));

19

*dN=DIFFERENT VALUES USED IN THE HYPERBOLIC FUNCTIONS;

20

Bl=10**<-2.5-BETA);

21

B2=B1*10**0.5;

22

B3=B2*10**0.5;

23

B4=B3*10**0.5;

24

B5=B4*10**0.5;

25

B6=B5*10**0.5;

26

B7=

B6*1

0**

0.5

;^

2

7

B8=

B7*1

0**

0.5

;00

2

8

*HY

PE

Rd

NQ

= i)I

FF

ER

EN

T

HY

PE

RB

OL

IC

FU

NC

TIO

NS

;29

HY

PE

R61U

=1/(

1+

81*P

00061>

;3

0

HY

PE

RB

2U

= 1

/ (1

+b

2*P

00

06

1);

31

HY

PE

RB

3Q

=1/(

1+

d3*P

00061);

32

HY

PE

RtJ

4Q =

1 /

(1+

84*P

00061 )

;3

3

HY

PE

RB

5Q

=1

/(1

+d

5*P

00

06

1);

34

H

YP

ER

B6Q

=1/(

1+

B6*P

00061);

35

HY

PE

Rd

7Q

=1/(

1+

67*P

00061>

;3

b

HY

PE

RU

8U

=1/(

1+

38*P

00061);

37

*I

NV

Q=

T

HE

IN

VE

RS

E

OF

TH

E

FL

OW

;3

8

INV

Q=

1/P

00061;

39

*U2=

SQ

UA

RE

O

F T

HE

F

LO

W;

40

Q2

=P

00

06

1**

2;

41

*LQ2=SQUAR6 OF THE LOG OF THE FLOW;

42

LQ2=L00061**2;

43

PROC SORT

0 AT A = I NPDAT A; 3Y STATION/'

44

%45

MACRO REGMAC

4b

OPTIONS NOMACROGEN NOOVP/*

47

PROC REG 0ATA = INPDAT A;BY STATION;

48

ID P00061;

49

TITLE OUTPUT FROM MODLABEL:

Y = FLOW/'

50

MOOLAbEL:MODEL

Y =

FLOW

/ R;

Fig

ure

4.--

Exa

mpl

e in

put

and

outp

ut o

f a

SAS

proc

edur

e to

do

flow

adj

ustm

ent

regr

essi

ons

exte

nded

ver

sion

.

Page 29: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

51

OJTPUT UUT = REGOAT1

P = P

R=R STODENT = SR COOKO = COOKD/*

52

PROC SORT

D A

' A = R EGDA T 1

/'BY STATION/*

53

PROC PLOT i)ATA=-REGOAT1

/'BY

STATION/*

54

PLOT P*LOOU61='P' Y*L00061='0'

/ OVERLAY/*

55

PLOT R*P

/ \/REF = 0/*

56

PROC UNIVARIATE OATA = REGOAT1 PLOT NORMAL/'VAR

R/*

57

X5a

DATA DA

TAA;

SET

TREN

O.MO

NTHL

Y;59

IF

ST

ATIONS'

03374100

;60

KEEP

STATION

SNAM

E P0

0945

P00061/*

61

PROC soRTr-av STATION;

62

MACRO FILENAME DATAAX

63

MACRO OEPVAR P00945/.

64

MACRO LNDEPVAR L00945X

65

REGDATA

66

MACRO MOOLABEL LINEARX

67

MACRO

Y DE

Pv/A

R/.

68

MACRO FLOW P00061X

69

REGMAC

70

MACRO MODLAdEL LOGLINX

71

MACRO

Y DEPVARX

72

MACRO FLOW L00061X

73

REGMAC

74

MACRO MOOLABEL LOGLOGX

75

MACRO

Y LNOEPVARX

76

MACRO FLOW L00061X

77

REGMAC

78

/*

79

//

Page 30: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

OU

TP

UT

FR

OM

L

INE

AR

: P

00

94

5-

P00

0f>

1

ST

AT

ION

ID

EN

TIF

ICA

TIO

N

NU

MB

ER

-03374100

16:0

6

TH

UR

SD

AY

, A

UG

US

T 18,

1983

MODE

L: LI

NEAR

OEP

VARI

ABLE

: P0

0945

SU

LF

AT

E

DIS

SO

LV

ED

(M

G/L

A

S

Ul

SO

UR

CE

D

F

MO

DE

L 1

ER

RO

R

96

C

TO

TA

L

97

RO

OT

M

SE

DE

P

ME

AN

C.V

.

VA

RIA

BL

E

DF

INT

ER

CE

P

1P

00

06

1

1

08S

ID

1 12799.9

72

55

89

9.8

93

28399.9

44

92

99

.9

85

15299.9

76

31399.9

37

5989.9

98

3029.9

99

2250.0

01

0

2600.0

011

6360.0

012

1

47

99

.96

13

2

25

00

.00

14

33599.9

31

5

37000.0

016

1

41

00

.00

17

1

17

00

.00

18

47

40

.00

19

7

97

9.9

82

0

11

30

0.0

021

1

42

99

.96

22

23199.9

52

3

20299.9

524

3B

99

9.9

22

5

18099.9

62

6

45

29

9.9

12

7

14899.9

72

8

9709. 9

B2

9

6549.9

930

9

PO

.OO

SU

M

OF

SQ

UA

RE

S

74

29

.98

39981.8

52

17

41

1.8

35

10

.19

69

42

52.0

40815

19

.59

41

2

PA

RA

ME

TE

RE

ST

IMA

TE

60

.28

88

24

-0.0

005675

AC

TU

AL

5P

.OO

O46.0

00

49

.00

05

9.0

00

45

.00

01

7.0

00

53

.00

06

8.0

00

67.0

00

73.0

00

58

.00

05

7.0

00

61

.00

04

2.0

00

44

.00

04

P. 0

00

59.0

00

61.0

00 .

41

.0

00

45

.00

045.0

00

48

.00

03

5.0

00

50.0

00

36

.00

064.0

00

53

.00

056.0

00

60

.00

0

MF

AN

SQ

UA

RE

74

29

. 9P

31

D3

.97

8

R-S

QU

AR

FA

DJ

R-S

O

ST

AN

DA

RD

F V

ALU

E

71

.45

9

0.4

267

0.4

207

T FO

R

HO

SE

RR

OR

P

AR

AM

ET

ER

-0

1.4

18

81

1.0

00

06

71

33

85

PR

ED

ICT

S

TP

F

PR

VA

LUE

P

RE

DIC

T

53.0

25

1.0

37

28

.56

6

2.9

62

44.1

72

55

.01

151.6

06

42.4

69

56

.89

05

8.5

69

59.0

12

58.8

13

56.6

80

51

.89

047.5

20

41.2

21

39.2

91

52.2

87

53.6

49

57

.59

955.7

60

53.8

76

52

.17

447.1

23

48

.76

93

P.1

56

50.0

17

34

.58

15

1.8

33

54.7

78

56

.57

25

9.7

33

.38

8.0

68

.031

.531

.179

.26

7.3

19

.30

5.1

67

.030

.16

1.6

43

.82

6.0

30

.04

7.2

22

.120

.053

.03

0.1

P3

.100

.939

.05

fl.3

Gfl

.03

0.o

no.1

61

.37

4

42

.49

?-B

.45

3

RE

SID

UA

L

4.9

75

17.4

34

4.R

2B

3.

989

-6.6

06

-25.4

69

-3.8

90

9.4

31

7.9

88

14.1

87

1.3

20

5.1

10

13.4

BO

0.7

79120

4.7

09

-4.2

87

5.3

51

3.4

01 .

-12.8

76

-7.1

74

-2.1

23

-.768611

-3.1

56

-.017103

3.4

1*>

12

.16

7-1

.77

8-.

571709

0.?

67

??

5

PR

OB

>F

0

PR

OB

0 0

ST

D

ER

RR

ES

IDU

AL

10.1

44

9.7

57

10.1

02

10

.13

910.1

45

10

.0R

11

0.1

29

10

.11

510.1

11

10.1

13

10

.13

01

0.1

45

10

.13

11

0.0

64

19.0

32

10

.14

510.1

43

10.1

23 .

10.1

42

10

.14

510.1

28

10

.13

710.0

11

10.1

42

9.9

32

10

.14

51

0.1

40

10.1

31

10.1

04

.00

01

VA

RIA

BL

E>

|T

| L

AB

EL

.0001

INT

ER

CE

PT

.00

01

S

TR

EA

MF

LO

H,

INS

TA

NT

AN

EO

US

(C

FS

I

ST

UD

EN

T

CO

OK

»SR

ES

IDU

AL

-2-1

-0

1 2

0.4

90

1.7

87

0.4

78

0.3

93

-0.6

51

-2.5

26

-0.3

R4

0.9

32

0.7

90

1.4

03

0.1

30

0.5

04

1.3

31

0.0

77

0.4

69

-0.4

23

0.5

28

0.3

36

.-1

.27

0-0

.707

-0.2

10

-0.0

76

-0.3

15

-0.0

02

0.3

44

1.1

99

-0.1

75

-0.0

56

0.0

26

1 |***

1 1*|

****

*!1 1* 1* 1

**1 1* 1** *

** *

**

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

D

.00

1.1

47

.00

2.0

01

.00

2.0

74

.001

.007

.00

5.0

16

.000

.001

.01

2.0

00

.00

4.0

01

.00

1.0

01

. .00

9.0

03

.00

0.0

00

.00

2.0

00

.00

3.0

07

.00

0.0

00

.00

0

Page 31: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

PUTP

UT

FROM

LIN

EAR:

p

otm

s*

pooo

ftiS

TA

TIO

N

IDE

NT

IFIC

AT

ION

N

UM

BF

R=

03374

100

IM0

6

TH

UR

SD

AY

, A

UG

US

T

18,

19

B3

CTl

DB

S

ID

31

23?0.0

03?

1860.0

03

3

2930.0

03

* 8

37

9.^

835

11099.9

736

4

66

00

.00

37

46

59

9.9

13

8

12699.9

73

9

3759.9

94

0

4899.9

941

3709.9

94

2

40

99

.99

43

1040.0

044

2790.0

04

5

19P

O.O

O4

6

51

4.0

04

7

57

4.0

04

6

25000.0

049

31200.0

050

80

90

.00

51

31

00

.00

52

3

09

9.9

95

3

3440.0

05

4

16P

O.O

O55

18

10

.00

56

9860.0

057

2840.0

05

8

33800.0

059

10700.0

060

56

20

.00

61

9220.0

06

2

19000.0

063

17

00

0.0

064

7320.0

065

82

90

.00

66

11000.0

06

7

37

70

.00

68

3

18

0.0

069

31

60

0.0

07

0

32

20

0.0

071

8

60

0.0

072

76

00

0.0

07

3

30400.0

074

13700.0

07

5

93

50

.00

76

6R

20

.00

77

6

00

0.0

07

8

68400.0

07

9

41100.0

08

0

74

10

.00

81

10

20

0.0

08

2

54

90

0.0

083

5440.0

0

AC

TU

AL

65.0

00

77

.00

066.0

00

60

.00

051.0

00

33.0

00

53.0

00

65

.00

05

0.0

00

46

.00

060.0

00

63

.00

07

0.0

00

82.0

00

BP

.OO

O83.0

00

35.0

00

3P

.OO

O5

0.0

00

56.0

00

65

.00

05

6.0

00

56

.00

04

2.0

00

66

.00

037.0

00

54.0

00

64.0

00

63.0

00

51.0

00

57

.00

06

3.0

00

69

.00

033.0

00

35.0

00

62

.00

0 .3

6.0

00

54

.00

030.0

00

41.0

00

50

.00

050.0

00

45

.00

04

9.0

00

26

.00

03

4.0

00

45.0

00

42.0

00

31

.00

040.0

00

PR

ED

ICT

S

TD

E

RR

VA

LUE

P

RE

DIC

T

58

.97

2*9

.233

5P

.62

65

5.5

33

53.9

90

33.8

43

33

.84

35

3.0

82

58

.15

557.5

08

5P

.1B

357.9

62

59.6

99

5R

.706

59

.16

55

9.9

97

59.9

63

46.1

01

42.5

83

55.6

98

58

.53

05R

.530

5P

.337

59

.33

55

9.2

62

54.6

93

5P

.677

41

.10

75

4.2

17

57

.09

955.0

56

49

.50

650.6

41

56

.13

55

5.5

90

54.0

46

58

.14

95

P.4

84

42.3

56

42.0

15

55.4

08

17.1

59

43.0

37

52

.51

45

4.9

83

5<

.418

56.8

84

21.4

72

36.9

65

56.0

84

54.5

00

.317

.336

.29

1.1

10

.05

6.3

86

.38

6.0

37

.25

9.2

16

.26

1.2

46

.37

2.2

97

.33

1.3

95

.393

.24

7.5

21

.117

.28

5.2

85

.27

1.3

44

.338

.077

.29

5.6

53

.06

2.1

91

.09

0.0

73

.043

.138

.11

2.0

57

.25

8.2

PI

.54

1.5

71

.13

4.2

53

.48

2.0

32

.087

.15

3.1

79

.760

.060

.13

6.0

70

29.1

33

2.8

99

57.2

02

1.1

97

RE

SID

UA

L

6.0

28

17

.76

77

.37

44.4

67

-2.9

90

-.P

43

34

7 .-.

081596

6.8

45

-7.5

08

-12.1

83

2.0

38

3.3

01

11

.29

422.8

35

28

.00

323.0

37

-11 .

101

-4.5

93

-5.6

98

-2.5

30 .

6.6

63

-3.3

35

-3.2

62

-12.6

93

7.3

23

-4.1

07

-.216579

6.9

01

7.9

44

1.4

94

6.3

59

6.8

65

13

.41

0-2

1.0

46

-23

.14

93.5

16 .

-6.0

15

-I. 4

08

12

.84

1-2

.03

7-2

.514

-4.9

83

-11

.4JP

-7.8

B4

4.5

28

-?.9

65

-11.0

84

-12

.50

01

.86

7-1

7.2

02

ST

D

ER

RR

ES

IDU

AL

10

.11

210.1

09

10.1

15

10

.13

610.1

42

9.9

14 .

10

.14

410.1

19

10

.12

41

0.1

19

10.1

21

13.1

04

10

.11

41

0.1

10

10

.10

11

0.1

01

10.1

20

10.0

P3

10.1

36

10.1

16 .

10

.11

710.

10

819.1

09

10

.14

010.1

14

10

.06

210.1

42

10

.12

71

0.1

39

10.1

40

10

.14

310.1

33

10.1

36

10.1

42

10.1

19

10.1

16 .

10

.07

5ID

. 1

37

9.2

68

10

.08

91

3.1

45

10.1

39

10.1

32

10.1

29

9.4

78

9.9

P7

10

.13

410.1

41

9.7

76

10.1

?f

ST

UD

EN

T

CO

OK

'SR

ES

IDU

AL

-2-1

-0

1 2

D

0.5

96

1.7

58

0.7

29

0.4

41

-0.2

95

-0.0

85

-0.0

08

0.6

76

-0.7

42

-1.2

34

0.2

01

0.3

27

1.1

17

2.2

59

2.7

72

2.2

81

-1.0

97

-0.4

55

-0.5

62

-0.2

50

.0

.65

9-0

.330

-0.3

23

-1.2

52

0.7

24

-0.4

08

-0.0

21

0.6

81

0.7

83

0.1

47

0.6

27

0.6

77

1.3

23

-2.0

75

-2.2

88

0.3

48

.-0

.59

7-0

.13

91.3

86

-0.2

02

-0.2

48

-0.4

91

-1.1

27

-0.7

78

0.4

79

-0.2

97

-1.0

94

-1.2

33

0.1

91

-1.6

99

1*

|***

1*

| 1 1 1 1*

*l

**l 1 1 |*

*1

****

(++

***

1+

** +

**l 1

*l 1 1

*1 1

**! 1* 1 1 1* 1* 1 1* 1* 1*

*+ *

**!

****

*

**

+ * * ** *+ +**

0.0

03

0.0

27

0.0

04

0.0

01

0.0

00

0.0

00

0.0

00

0.0

34

0.0

04

0.0

11

0.0

30

0.0

01

0.0

10

0.0

44

0.3

73

0.3

49

0.0

09

0.3

32

0.0

02

3.0

01

.0

.00

33

.03

10.0

01

0.0

09

0.0

04

0.0

32

0.0

00

0.0

03

0.0

04

0.0

00

0.0

32

0.0

33

0.0

11

0.0

23

0.3

40

0.0

31

0.3

34

0.0

00

0.2

02

0.0

00

0.0

00

0.0

01

O.O

DB

0.0

04

0.0

18

D.O

O?

O.O

OP

O.O

OR

0.0

02

0.0

20

Page 32: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

OU

TP

UT

FR

OM

L

INE

AR

: P

00945=

P

00061

ST

AT

ION

ID

EN

TIF

ICA

TIO

N

NU

MB

ER

=0337*1

00

16

:06

T

HU

RS

DA

r,

AU

GU

ST

IB

, 19P

3

08

S 84

85

66

87

88

89

90

91 92

93

94

95

96

97

98

99

100

101

102

10

3

ID

18100.0

04

98

00

.00

16

50

0.0

014800.0

09500.0

06000.0

07

58

0.0

03

20

0.0

02

50

0.0

02050.0

03170.0

01

65

0.0

014600.0

05780.0

01

28

00

.00

24100.0

011200.0

06

16

0.0

04

88

0.0

02

86

0.0

0

AC

TU

AL

4P

.OO

O35.0

00

45.0

00

39.0

00

45.0

00 .

2«».0

00

56

.00

071.0

00

64

.00

06

7.0

00

74

.00

044.0

00

54

.00

04

P.O

OO

45

.00

04

0.0

00

62.0

00

36

.00

061.0

00

PR

ED

ICT

S

TD

E

RR

VA

LUE

P

RF

DIC

T

50.0

17

1.0

58

32

.02

7

?.5

82

50.9

25

51.8

90

54.8

9B

56.8

84

55

.98

758.4

73

5P

.B7

059.1

25

5P

.490

59

.35

252.0

03

57.0

09

53.0

25

46

.61

25

3.9

33

55.6

58

57.5

19

5P

.666

.03

8.0

30

.08

4.1

79

.131

.28

1.3

09

.328

.28

2.3

45

.030

.186

.03

7.2

14

.05

4.1

15

.217

.294

RE

SID

UA

L

-2.0

17

2.9

73

-5.9

25

-12

.P9

0-9

.89

8 .-2

6.9

87

-2.4

73

12

.13

04.8

75

6.5

10

14.6

46

-8.0

03

-3.0

09

-5.0

25

-1.6

12

-13

.93

36

.34

2-2

1.5

19

2.3

34

ST

D

ER

RR

ES

IDU

AL

10

.14

29.8

65

10

.14

410.1

45

10.1

39 .

10

.13

41

0.1

16

10.1

13

10

.11

010.1

16

10

.10

610.1

45

10.1

26

10.1

44

10.1

24

10.1

42

10

.13

610.1

24

10.1

14

ST

UD

EN

T

CO

OK

'SR

ES

IDU

AL

-2

-1-0

1

2

D

-0.1

99

0.3

01

-0.5

84

-1.2

71

-0.9

76

.-2

.66

3-0

.24

41

.19

90

.48

20

.64

11.4

49

-0.7

89

-0.2

97

-0.4

95

-0.1

59

-1.3

74

0.6

26

-2.1

26

0.2

31

*** *

*****

|**

1 1*

|**

*| 1 1 1

**| 1

***

**! 1

0.0

00

0.0

03

0.0

02

O.O

OP

0.0

05

.0

.04

40.0

00

0.0

12

0.0

02

0.0

06

0.0

19

0.0

03

0.0

01

0.0

01

0.0

00

0.0

10

0.0

02

0.0

33

0.0

00

SIM

O

F R

ES

IDU

AL

SS

UH

O

F S

QU

AR

ED

P

FS

IDU

AL

S1.0

1608E

-12

9981.8

52

Page 33: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

90

80 70

R 60

E D I C T 50

F L U

F

30 ?0 10 0 * - »-

5.0

OUTP

JT FROM L

INEA

R: POO?**-

pooo6i

ST

AT

ION

ID

EN

TIF

ICA

TIO

N

NU

MB

ER

-0337*1

30

1M

06

T

HU

RS

DA

Y,

AU

GU

ST

IB,

19

83

PLO

T O

F P

*L0

00

61

P

LOT

OF

P0

09

A5

*L0

00

61

SY

MB

OL

US

FD

IS

P S

YM

BO

L U

SE

D

IS

0

0

PP

0

0

pppp

ppp

00

0

000

00

0

0

0 0

0

00

0 P

PP

P

PP

P

PP

P

PP

P

P

000

0

00 0

00

0pp

pppp

pp

P0

PP

PP

P

PD

PPP

n0

0

0 P

PP

P0

0

0

P P

P

0oo

D

o no

OP

P0

PP

0

00

0 O

PP

P

DO

P

OO

P

0 0

0

OP

0

0 0

PP

P D P

.-4-,

5.5

-.4

-.

6.0

.-4-.

8.5

.< 4

-.

10

.5

.-.4

-.

11.0

6.5

7.0

7.5

P.O

100061

9.0

10.3

NO

TE

t5

OB

S

HA

D

MIS

S1N

C

VA

LU

ES

A

7 D

BS

H

IOO

TN

Page 34: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

30

*

25 15 10

R 5

E S I D 0

rxD

u

10

A L S -5

-10

-15

-20

-25

OUTP

UT

FPDP

LIN

EAR

: PO

OM

POOO

&J

STAT

ION

IDEN

TIFI

CAT

ION

NUM

BER

=033

7* 1

00

PLOT

OF

R*P

LFG

FND:

A

= i

OPS

, B

« ?

DBS,

FT

C.

16:0

6

TH

UR

SD

AY

, A

UG

US

T IP

, 1983

A

A

A AA

AA

A A A A

A A

BA

A AA

A

AA

A

AA

A

A A

AA

AA

A A

A. A

--A

--A

A

-- /

A A

A A

A A

AA

A

PA

A B

A A

A A

AB

A A

AA

A AA

A A

A

-30

« ..-4. 4

- -. 4

- 4

4 4

.

12

14

16

16

20

22.4

-. 4

. -4-- »-

!4

26

2B

30.-

4- -..4

.... 4

-- 4

- -4---- » -

»

3?

34

36

3R

40

4?

44

PR

FO

ICT

ED

V

ALU

F

.-4.. _

-_4- _

__4__ 4

..4

.. ..4

.. 4

- 4

-

46

4B

50

5?

54

56

5B

60

NO

TF

t 5

OP

S

H/0

H

ISS

ING

V

AL

UE

S

Page 35: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

VA

RIA

BL

ES

RE

SID

UA

LS

MO

ME

NTS

M ME

AN

STD

D

EV

SK

FH

NE

SS

U5S cv TS

ME

AN

'OS

CN

R

AN

KN

UM

t*

0

DtN

OR

MA

L

9P1.0

37E

-14

10. 1*4

?-0

.13

09

21

99

81

.85

9.7

P4E

+16

1.0

12

E-1

469.5 9P

0.0

652879

SUM

W

GTS

SUM

VA

RIA

NC

EK

UR

TO

SIS

ess

STD

M

EA

NP

PO

n>

|T|

PR

PB

XS

I

PR

OB

>D

9B1.0

16F

-1?

10

?. 9

06

0.6

60651

9981.8

51

.02

47

? 1C

.P0

68

38

>0.1

5

GO o

ST

EM

L

EA

F

92

B 1

2 3

3

21

578

31

12

23

33

4

70

5

55

55

55

66

67

77

77

78

89

9

20

0

11

12

22

33

33

44

4

13

-0

44433

33

33

33

22

22

22

11

11

00

00

25

-0

flB

«77666555

11-1

4

33

33

21110

10-1

7

1

-2

321

3-2

75

2

_. .4 ..-4 4-. 4 .«

MU

LT

IPL

Y

ST

FM

.LF

AF

B

Y

10

**+

01

OUTP

UT FR

OM L

INEAR: poo?45*

POOOSI

UNIVARIATE

OUAMTILES(nEF«4)

16:06 THURSDAY, AUGUST IB, 19P3

EX

TR

EM

ES

100J

C

MA

X

28.0

029

75

* 0

3

6.3

4615

50?

M

ED

-0

.14

90

89

25*

010*

MIN

RANGE

03-01

MODE

-5.19306

-26.9872

54.99

11.5392

-26.9872

MISSING VALUE

COUNT

5 X

COUNT/MOBS

4.85

BOXPLOT

0 I I I

27.5+

II

99*

95*

90*

10* 5* 1*

28.0029

17.4509

12.B9R

-12.7116

-21.07

-26.9872

LOWEST

-26.9872

-25.4694

-23.1493

-21.5194

-21.0463

NORMAL PROBABILITY PLOT

* *

4******

*******

4*****

*******

******

*****4

*****

* ***

27.5**

* -2

-1

«0

«1

*2

HIGHFST

17.4343

17. 7*67

22.B34B

23.0369

28.0029

Page 36: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

OUTP

UT

FROM

LO

GLI

N:

poo9

4*=

ST

AT

ION

ID

EN

TIF

ICA

TIO

N

NU

HB

FR

=0

33

74

10

01

6:0

6

TH

UR

SD

AY

, A

UG

US

T IB

, 1983

MOD

EL:

LOG

LIN

Dfp

VAR

IABL

E:

P009

45S

UL

FA

TE

D

ISS

DIV

ED

(M

G/L

A

S

SO

*)

SC

UR

CE

O

F

MP

DE

L 1

FRR

OR

9

6C

T

OT

AL

9

7

RO

OT

M

SE

OE

P

ME

AN

C.V

.

VA

RIA

BLE

O

F

1NT

ER

CF

P

11

00

06

1

, 1

DB

S

ID

1 1

27

99

.97

2 55899.8

93

28

39

9.9

4*

92

99

.9

B5

15299.9

76

31

39

9.9

37

59P

9.9

9B

30

29

.99

9 2250.0

01

0

26

00

.00

11

6360.0

012

1

47

99

.96

13

22500.0

014

33599.9

31

5

37000.0

016

1

41

00

.00

17

11700.0

0IB

4

74

0.0

01

9

7979.9

820

11

30

0.0

021

14299.9

622

23199.9

52

3

20

29

9.9

524

38999.9

22

5

18099.9

626

45299.9

127

14899.9

728

9 709 .9

829

6549.9

93

0

980.0

0

SU

M

OF

SQ

UA

RE

S

9971.1

54

74

40

.68

217411.8

35

8. 8

03

81

25

2.0

40

81

51

6.9

17

13

PA

RA

HF

TF

RE

ST

IMA

TE

136.4

55

-9.3

17

38

4

AC

TU

AL

5P

.OO

O46.0

00

49

.00

059.0

00

45

.00

017.0

00

53

.00

06

8 .

00

06

7.0

00

73.0

00

58

.00

057.0

00

61

.00

04

2.0

00

44

.00

04

P. 0

00

59.0

00

61.0

00 .

41.0

00

45

.00

04

5.0

00

48

.00

035.0

00

50

.00

038.0

00

64.0

00

53

.00

05

6.0

00

60

.00

0

ME

/>N

SO

UA

PE

99

71

.1

54

77.5

07101

R-S

QU

AF

FA

DJ

R-S

O

ST

AN

DA

RD

T

F V

ALU

E

128. 64B

0.5

72

70

.56

82

FO

R

HO

:E

RR

OR

P

AR

AH

ET

ER

«0

7.4

95376

0.8

21471

PR

ED

ICT

S

TD

E

RR

VA

LU

E

PR

FD

ICT

48.3

39

0.9

47318

34

.60

4

1.7

76

40.9

13

1.3

24

51

.31

5

0.8

91618

46.6

77

1.0

07

39.9

78

1.3

B6

55.4

14

0.9

37

73

1*1

.764

1.2

35

64

.53

7

1.4

16

63

.19

0

1.3

26

54

.85

6

0.9

23297

46

.98

6

0.9

94729

43.0

83

1.1

89

39.3

47

1.4

29

38.4

49

1.4

92

47

.43

8

0.9

77546

49

.17

6

0.9

24

4B

P57.5

95

1.0

15

52.7

41

0.8

91462

49.5

00

0.9

17094

47.3

06

D.9

P2

40

54

2.7

98

.2

06

44.0

42

.13

53

7.9

58

.5

27

45

.11

1

.079

36.5

63

.62

946.9

23

0.9

97220

50.9

13

D.

?4

85

954.5

81

0.9

17093

72.2

81

1.9

94

18.2

05

-11.3

42

RF

SID

UA

L

9.6

61

11

.39

68. 086

7. 685

-1.6

77

-22

.97

8-2

.414

6.2

36

2.4

63

9.8

10

3.1

44

10

.01

41

7.9

17

2.6

53

5.5

51

C. 562374

9.8

24

3.4

05 .

-8.5

00

-2.3

06

2.2

02

3.9

58

-2.9

5R

4.8

89

1.4

37

17.0

77

2.0

87

1.4

19

-i?

.?n

i

PR

OB

>F

0.0

00

1

VA

RIA

BLE

PR

OB

>

|Tl

LA

B^L

0.0

00

1

INT

ER

CE

PT

0.0

00

1

ST

D

ER

R

ST

UD

EN

T

CO

OK

'SR

ES

IDU

AL

RE

SID

UA

L

-2-1

-0

1 2

0

B.7

53

1.1

04

B.6

23

1.3

22

B.7

04

0

.92

9B

.759

0.8

77

B.7

46

-0

.19

29

. 6

*4

-2.6

43

B.7

54

-0

.27

6B

.71

7

0.7

15

S.6

99

0.2

83

B.7

03

1.1

27

8.7

55

0.3

59

9.7

47

1

.14

58.7

23

2.0

54

8.6

97

0.3

05

B.6

76

0

.64

0B

.749

0.0

64

9.7

55

1

.12

28

.74

5

0.3

B9

. .

8.7

*6

-0

.97

1B

.7«

9

-0.2

64

8.7

21

0.2

53

B.7

30

0.4

53

8.6

70

-0

.34

1B

.73

7

0.5

60

S.6

52

0.1

66

9.7

47

1

.95

29.7

«*

0.2

38

8.7

*6

0

.16

29.5

75

-1.4

32

1**

1**

1*

1*

1+

++

*+! 1 1* 1 1

**1 1

**1

****

1 1* 1 1**

1

*l1 1 1 1 1* 1 |*

**1 1

*+|

0.0

07

0.0

37

0.0

10

0.0

04

0.0

00

O.O

B9

0.0

00

0.0

05

0.0

01

0.0

15

0.0

01

O.O

DB

0.0

39

0.0

01

0.0

06

0.0

00

0.0

07

0.0

01

.0

.00

50

.00

00.0

01

0.0

02

0.0

02

0.0

02

0.0

00

0.0

?5

0.0

00

0.0

00

0.0

55

Page 37: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

OUTPUT FROM LOGLIN: P00945= LOOOM

STATION IDENTIFICATION NUMBFS=03374100

16806 THURSDAY, AUGUST 1R, 1993

DB

S

ID

31

23

20

.00

32

1

86

0.0

033

29

30

.00

34

83

79

.9B

35

11099.9

73

6

46

60

0.0

03

7

46

59

9.9

138

12699.0

739

37

59

.99

40

4899.9

941

3709.9

942

4099.9

943

10

40

.00

44

2790.0

045

19

60

.00

46

5

14

.00

47

57

4.0

04

8

25000.0

04

9

31200.0

05

0

8090.0

051

3100.0

05

2

3099.9

95

3

3440.0

054

16B

O.O

O5

5

1810.0

05

6

9860.0

057

2840.0

05B

33000.0

05

9

10700.0

06

0

5620.0

061

9220.0

06

2

19

00

0.0

06

3

17000.0

064

7320.0

06

5

82

80

.00

66

11

00

0.0

067

3770.0

06

8

3180.0

06

9

31

60

0.0

07

0

32200.0

071

8600.0

07

2

76000.0

073

30400.0

074

1

37

00

.00

75

9350.0

07

6

6820.0

077

6000.0

07

8

68400.0

07

9

41100.0

08

0

74

10

.00

81

10200.0

082

54900.0

08

3

5440.0

0

AC

TU

AL

65

.00

07

7.0

00

66.0

00

60

.00

05

1.0

00

33.0

00 .

53

.00

06

5.0

00

50.0

00

46

.00

06

0.0

00

63.0

00

70

.00

0B

2.0

00

86.0

00

83

.00

03

5.0

00

38

.00

05

0.0

00

56.0

00 »

65.0

00

56.0

00

56

.00

04

2.0

00

66

.00

037.0

00

54

.00

06

4.0

00

63

.00

051.0

00

57.0

00

63

.00

06

9.0

00

33

.00

03

5.0

00

62

.00

0 .3

6.0

00

54

.00

030.0

00

41.0

00

50

.00

050.0

00

45.0

00

49

.00

026.0

00

34.0

00

45

.00

042.0

00

31 .

00

040.0

00

PR

ED

ICT

S

TD

E

RR

VA

LUE

P

RE

DIC

T

64

.25

26

6.3

11

62.0

77

52

.28

6

0.8

49.6

67

0.9

36.2

99

36.2

99

4P

.41

2

0.9

59.7

53

57.2

86

59.8

78

58

.94

67

1.7

28

62.5

33

65.7

28

76

.29

477.2

65

42

.10

240.0

37

52.6

14

O.B

61

.55

16

1.5

51

60

.58

267.2

59

66.5

65

50.7

70

0 .8

62.3

68

39.2

92

.396

.541

.25

5F

95

P1

36

21

.64

8.6

4P

5116

.119

.00

2.1

26

.078

.950

.28

3.4

99

.400

.39

5.2

49

.382

0753

.22

2.2

22

.16

5.6

10

.559

6346

.27

3.4

33

50.0

09

0.9

071R

956.0

08

0.9

55634

51

.39

6

O.B

91

13

744.6

59

1.1

02

45.6

95

1.0

51

53.5

46

0.8

99163

52

.39

8

O.B

P9

87

54

9.7

51

0.9

11947

59.7

28

I. IIP

61.3

14

1.2

06

39.9

19

1.3

90

39

.74

3

1.4

02

52.0

44

0.8

P9319

31

.74

2

1.9

9P

40.2

79

1.3

66

47

.70

6

0.9

f7970

51.2

65

0.8

91

94

554.2

05

0.9

C9

55

B55.3

99

0.9

37297

32.7

24

1.9

21

37.4

70

1.5

t253.4

32

0.8

97737

50.4

54

0.9

002T

>0

34

.77

2

1.7

63

56.3

11

0.9

6*7

42

RE

SID

UA

L

0.7

4P

13

61

0.6

09

3.9

23

7.7

14

1.3

33

-3.2

99 .

4.5

08

5.2

47

-7.2

B6

-13

.B7

B1

.05

4-8

.72B

7.4

67

16

.27

29

.70

65.7

35

-7.1

02

-2.0

37

-2.6

14

-5.5

51 ,

4.4

18

-11.2

59

-10

.56

5-8

.770

3.6

32

-2.2

92

3.9

91

7.9

92

11.6

04

6.3

41

11.3

05

9.4

54

16.6

02

-16.7

51

-24.7

2B

0.6

86

05

4 .-3

.74

31.9

56

-1.7

42

0.7

20620

2.2

94

-1.2

65

-9.2

05

-6.3

99

-6.7

24

-3.4

70

-0.4

32

-P.

45

4-3

.77

2-1

6.3

11

ST

D

EP

RR

ES

IDU

AL

B.6

92

B.6

6B

fl.7

14

8.7

59

9.7

56

9.6

48

8.7

53

8.7

32

8.7

47

B.7

31

B.7

3P

8.5

P5

8.7

10

B.6

75

8.4

47

8.4

72

9.7

15

8.6

95

8.7

59

9.7

19

B.7

26

8.6

55

8.6

65

8.7

5B

8.7

11

9.6

96

9.7

57

9.7

52

8.7

59

B.7

35

8.7

41

B.7

5B

B.7

59

8.7

56

8.7

33

8.7

21 .

B.6

91

B.7

59

8.5

74

B.6

97

8.7

50

9.7

59

B.7

57

fl.7

54

8.5

92

B.6

64

B.7

5P

8.7

5P

8.6

25

9.7

51

ST

UD

EN

T

CO

PK

'SR

ES

IDU

AL

-2-1

-0

I 2

D

0.0

86

1.2

33

0.4

50

O.B

B1

0.1

52

-0.3

82

0.5

24

0.6

01

-O.B

33

-1.5

B9

0.1

21

-1.0

17

0.8

57

1.8

76

1.1

49

0.6

77

-0.8

15

-0.2

34

-0.2

98

-0.6

37

.0

.50

6-1

.30

1-1

.21

9-1

.001

0.4

17

-0.2

64

0.4

56

0.9

13

1.3

25

0.7

26

1.2

93

1.0

80

1.8

96

-1.9

13

-2.8

32

0.0

79

.-0

.431

0.2

23

-0.2

03

0.0

93

0.2

62

-0.1

44

-1.0

51

-0.7

31

-0.7

83

-0.4

00

-0.9

63

-0.9

65

-0.4

37

-1.P

64

1 |**

r i* i i i* i* *i**

* i**

i i* i*++

i**

i* *i i i *i i***

i»* **

i* i»*

i* i**

i**

i*++

+**

(**

***!

1

** * * * *

***

j

0.0

00

0.0

24

0.0

02

0.0

04

0.0

00

0.0

03

.0

.00

20

.00

30.0

05

0.0

21

0.0

00

0.0

27

0.0

09

0.0

53

0.0

57

0.0

18

0.0

07

0.0

01

0.0

00

0.0

04

.0

.00

20

.02

90

.02

40

.00

50

.00

20.0

01

0.0

01

0.0

05

0.0

09

0.0

04

0.0

12

0.0

06

0.0

19

0.0

20

0.0

66

0.0

00

.0

.00

20.0

00

0.0

01

0.0

00

0.0

00

0.0

00

0.0

06

0.0

03

0.0

15

0.0

03

0.0

05

0.0

05

0.0

04

0.0

21

Page 38: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

OU

TP

UT

FR

OM

L

OG

L1N

: P

OfW

5=

IO

OO

M

ST

AT

ION

ID

EN

TIF

ICA

TIO

N

NU

MB

ER

*03374100

16

:06

T

HU

RS

DA

Y,

AU

GU

ST

IB

. 19R

3

DB

S 84

85

86

87

88

89

90

91 9?

93

9*

95

96

97

98

99

10

01

01

102

103

SU

M

OF

SU

M

OF

in

IB I

CO

. 00

49800.0

016500.0

014800.0

09500.0

06000.0

07

58

0.0

03200.0

02500.0

02050.0

03170.0

01650.0

01

46

00

.00

5780.0

012P

OO

.OO

24100.0

01

12

00

.00

8160.0

04880.0

02860.0

0

AC

TU

AL

46.0

00

35.0

00

45.0

00

39.0

00

45.0

00 .

29

.00

05

6.0

00

71

.00

064.0

00

67.0

00

74.0

00

44.0

00

54.0

00

48.0

00

45.0

00

40.0

00

62.0

00

36.0

00

61

.00

0

RE

SID

UA

LS

SQ

UA

RE

DR

ES

IDU

AL

S

PR

ED

ICT

VA

LUE

45.1

11

35.6

81

45.9

73

46.9

86

51

.11

755.3

99

53.2

21

61.2

55

63

.55

665.4

05

61.3

43

67.4

27

47.1

13

55.7

47

48

.33

942.4

43

49.5

83

52.5

34

57

.32

462.3

02

ST

P

ER

RP

RE

DIC

T

1.0

79

1.6

95

1.0

38

0.9

94730

0.8

93042

0.9

37

29

70

.99

53

B1

1.2

D5

1.3

50

1.4

76

1.2

10

1.6

22

0.9

P9773

0.9

47437

0.9

47319

1.2

28

0.9

15338

O.B

90

3B

O1.D

04

1.2

69

RE

SID

UA

L

2.B

B9

-.680576

-.973067

-7.9

86

-6.1

17

-24

.22

1-5

.256

7.4

44

-1.4

05

5.6

57

6.5

73

-3.1

13

-1.7

47

-.338893

2.5

57

-9.

583

9.4

66

-21

.32

4-1

.30

2

ST

D

ER

RR

ES

IDU

AL

8.7

37

8.6

39

9.7

42

9.7

*7

B.7

5P .

8.7

58

8.7

21

8.7

00

B.6

79

8.7

20

B.6

53

B.7

4B

8.7

53

9.7

53

8.

718

B.7

56

B.7

59

8.7

46

B.7

12

ST

UD

EN

T

CO

OK

'SR

ES

IDU

AL

-2-1

-0

1 2

D

0.3

31

-0.0

79

-0.1

11

-0.9

13

-0.6

98

.-2

.765

-0.6

03

O.B

56

-0.1

62

0.6

49

0.7

60

-0.3

56

-0.2

00

-0.0

39

0.2

93

-1.0

93

1.0

8]

-2.4

3B

-0.1

49

1 1 1*l

*l

#*#

+*| *l 1* | 1* 1* 1 1 1 1

»*| 1

***+

*+( 1

0.0

01

0.0

00

0.0

00

0.0

05

0.0

03

0.0

40

0.0

03

0.0

09

0.0

00

0.0

04

0.0

10

0.0

31

O.O

OD

0.0

00

0.0

01

0.0

07

0.0

06

0.0

39

0.0

00

2.0

79

05

E-1

17440

.682

CO

C

O

Page 39: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

OU

TPU

T FR

OM

L

OG

LIN

: P

OO

M5 =

L

00

06

1

ST

AT

ION

1D

FN

T1F

1CA

TIO

N

NU

KP

ER

=0

33

74

10

016:0

6

TH

UR

SD

AY

, A

UG

US

T IB

, 1

9S

3

10

PL

OT

PF

P

*L00061

PLO

T O

F P

00

9*5

*L0

00

61

SY

MB

OL

US

ED

IS

P

SY

MB

OL

US

FD

IS

0

90

80 70

P R 6

0

F 0 I C T 5

0

Eu>

0

-Pa

V A 4

0

I U

E

30

*

?0 10 0

* -4--

5.0

0

P P

6.0

PP

0n o

o PP

o

ooP

PP

P

0

00

0

0 O

PP

PP

ppp

PP

PO

00

0

0 0

000

0 P

P

0

PP

P

0O

OP

PP

PP

000

PP

P

0 0

0

0 C

IPPP

P

o n

on

00

0 P

PP

00

OP

PP

PP

0

PP

P

0

00

00

PP

P

0 0

PP

PP

P0

OP

PP

0

0 0

0

PP

P0

0 P

P0

P

P n

fj

-.4

..6

.5.-

4 -

.7

.0.-

4-.

7.5

.-4- ,

P.O

L0

00

61

.. 4

8.5

. -4

--

10.5

4

-.

11.0

5.5

9.5

10.0

NO

TE

: 5

DB

S

HA

D

MIS

SIN

G

VA

LU

ES

DB

S H

IDO

FN

Page 40: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

15 10

OU

TP

UT

FR

OM

L

OG

LIN

: P

00945*

L00061

ST

AT

ION

ID

EN

TIF

ICA

TIO

N

NU

MB

FR

=0337«100

PLOT

OF

R*

P LE

GEN

D:

A =

i DB

S,

B =

? D

BS,

ETC.

A

U>

:06

TH

UR

SD

AY

1.

AU

GU

ST

18,

19

P3

11

A A

AA

A A

A A

A A

A A

A

A A

AA

A A

AA

AA

A A

A A

A A

A A

A A

A A

A A

A

to

R E 5 1 -5

0 A L

S -1

0

-15

-20

-25

-30

A A

A A

AA

A

AA

A

A A

A A

A A

A A

70

7?

Page 41: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

VA

RIA

BL

ES

RE

SID

UA

LS

FOM

EN

TS

N ME

AN

ST

O

DE

VS

KE

WN

ES

SU

SS

CV T:H

EAN

*OS

CN

R

AN

KH

UM

^.

= 0

P:NO

RMAL

98

2.1

21E

-13

P. 7

58 3

1-0

.59

73

*fi

7**

0.6

fi*.

128E

*15

2.3

9P

E-1

31

67

.5 9P0

.07

B2

*36

SUM

W

GTS

SUM

VA

RIA

NC

EK

UR

TO

SIS

ess

STO

M

EA

MP

RO

B>

|T|

PR

DB

>IS

|

PR

QB

>0

9B2

.07

9E

-11

76

.70

81

0.6

2*1

7*

7*4

0.6

8O

.B8

*72

3 10

.55

4

0.1

*3

CO en

STE

M 16 1* 12 10 8 6 * 2 0 -0 -2 -* -6 -8

-10

-12

-1*

-16

-18

-20

-22

-2*

OU

TPU

T E

PO

M

LP

GL

1N:

P0

09

4**

L

00

06

1

UN

IVA

RIA

TE

OUANT1LES(DEF=4) 99

*95*

90

*10*

5* 1*

lfc

:06

T

HU

RS

DA

Y,

AU

GU

ST

18

, 1

98

3

12

EX

TR

EM

ES

lOO

t M

AX

75*

03

50K

H

ED

25*

01O

T H

IM

RA

NG

E03-0

1M

OD

E

17

.91

6B

5.8

5993

0.9

00

8P

6-5

.32948

-24.7

282

42.6

4*5

11.1

894

-24

.72

P2

LE

AF

3619

073*6

50

15

57

788

82

36

*5

77

7

00

*6

92

677

90

12

35

6791*69

12677713**

8777*33073

987531064330

1163

2

31

7*

1

56

28

75

5*0

836

2

93

2

R3

2

3 1

0 1

72

2 4. «4 4 4

BDXPLOT

HISSING VALUE

COUNT

5 *

COUNT/NOBS

4.85

17*

4 4

I I

* 4 *

I I

I I

4 4

3

-11

17.9161

I1.B377

9.9*287

-10.63*2

-16.9796

-24.72P2

LOHFST

-24.7292

-2*.2206

-22.9778

-21.3236

-16.7509

HIG

HE

ST

11.6

0**

16.2

716

16.6

02*

17

.07

65

17.9

168

NO

RM

AL

PR

OB

AB

ILIT

Y

PLO

T

4 +

*+

***+

****

****

** +

*****

**+

+

**«-

***«

*

**»

**

***

**-»

»

**

-25*

+

*4

4

-4-

-2

-* -1

.-4.

*0 -

*

*2

Page 42: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

OU

TP

UT

FR

OM

L

OG

LO

Gt

L0

0?

* =

10

00

51

S

TA

TIO

N

IDE

NT

IFIC

AT

ION

N

UK

9E

R*0

33

74

10

016:0

6

TH

UR

SD

AY

, A

UG

US

T

IB,

I9B

3

13

MOD

EL:

LOG

LOG

OFP

VAR

IABL

E:

L009

45

SC

UR

CE

O

F

MO

DE

L 1

ER

RO

R

96

C T

OT

AL

9

7

RO

OT

U

SE

DE

P

ME

AN

C.V

.

VA

RIA

BL

E

OF

INT

ER

CF

P

1L

00

06

1

1

OB

S

ID

1 12799.9

72

55899. *

93

28

39

9.9

*4

92

99

. 9fl

5 15299.9

76

3

13

99

.93

7 5989.9

98

3029.9

99

22

50

.00

10

2

60

0.0

011

6360.0

012

14799.9

61

3

22500.0

014

33599.9

31

5

37000.0

01

6

14

10

0.0

017

11700.0

018

4

74

0.0

01

9

79

79

. 9B

20

11300.0

021

14299.9

62

2

23

19

9.9

*52

3

20

29

9. 95

24

38999.9

22

5

18099.9

626

45

29

9.9

12

7

14899.9

728

97

09

.98

29

6549.9

930

9R

O.O

O

SU

M

OF

SQ

UA

RE

S

3.B

83

95

23

.57

70

98

7.4

61

05

0

0.1

93

03

23.9

16335

4.9

2B

B9

9

PA

RA

ME

TE

RE

ST

IMA

TE

5.5

82358

-0.1

B3B

90

AC

TU

AL

4.0

60

3.B

29

3.8

9?

4.0

78

3.8

07

2.8

33

3.9

70

.22

0.2

05

.29

0.0

60

.043

1

11

3.7

38

3.7

84

3.8

71

4.0

78

4.1

11 .

3.7

14

3.8

07

3.8

07

3.8

71

3.5

55

3.9

12

3.6

38

4.1

59

3.9

70

4.0

25

4 .0

94

ME

AN

SQ

UA

RE

F

VA

LUE

P

RO

P>

F

3.B

B3

95

2

104.2

35

0.0

001

0.0

37261

R-S

QU

AF

E

0.5

20

5A

OJ

R-S

Q

0.5

156

ST

AN

DA

RD

T

FOR

H

OS

ER

RO

R

PA

RA

ME

TE

RS

P

RO

S

> |T

|

0.1

64

34

3

33

.96

8

0.0

00

10

.01

80

12

-1

0.2

13

0

.00

01

PR

ED

ICT

S

TD

E

RR

S

TD

E

RR

S

TU

DE

NT

C

OO

K'S

VA

LUE

P

RF

DIC

T

RE

SID

UA

L

RE

SID

UA

L

RE

SID

UA

L

-2-1

-0

1 ?

D

3.8

43

0.0

20771

0.2

17170

0.1

91911

1.1

32

I*

*

O.O

OB

3.5

72

0.0

3F

94

1

0.2

56

44

4

0.1

B9

06

4

1.3

56

!**

0.0

39

3.6

97

0.0

29033

0.1

95

09

6

0.1

90P

36

1.0

22

1**

0.0

12

3.9

02

0.0

19550

0.1

75524

0.1

92040

0.9

14

I*

0.0

04

3.8

10

0.0

22

09

5

-.003804

0.1

91765

-0.0

20

| 0

.00

03.6

78

0.0

30397

-.845044

0.1

90624

-4.4

33

**+

***!

0.2

50

3.9

83

0.0

20561

-.012619

0.1

91

93

4

-0.0

66

|

0.0

00

4.1

0B

0.0

27084

0.1

11270

0. 1

91

12

3

0.5

82

1

* 0

.00

34.1

63

0.0

31

04

5

0.0

41724

0.1

90519

0.2

19

1

0.0

01

4.1

36

0.0

29

06

5

0.1

54

07

8

0.1

90

B3

2

0.8

07

|*

O.O

OB

3.9

72

0.0

20244

0.0

88554

0.1

91968

0.4

61

I 0

.00

13. 817

0.0

21810

0.2

26475

0.1

91796

1.1

81

|+*

0.0

39

3.7

40

O.D

26

07

B

0.3

71328

0.1

91

26

3

1.9

41

|+

++

0.3

35

3.6

66

0

.03

13

43

0

.07

18

65

0

.19

04

71

0

.37

7

I 0

.03

23.

64

8

0.0

32

72

0

0.1

36

11

1

0.1

90239

0.7

15

j*

0.0

08

3.8

25

0.0

21434

0.0

45716

0.1

91839

0.2

38

1 0

.00

03.8

60

0.0

20

27

0

0.2

17

74

1

0.1

91965

1.1

34

I*

*

0.0

07

4.0

26

0.0

22260

0.0

84923

0.1

91744

0.4

43

I

0.0

01

3.9

30

0.0

19546 ...

3.

866

0.0

20138

-.152621

0.1

91982

-0.7

95

*|

0.0

03

3.8

23

0.0

21540

-.016233

0.1

91B

27

-0.0

85

1

0.0

00

3.7

34

0.0

7M

4P

0

.07

27

50

0.1

91212

0.3

80

I

0.0

01

3.7

58

0

.02

48

86

0.1

12733

0.1

91

42

1

0.5

89

1+

0.0

03

3.6

38

0.0

33486

-.063050

0.1

90106

-0.4

37

1

0.3

33

3.7

BO

0.0

2365P

0

.13

24

61

0.1

91577

0.6

91

|*

0

.00

43

.61

1

0.0

35

71

3

C. 0

26724

0. 1

99

70

0

0.1

41

|

0.0

00

3.8

15

0.0

21865

0.3

43546

0.1

91

7<

?0

1

.79

1

|*+

+

0.0

21

3.8

94

0.0

19

62

1

0.0

76212

0.1

92

03

2

0.3

97

1 0

.00

13.9

6f»

0.0

2010B

0.0

5P

B76

0.1

91

93

2

O.?

07

1

0.0

31

4.3

16

0.0

43717

-.2

21

46

1

0.1

PB

01

7

-1.1

78

**l

0.0

3B

Page 43: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

OU

TP

UT

FR

OM

L

OG

LO

G:

L0

09

45

* L

00061

ST

AT

ION

IO

EM

TIF

1C

AT

JO

N

DU

MB

ER

*03374100

16:0

6

TH

UR

SD

AY

A

UG

US

T IB

. 1

96

3

14

CO 00

OBS

in

31

2320.0

032

1860.0

033

7930.0

03

* B

37

9.9

P35

11099.9

736

4

66

00

.00

37

4

65

99

.91

38

12699.9

73

9

37

59

.99

40

4899.9

941

3709.9

942

40

99

.99

43

1040.0

044

2790.0

04

5

19

80

.00

46

5

14

.00

47

57

4.0

04

8

25090.0

04

9

31200.0

05

0

8090.0

051

31

00

.00

52

3099.9

95

3

34

40

.00

54

16

80

.00

55

1810.0

05

6

9860.0

057

2840.0

058

33830.0

05

9

10730.0

06

0

56

20

.00

61

9220.0

062

19000,0

063

17

00

0.0

064

73

20

.00

65

8280.0

06

6

11000.0

067

3770.0

06

8

31

80

.00

69

31600.0

070

32200.0

071

P

600.0

07

2

76000.0

073

30400.0

07

4

13700.0

075

9350.0

076

6820.0

07

7

6000.0

07B

68400.0

07

9

41100.0

080

7410.0

08

1

10200.0

08

2

54900.0

0B

3

5440.0

0

AC

TU

AL

4.1

74

4.3

44

4.1

90

4.0

94

3.9

32

3.4

97

3.9

70

4.1

74

3.9

12

3.8

29

4.0

94

4.1

43

4.2

48

4.4

07

4.4

77

4.4

19

3.5

55

3.6

38

3.9

12

4.0

25

4.1

74

4.0

25

4.0

25

3.7

38

4.1

90

3.6

11

3.9

89

4.1

59

4.1

43

3.9

32

4.0

43

4.1

43

4.2

34

3.4

97

3.5

55

4.1

27 .

3.5

84

3.9

89

3.4

01

3.7

14

3.9

12

3.9

12

3.8

07

3.8

92

3.2

58

3.5

?6

3.8

07

3.7

38

3.4

34

3.6

89

PR

ED

ICT

S

TD

E

RR

S

TD

E

KR

VA

LUE

P

RE

DIC

T

RE

SID

UA

L

RE

SID

UA

L

4.1

57

0.0

30617

0.0

17052

0.1

90589

4.1

98

0.0

?37fi2

0.1

45832

0.1

90053

4.1

14

0.0

27507

0.0

75

Z4

6

0.1

91052

3.9

21

0.0

19505

0.1

73176

0.1

92044

3.8

69

0.0

20032

0.0

62348

0.1

91990

3.6

06

0.0

3(1

41

-.109151

0.1

89619

3.6

06

0.0

36141

3.8

45

0.0

20723

0.1

25576

0.1

91917

4.0

69

0.0

24545

0.1

05844

0.1

91465

4.0

20

0.0

21978

-.107824

0.1

91777

4.0

71

0.0

24693

-.242364

0.1

91

44

64

.05

3

0.0

23631

0.0

41720

0.1

91580

4.3

05

0.0

42761

-.161744

0.1

8P

23

64

.12

3

0.0

28

13

*5

0.1

25083

0.1

90971

4.1

86

0.0

32868

0.2

20243

0.1

90213

4.4

34

0

.05

43

68

0.0

42861

0.1

95218

4.4

14

0.0

57516

0.0

04

66

8

0.1

95

75

13

.72

0

0.0

77375

-.164823

0.1

91

08

13

.67

9

0.0

30309

-.041846

0.1

90638

3.9

28

0.0

19531

-.015622

0.1

92042

4.1

04

0.0

76800 -.

078685

0.1

91163

4.1

04

0.0

76800

4.0

85

3.0

25550

O.O

P94B

8

0.1

91334

4.2

17

0.0

35294

-.191338

0.1

89778

4.2

03

0.0

34183

-.177632

0.1

89

98

13.9

91

0.0

19653

-.153591

0.1

92029

4.1

20

0.0

27906

0.0

69509

0.1

91004

3.6

65

0.0

31427

-.053795

0.1

90457

3.8

76

0

.01

9P

91

0.1

17758

0.1

92005

3.9

95

0.0

20953

0.1

64248

0.1

91892

3.9

04

0.0

19539

0.2

39533

0.1

92041

3.7

71

0.0

24163

0.1

61

18

8

0.1

91514

3.7

91

0.0

23037

0.2

51960

0.1

91653

3.9

46

0.0

19715

0.1

97096

0.1

92023

3.9

23

0.0

19511

0.3

10

73

1

0.1

92044

3.8

71

0.0

19995

-.374634

0.1

91

99

44

.06

8

0.0

74516 -.

517707

0.1

91

46

94

.09

9

0.0

76487

0.0

27703

0.1

91206

3.6

77

0.0

30485

3.6

74

0

.03

07

46

-.

090112

0.1

90568

3.9

16

0.0

19499

0.0

72

58

1

0.1

92045

3.5

16

0.0

43818

-.114514

0.1

87993

3.6

84

0

.0?

99

r«3

0.0

29

36

3

0.1

90

69

43

.83

1

0.0

21724

O.O

P1

24

5

0.1

91

B&

?3.9

01

0.0

19557

0.0

10

99

6

0.1

92039

3.9

59

0.0

19943

-.1

52

3P

5

0.1

91999

3.9

83

0.0

70551

-.090784

0.1

91

93

53

.53

5

0.0

47127

-.276990

0.1

8B

379

3.6

29

0.0

34259

-.102393

0.1

39

96

-P3

.94

4

0.0

19684

-.137178

0.1

92026

3.8

85

0.0

19739

-.147357

0.1

92020

3.5

76

0.0

3R

660

-.141529

0.1

B9

1?

!4.0

01

0.0

/1175

-.311747

0.1

91867

ST

UD

EN

TR

ES

IDU

AL

0.0

89

0.7

67

0.3

94

0.9

02

0.3

25

-0.5

76

,0.6

54

0.5

53

-0.5

62

-1.7

66

0.2

18

-0.8

59

0.6

55

1.1

58

0.2

31

0.0

25

-0.8

63

-0.2

20

-0.0

81

-0.4

12

.0

.46

8-1

.00

8-0

.93

5-0

.80

00.3

64

-0.2

82

0.5

87

O.P

56

1.2

47

0.8

42

1.3

15

1.0

26

1.6

18

-1.9

51

-2.6

78

0.1

45

»-0

.473

0.3

78

-0.6

09

0.1

54

0.4

23

0.0

57

-0.7

94

-0.4

73

-1.4

70

-0.5

39

-0.7

14

-0.7

67

-0.7

48

-I.

*?

*

-7-1

-0

1 2

1 1*

1 1*

1*l 1

*1

**l

** *

* **

*

** * *

1*

1*

1**

1*

1**

1**

|***

***!

«**

**! j 1 1

*l1 1 1

*l 1

**l

*l

* *l

*l

***|

CO

OK

'S D

0.0

00

0.0

09

0.0

02

0.0

04

0.0

01

0.0

06

.0

.00

20.0

03

0.0

02

0.0

13

0.0

00

0.0

19

0.0

05

0.0

20

0.0

02

0.0

00

O.O

DB

0.0

01

0.0

00

0.0

02

«0

.00

20

.01

80.0

14

0.0

03

0.0

01

0.0

01

0.0

02

0.0

04

O.O

OB

0.0

06

0.0

12

0.0

06

0.0

14

0.0

21

0.0

59

0.0

00

.0.0

03

0.0

01

0.0

10

0.0

00

0.0

01

0.0

00

0.0

03

0.0

31

0.0

54

0.0

05

0.0

03

O.O

D3

0.0

12

0.0

16

Page 44: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

OU

TP

UT

FR

OM

L

OG

LO

G:

L0

09

45

=

L0

00

61

S

TA

TIO

N

IDE

NT

IFIC

AT

ION

N

UW

ER

=03374 1

00

16

:06

T

HU

RS

DA

Y,

AU

GU

ST

IB

, 1983

15

DB

S 64

85

86

87

PB

89

90

91 92

93

94

95

96

97

98

99

10

0101

10

21

03

ID

18100.0

049P

OO

.OO

16900.0

014P

OO

.OO

9500.0

06000.0

07580.0

03200.0

02500.0

020*0

.00

3170.0

01650.0

01

46

00

.00

57

PO

.OO

12

BO

O.O

O24100.0

011200.0

0B

160.0

04

68

0.0

02860.0

0

AC

TU

AL

3.8

71

3.5

55

3.8

07

3.6

64

3.8

07 .

3.3

67

.02

5.2

63

.15

9.2

05

.30

43

.78

43.9

89

3. 8

71

3.8

07

3.6

89

4.1

27

3.5

84

4.1

11

PR

ED

ICT

VA

LUE

3.7

00

3.5

93

3.7

97

3.8

17

3.8

98

3.9

83

3.9

40

4.0

98

4.1

44

4.1

80

4.1

00

4.2

20

3.8

19

3. 9

89

3.8

43

3.7

27

3.6

68

3.9

26

4.0

21

4.1

19

ST

D

ER

RP

RE

DIC

T

0.0

23658

O.D

37

15

40.0

22755

0.0

21B

10

0.0

19581

O.D

P0551

0.0

19632

0.0

26411

0.0

29592

0.0

32367

0.0

26525

0.0

35

56

50.0

21702

0.0

20773

0.0

20

77

10

.02

69

16

0.0

20070

0.0

19

52

20.0

22012

0.0

27

81

5

RE

SID

UA

L

0.0

91

64

0-.

03

P0

97

0.0

10082

-.153014

-.091438

-.572323

-.072847

0.1

19086

-.021204

0.1

04762

0.0

84062

-.034888

-4.9

E-0

4

0.0

27928

0.0

79

74

9-.

173949

0.2

01074

-.437079

-.007981

ST

D

EF

RR

ES

IDU

AL

0.1

91577

0.1

B9423

0.1

91636

0.1

91796

0.1

92037 .

0.1

92031

0.1

91217

0.1

90750

0.1

90299

0.1

91

20

10.1

39728

0.1

91

BO

B0.1

91911

0.1

91

91

10.1

91147

0.1

91

9B

60

.19

?0

42

0.1

91773

0.1

91018

ST

UD

EN

TR

ES

IDU

AL

0.4

78

-0.2

01

0.0

53

-0.7

98

-0.4

76

.-2

.980

-0.3

BI

0.6

24

-0.1

11

0.5

48

0.4

43

-0.1

82

-0.0

03

0.1

46

0.4

17

-0.9

32

1.0

47

-2.2

79

-0.0

42

-2-l-( *

***** *

1+ ***

1) I

2

* * *#

CO

OK

'S D

0.0

02

0.0

01

0.0

00

0.0

04

0.0

01

0.0

46

0.0

01

0.0

05

0.0

00

0.0

33

0.0

03

0.0

00

0.0

00

0.0

00

0.0

02

0.0

05

0.0

06

0.0

34

0.0

00

Sl'M

O

F

RE

SID

UA

LS

SUM

3F

S

QU

AR

ED

R

ES

IDU

AL

S1.3

5425E

-12

3.5

77098

CO

Page 45: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

4.4

4.2

4.0

R 3

.8F 0 1 c T

3.6

E

-P.

0o

V A 3.4

L U F

3.2

3.0

2.8

2.6

-.4

-.

6.5

PP .-4

..

7.0

OU

TP

UT

FR

OM

L

OG

LD

G:

L0

09

4**

L

0005 1

S

TA

TIO

N

IDF

NT

IFIC

AT

IDN

N

UP

BE

R *

03374

lf>

:0&

T

HU

RS

3A

Y,

AU

GU

ST

IB,

1933

16

PL

OT

O

F P

*L00061

PL

OT

O

F L

00

94

5*L

00

06

1S

YM

BO

L U

SF

D

IS

P S

YM

BO

L U

SE

D

IS

0

DO

0 ooa

(1P

PP

PP

O OP

PP

0

D P

PP

P P P

PP

D00

0

P P

P P PP

P OPPP

P

0

0 0

0

0 3

a o

00

PPP

P o

o no

PP

PP

P 00

00

PP

P0

0

D

OP

PP

P

00

00

(

00

DP

PP

PP

PP

D

0

PP

PP

P0

PP

P

00

0

PP

P

0

D

0

PP

0

0

0

P P

4

-.

P.5

..4

--

9.5

. 1

4_

_._

- 4

.. ......4....... -.4

...... ..4

..

10.0

10.5

11.0

11.5

1

2.0

6.0

7.5

n.o

9.0

L00061

NO

TE

: 5

DP

S

HA

D

MIS

SIN

G

VA

LU

FS

4?

H

PS

H

IPD

fN

Page 46: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

0.6 +

0.5

0.4

0.3

0.?

0.1

0.0

R E -0.1

S I 0 -0.2

U A L -0.3

S

-0.5

-0.6

-0.7

-O.B

-0.9

-1.0 *

OUTPUT FROM LOGLPG: L0

094*

> = LOOOM

STATI3N IDENTIFICATION NUMBER=03374100

PLOT

OF

R*

P LE

GFN

D:

A *

i DB

S,

B =

2 D

BS,

ETC

.

16:0

6

TH

UR

SD

AY

, A

UG

US

T 1

8,

1993

17

A A

A A

AA

A A

A A

A A

AA

A A

A A

AA

A

A A

A A

AA

A A

AA

A

AA

AA

P

A A

A A

A AA

AA

-A-

A A

- A

AA

AA

AA

A A

A A

AA

AB

A A

4

..

3.7

..#

. -- 4

-.

3.9

4

.0

PR

ED

ICT

ED

V

ALU

F

4

-

4.1

..4..

4.2

.-4

-.

4.3

..4..

4.4

»«. 4

4.5

3.5

3.6

3.R

NDTE

:5

OB

S H

*D

MIS

SIN

G

VA

LU

ES

Page 47: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

VA

RIA

BL

ES

RE

SID

UA

LS

MO

ME

NTS

OU

TP

UT

FR

OM

L

OG

LO

G:

L0094**

L

0006 1

UN

IVA

RIA

TE

OU

AN

TIL

ES

CD

EF

=4

)

1M

06

T

HU

RS

DA

Y,

AU

GU

ST

IB

, 1

98

3

EX

TR

EM

ES

ro

N ME

AN

ST

D

DE

VS

KE

HM

ES

SU

SS

CV T:KE

AN=O

SG

N

RA

NK

NU

M

»*

0D

INO

RM

AL

9B

S

UH

H

GT

S1

.3R

2E

-1*

SU

M0.1

92035

VA

RIA

NC

E-1

.35597

KU

PT

OS

IS3.5

771

CS

S1.3

90E

+15

ST

D

ME

AN

7.1

24

E-1

3

PP

OB

MT

I25*.

5 P

RO

B>

IS|

98

0.0

989695

PR

OB

>0

ST

EM

L

EA

F3

73

14

2 5

62

0002223*

1 5

56

67

B1

01

11

12

33

34

0

5667777886886999

0

1123333444

-0

44322211000

-0

9998875

-1

44

11

10

-1

9886655555

-2

42

-2

P-3

1

-3

7-4

4

-4 -5

1-5

7

-6 -6 -7 -7 -8

5 _ -4- -4-- 4

+

9P1

,35

«E

-12

0.0

36P

773

3.7

4112

3.5

77

10

.01

93

98

4 10.3

68084

0.0

1P

S 1 2 2 8 6 10 16 10 117 6

10 2 1

10

0?

M

AX

0.3

71328

75?

03

0.1

14

3*

50?

MFC

0.0

286457

25*

01

-0.1

03751

MIN

-O

.B4

50

44

RANG

F i.2

1637

Q3-

OI

0.2

16

09

M

ODE

-0

.8450*4

99

V9

5?

90

*1

0? 5*

1?

0.3

71

32

R

0.2

52IB

5

0.2

17

22

7

-0.1

94

35

-0.3

77756

-0.8

450*4

LOW

ES

T-0

.8*5

04*

-0.5

72

32

3-0

.512707

-0.4

37079

-0.3

7463*

HIG

HE

ST

0.2

51

96

0.2

56444

0.3

10

73

1

0.3

43545

0.3

71

32

8

BOXPLOT

+ *

I I

* 4 *

I (

I I

4 - »

MISSING VALUE

COUNT

* COUNT/NOBS

0.3

75

+

54

.85

-0.2

25

NO

RM

AL

PR

OB

AB

ILIT

Y

PL

OT

4

4

4-4

4*

*

44

**

4+

+*+

*

4*** +

*****

****4

***44

**4

4

**4

4

***4

******

*4*4

*4

44*

4

*

4

*

-0.8

25

**

MU

LT

IPL

Y

ST

EM

.LE

AF

B

Y

10**

-OJ

-2

-4

- -1

«

»0

*?

Page 48: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

tools which aid the user in selecting the most appropriate regression model.

The program uses the macro REGDATA to establish the data. The macro REGMAC

uses the REG procedure (SAS Institute, Inc., 1982b, p. 39) rather than the

SYSREG procedure to generate regression results. In addition to the information

provided by SYSREG, the REG procedure in this application prints (1) the observed

and predicted value for each observation; (2) the residual (FAC), the standard

error of the residual and the studentized residual (the residual divided by

its standard error); and (3) Cook's D, a measure of the change to the parameter

estimates that would result from deleting each observation. This program also

plots for each model the observed and predicted values of the selected dependent

variables against the log of streamflow, and the FAC (residuals) against the

predicted value. In these plots, the log of the flow is used on the x-axis to

provide better resolution in the low discharge range. Finally, the macro does

a residuals analysis with the Univariate procedure (SAS Institute, Inc., 1979,

p. 427). This procedure does univariate statistics on the residuals, tests

for normality by the Shapiro-Wilk W statistic (for sample sizes _<50) or a

modified version of the Kolmogorov-Smirnov D Statistic (for sample sizes >50)

and provides a stemleaf, box plot, and probability plot of the residuals.

For a discussion of regression analysis and the use of these dianostic tools,

the reader is referred to Chatterjee and Price (1977), Belsley and others

(1980), Daniel and Wood (1980), and Draper and Smith (1981).

The procedure is invoked three times in the example, shown in figure 4,

once for the linear model of equation 2 (lines 65-68), once for the log-linear

model of equation 3 (lines 69-72), and for the log-log model of equation 7

(lines 73-76). In each instance three variables are set - the model label

(MODLABEL) in lines 65, 69, and 73, the independent variable (Y) in lines 66,

70, and 74, and the explanatory variables (FLOW) in lines 67, 71, and 75 -

43

Page 49: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

then the macro REGMAC is called (lines 68, 72, and 76) to do the computation.

In the example shown in figure 4, the log-linear (equation 3) was selected

to flow adjust the sulfate concentrations. The linear model (equation 2) is

clearly deficient. Both plots demonstrate this quite clearly. However, the

log-log model (equation 7) is not manifestly better or worse than the log-linear

model. The pattern seen on the residuals plots for these two models are very

similar, both showing some modest lack of fit at the low end and a slight amount

of heteroscedasticity. The choice betwen these two models, in this case, is

largely a matter of preference. The log-linear model has the advantage that the

residuals are in units of mg/L.

PLOTTING WATER-QUALITY DATA AS A TIME SERIES

It is now possible to examine the flow-adjusted concentrations for trend.

A good exploratory method for detecting trends is to plot the data as a time

series. Figure 5 shows an example SAS program that generates time series

plots for streamflow, sulfate concentration, and the flow-adjusted sulfate con­

centration for the data used in figure 3. Note that PROC REG (lines 12-14)

is used to calculate the FAC and generate the data set used by PROC PLOT (lines

16-19) (SAS Institute, Inc., 1979, p. 343). Note also that the variable

DECTIME (lines 17-19) is used as the time variable in these plots.

PROC PLOT produces line printer plots as shown in figure 5. More elaborate

plots of SAS data can be made using PROC GPLOT (SAS Institute Inc., 1981b,

p. 69). The procedure GPLOT is a part of the SAS/GRAPH system which is a

computer graphics system for producing figures on terminal screens and plotters.

A list of compatible graphics devices is given in the SAS/GRAPH User's Guide

(SAS Institute, Inc., 1981b, p. 2).

44

Page 50: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

1 //F5 JOB

I II CLASS

3 //PROCLI13

DO DSN=WRD.PROCLIB,DISP=SHR

A //A EXEC WRDSAS,OSN1=NULLF I

L E/

D SN2 = NU LL F I

L E

5 //TREND

Dl) DSN=USERID.FILENAME/DISP=OLD

6 //SYSINDO*

7 OPTIONS NOOVP;

a DA

TA DATA

A;SE

T TR

END.

MONT

HLY;

9 IF STATION*

1 03374100

';10

L00061=LOG(P00061 );

11

KEEP STATION

SNAM

E P0

0945

P0

0061

L00061 DE

CTIM

E,12

PROC SORT DA

TA=D

ATAA

;BY

STAT

ION;

13

PROC

RE

G DA

TA = DA

TAA

NOPRINT;3Y ST

ATIO

N/'

14

MODE

L PO

U945

=L00

061;

15

OUTPUT OUT=PLOTDATA P=P

R=FAC;

16

PROC

SORT

DA

TA=P

LOTD

ATA;

BY STATION;

17

PROC PL

OT DA

TA=P

LOTD

ATA;

OY ST

ATIO

N;18

PLOT

PU

0061

*DEC

T IME;

19

PLOT

P00945*DECTIME;

20

PLOT

FAC*DECTIME;

21

/*22

//

Figure 5.

--Ex

ampl

e input

and

outp

ut of

residuals

as ti

me s

eries.

SAS

statements to pl

ot w

ater-quality d

ata

and

regr

essi

on

Page 51: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

90000.0

0

BO

OO

O.O

O

S T P E A 70000.0

0

F L 0

W

60000.0

0

I N S 50000.0

0

N T A 4

00

00

.00

N F 0 U S 30000.0

0

c F S PO

OO

O.O

O

*

10000.0

0

*

0.0

0

ST

AT

IS

TIC

AL

A

NA

LY

SIS

S

Y S

T F

M S

TA

TIO

N

IDE

NT

IFIC

AT

ION

N

UM

BE

R=

D33

7<H

OO

PLO

T O

F P

00

06

1*D

EC

riM

E

LE

GE

ND

: A

= 1

OP

S,

3^

2

DB

S,

ET

C.

16:1

6

TH

UR

SD

AY

, A

UG

US

T

18,

1983

2

AA

A

AA

A A

AA

A A

A A

A A

A A

AA

A

AA

A A

AA

A A

AA

A

A A

AA

A A

A A

A A

A B

A A

APA

A

A A

AA

AA

A A

A

A A

A

AA

A

A B

AA

A

19

72

.PO

OO

1973.7

000

1?

.60

00

1975.5

000

13

76

.^0

00

1

97

7.3

00

0

19

7B

.20

00

1979.1

000

19B

O.O

OO

O

19

B3

.90

00

TIM

F (I

N

Page 52: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

ST

AT

IS

TIC

AL

A

NA

LY

SIS

S

YS

TE

M

1M

16

TH

UR

SD

AY

, A

UG

US

T IB

, 1

98

3

3 S

TA

TIO

N

IDE

NT

IFIC

AT

ION

N

UK

BE

R*0

33

74

10

0

PL

OT

P

F

P00945+

DE

CT

IMF

L

EG

EN

DS

A

= 1

DB

S,

B =

? O

BS

, E

TC

.

90

.0

60

.0

70

,0

60

.0

50

.0

40

.0

30

.0

20

.0

10.0

*

0.0

+ _+

____ .._._

. +

..4

..- . ._ 4

_

._

4 _

__

__

__

_

_«___. 4

. _

_. *

-_

_ ---»

---*

19

72

.PO

OO

1973.7

000

197».6

000

1975.5

000

19

76

.40

00

1

97

7.3

00

0

19

7P

.PO

OO

1

97

9.1

00

0

19B

O.O

OO

O

19

83

.90

00

TIM

E

(IN

Y

EA

RS

)

A A

A A

AA

A A

A A

A A

AA

A

A A

A A

A A

A A

A A

A A

B A

A A

AA

A

A A

A A

A A

A A

A A

A AA

A

A A

A A

A A

A

AA

A

AA

AA

AA

A A

A A

A A

A A

AA

A A

A A

A A

A A

A A

AA

A A

NPTEI

5 OBS HAD MISSING VALUES

Page 53: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

15 10

f S I -5

0 u A L S -1

0

-15

-20

ST

AT

IS

TIC

AL

A

NA

LY

SIS

S

Y S

T F

M S

TA

TIO

M

IDE

NT

IFIC

AT

ION

N

UM

BE

R'0

33

74

100

PL

OT

O

F F

AC

*DE

CT

IME

L

EG

EN

D:

A =

1 D

BS

, B

« ?

(IB

S,

ET

C

16

:16

T

HU

RS

DA

Y,

AU

GU

ST

IB,

1903

A

AA

A

AA

A A

A A

A

A A

A A

A A

A A

A A

A A

A A

A A

A A

A

A A

A A

A A

A A

A A

AA

A A

A

A A

A A

AA

AA

A

A A

AA

A A

AA

A A

AA

A

A A

-30

+ . 4

.- 4

. . - 4

.. 4

.- , _

4_ -4

f _

4

- - -4- 4

- - «

-

19

7?

.50

00

1

97

3.4

00

0

197^

.3000

19

7*.

?D

OO

1976.1

000

1977.G

OO

D

19

77

.90

00

1

P7

R.B

OO

O

19

79

.70

00

19P

0.6

000

19

81

.*>

00

0

TIM

E

(IN

Y

FA

R?

)

NOTEt

5 OPS HAD MISSING VALUES

Page 54: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

STATISTICAL PROCEDURES TO TEST FOR TRENDS IN WATER-QUALITY TIME SERIES

Two nonparametric tests for detecting trends in time series have been

added to SAS at the U.S. Geological Survey Amdahl computer facility. PROC

SEASKEN does the Seasonal Kendall test and slope estimator developed by

Hirsch and others (1982). This procedure is suitable for detecting monotonic

trends in time series with seasonality, missing values, or values reported

as "less than." The procedure is not, however, robust against serial correla­

tion. Additional information about the Seasonal Kendall test and slope esti­

mator is given in the User's Guide presented in Appendix A.

PROC SEASRS tests for differences in the location parameters (mean, median,

etc.) of two separate periods in a time series. The procedure uses a version

of the Wilcoxon rank-sum test (Mann-Whitney test) modified to handle seasonality,

This test is appropriate for detecting step trends (changes) in water quality

before and after events such as construction of a dam or sewage treatment plant

or an abrupt land-use change (construction, mining, clear cutting). Additional

information about the modified Wilcoxon rank-sum test is given in the User's

Guide presented in Appendix B.

In many cases, it may be appropriate to apply one of these PROC's to the

concentration data as well as to the flow-adjusted concentration (FAC) data.

Trends or changes in FAC may be interpreted as an indication that the stream-

flow concentration relationship has changed; that is, for a given discharge

one may expect different concentration values today versus some time in the

past. In cases where there have been substantial changes in the flow fre­

quency distribution (due to changing regulation, diversion, or consumption),

it may be very useful to look for trends or changes in raw concentration data.

This will be indicative of the combined effects of changes in human inputs to

49

Page 55: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

the stream and changes in the flow frequency distribution on the frequency

distribution of concentrations.

The presence of a large number of missing values or "less than" values

(censoring) in the records being tested does not substantially affect the

significance of the tests, although their power (ability to detect actual

trends) may be reduced. PROC SEASKEN has been tested with as much as 50

percent of the seasonal values missing or 50 percent of them censored without

any problem in significance.

The consequences of using these tests when data are serially correlated

is that the actual significance of the test becomes higher than the nominal

significance level. For monthly data, serial correlations are generally in a

range such that actual significance may be about twice as high as the nominal.

In other words, a p-level reported as 0.05 may more accurately be as high as 0.10.

The problem becomes severe where the measurements are from a large body of water

with a long residence time (by comparison with the sampling frequ y). Aquifers,

large lakes, or reservoirs, or the streams draining large lakes or reservoirs,

may present problems. Keeping the parameters SEASON (see appendicies A and B)

small, typically no larger than 12, will help avoid serious problems due to

serial correlation. When the correlation problem is thought to be severe,

reducing SEASON (reducing the number of values per year used in the test) should

prove to be helpful.

Figure 6 shows a program listing and output of a SAS job that uses

PROC SEASKEN to test for time trends in the streamflow, sulfate concentration,

and the flow-adjusted sulfate concentrations used in the regression example

shown in figure 3. The flow-adjusted concentrations were calculated by the

REG procedure using the LOGLIN model shown in figure 3 and are included in the

output data set generated by PROC REG.

50

Page 56: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

1 //F6 JOB

2 II CLASS

3 //PROCLId

00 DSN=WRD.PROCLIB*D ISP=SHR

A //A EXEC UIRDSAS,DSN1=NULLF I

LE*DSN2=NULLFILE

5 //TRENU DO USN*USERID.F I

LENAME*DISP = OL0

6 //SYSIN 00

*7

DATA OATAA;SET

TREN

D.MO

NTHL

Y;6

IF ST

ATIO

NS'

03374100

;9

L00061=LOG(PU0061 >/'

10

KEEP STATION

SNAM

E P0

0945

P0

0061

L0

0061

DE

CTIM

E/'

11

PROC SO

RT OA

TA=O

ATAA

;BY

STATION;

12

PHOC

Rk(j

OATA = OATAA NOPRINTr'BY STATION/'

13

MODE

L PO

U9A3

=L00

061;

14

OUTP

UT OUT = P

LOTOATA

P = P

R=FA

C/*

15

PROC

SORT DA

TA=P

LOTD

ATA;

BY ST

ATION;

16

PROC

SE

ASKE

N OA

T A =

PLO

TO AT A

SEASON=12;3Y ST

ATIO

N/'

17

VAR

OECT

IME

P00061 P0

0945

FA

C/'

16

/*

19

//

Figu

re 6

.--E

xamp

le in

put

and

outp

ut o

f SAS

statements to

do th

e Se

ason

al Kendall

test a

nd slope

estimator

procedure

on a

wat

er-q

uali

ty d

ata

time

ser

ies.

Page 57: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

ST

AT

IS

TIC

AL

A

NA

LY

SIS

S

YS

TE

M

ST

AT

ION

ID

EN

TIF

ICA

TIO

N

NU

MB

ER

=0337*1

00

SE

AS

ON

AL

K

EN

DA

LL

T

FS

T

AN

D

SL

OP

E

ES

TIM

AT

OR

FO

R

TR

EN

D

MA

GN

ITU

DE

WA

TER

Y

EA

RS

1973-1

9P

1

lftt

l?

1H

JP

SD

AY

, A

UG

US

T IB

, 1993

VA

RIA

BL

EN

OB

SN

VA

LS

TAU

P L

EV

EL

NO

BS

IS

T

HE

N

UM

BE

R

OF

NO

N-M

ISS

IMG

O

BS

ER

VA

TIO

NS

IN

TH

E

OR

IGIN

AL

D

AT

A.

NV

AL

S

IS

TH

E

NU

MB

ER

O

F

NO

N-M

ISS

ING

S

EA

SO

NA

L

VA

LU

ES

C

ON

ST

RU

CT

ED

.

SLO

PE

r ooo

6i

P00945

FAC

ST

RE

AM

FLO

H,

INS

TA

NT

AN

EO

US

(C

FS

)

SU

LFA

TE

D

ISS

OL

VE

D

CM

G/L

A

S

SD

«)

RE

SID

UA

LS

103

98

98

98 96

96

-0.0

20

-0.1

82

-0.2

79

0.8

37

0.0

3?

0.0

01

-60

.00

-1.3

33

-1.0

66

en

ro

Page 58: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

The results of the SEASKEN test show that no significant trend is evident

in streamflow but that both the sulfate and flow-adjusted sulfate concentrations

exhibited highly significant decreasing trends (p-level(p)<0.05) during the

period of record used in the test.

This trend can be further examined using PROC SEASRS. The data used in

this example are from a station draining a watershed containing considerable

surface coal mining. The regulations promulgated under the Surface Mine

Control and Reclamation Act of 1977 (PL 95-87) were implemented toward the

latter third of the period of record for this station (May 1979). Figure 7

shows a program listing and output of a SAS job that uses PROC SEASRS to

determine if differences exist in streamflow, sulfate concentration, and the

flow-adjusted sulfate concentration (using the LOGLIN model of figure 3) before

and after this date. The results of the SEASRS test show that no significant

step trend is evident in streamflow (p-level>0.05) but that sulfate concentration

and the flow-adjusted sulfate concentration exhibit a highly significant trend

(p-level<0.05).

The reader should be aware that both the Seasonal Kendall test and the

Seasonal Wilcoxon rank-sum test are exploratory in nature. The fact that the

Seasonal Wilcoxon rank-sum test indicates a difference between the periods in

the time series prior to and following the implementation of the surface mine

regulations does not necessarily imply causality, nor does it imply that it will

continue into the future.

53

Page 59: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

01

1 //F

7

JOb

2 //C

LA

SS

3 //

PR

OC

LId

0

0

DS

N=

WR

D.P

RO

CL

IB*D

ISP

=S

HR

4 //A

E

XE

C

*IR

US

AS

,DS

N1

=N

UL

LF

ILE

,DS

N2

=5

//T

RE

ND

D

O

I>S

N=

US

ER

ID.F

IL

EN

AM

E*D

ISP

=O

LD

6 //

SrS

IN

DD

*

7 DATA OATAA/SET

T REND. MONT HLY ,'

8 IF

STATION*

1 03374100

';9

L00061=LOG(P00061>;

10

KEEP ST

ATIO

N SN

AME

P009

45 P0

0061

L00061 DECTIME;

11

PRJC SO

RT OATA=DATAA;BY

STAT

ION;

M

PROC

RE

6 OA

TA = DA

TAA

NOPRINT/'aY

STATION;

13

MODEL P00945»L00061;

14

OUTPUT OUTsFACDATA P = p

R=FAC»*

15

PROC SORT DATA=FACDATA;Br STATION;

16

PROC SEASRS DATA=FACDATA SEASON=12 DATE=1979.33;8Y STATION;

17

VAR DECTIME P00061 P00945 FAC;

18

/*

19

//

Fig

ure

7.-

-Exa

mple

in

put

and

outp

ut

of

SAS

stat

emen

ts

to

do

the

Sea

sona

l M

ann-

Whi

tney

-Wilc

oxon

ra

nk

sum

and

sl

ope

est

ima

tor

proc

edur

e on

a

wa

ter-

qu

alit

y d

ata

time

series.

Page 60: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

ST

AT

ION

ID

EN

TIF

ICA

TIO

N

VA

RIA

BL

E

PC

006I

P009*5

F*C

MA

NN

-WH

ITN

EY

-HIL

CO

XA

NR

AN

K

SU

M

FIR

ST

S

ER

IES

(1

97

3-1

97

9)

NO

BS

N

VA

LS

ST

RE

AM

FIO

W,

INS

TA

NT

AN

EO

US

(C

FS

) 73

SU

LF

AT

C

DIS

SO

LV

ED

(N

G/L

A

S

S04)

69

RE

SID

UA

LS

69

69

6B

68

NU

PB

ER

'03

37

41

00

3 T

HU

RS

DA

Y,

AU

GU

ST

IB

.

TE

ST

F

OR

S

EA

SO

NA

L

DA

TA

CU

TO

FF

1979

1979

1979

DA

TE

.33

.33

.33

SF

CO

NO

S

ER

IES

(1

979-1

981)

NO

BS

N

VA

LS

30

29

29

29 29 28

P L

FV

EL

O.«

>0

7

0.0

06

0.0

06

ST

EP

10

50

.

-7.

OD

D

-5.3

50

NOBS IS THE NUMBER OF NON-HISSING OBSERVATIONS IN THE ORIGINAL DATA.

NVALS IS THE NUMBER OF NON-HISSING SEASONAL VALUES CONSTRUCTED.

en

en

Page 61: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

APPENDIX A: PROC SEASKEN user's guide with examples

This procedure tests for monotonic trends in time series using a modified

form of Kendall's tau (Kendall, 1975) derived by Hirsch and others (1982).

The null hypothesis for this test is that the probability distribution of the random variable does not change over time. In the Kendall's tau test, all

possible pairs of data values are compared. If a later value (in time) is

higher, a plus is recorded, if the later value is lower, a minus is recorded.

If no trend exists in the data, the probability of a later value being higher

or lower than any previous value is 0.50. In this case, the number of pluses

should approximately equal the number of minuses. If the number of pluses

greatly exceeds the number of minuses, the values later in the series are more

often higher than those earlier in the series, indicating an uptrend. If the

number of minuses greatly exceeds the number of pluses, a downtrend is indicated.

In this modified Kendall's tau, the problem of seasonality is avoided by comparing

only observations from the same season of the year. Thus, for monthly data with

seasonality, January data is compared only with January data, and so on.

Trend magnitude is determined using the seasonal Kendall slope estimator

(Hirsch and others, 1982). The slope estimate is taken to be the median of

the slopes of the ordered pairs of data values compared in the Seasonal Kendall

test:

A more complete discussion of the Seasonal Kendall test and Seasonal

Kendall slope estimator and its use are given in Smith and others (1982).

SPECIFICATIONS

The following statements may be used in the SEASKEN procedure:

PROC SEASKEN SEASON = n options;

BY variables;

VAR variables;

56

Page 62: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

The PROC SEASKEN statement invokes the procedure. The VAR statement is

used to specify the numeric variables for the analysis. The BY statement is

optional. The observations must be in chronological order. This can be done

by using PROC SORT and sorting by the variables in the BY statement followed

by DECTIME. For example:

PROC SORT; BY variable DECTIME;

PROC SEASKEN statement

The PROC SEASKEN statement has the form:

PROC SEASKEN SEASON = n options;

SEASON = n gives the number of seasonal values per year. For

example, SEASON = 12 would be used for data collected monthly

and SEASON = 52 would be used for data collected weekly.

SEASON = 1 may be used for annual summary data, such as

average annual streamflow. Each water year will be divided

into n equal length seasons. Note that for SEASON=12, for

example, the 12 seasons will not correspond exactly to the

12 calendar months since months are not of equal length.

For each season of each year, there may be no observations

(a missing value will be assumed as the seasonal value), one

observation (that value will be used as the seasonal value),

or several (not more than 400) observations (the median of

the values will be used as the seasonal value).

This statement is not optional and must be included.

The options that may be used in the PROC SEASKEN statement follow.

DATA = SASdataset gives the name of the SAS dataset to be used by

PROC SEASKEN. If it is omitted, the most

recently created SAS data set is used.

57

Page 63: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

DL1 - DL15 = detection limit

gives the detection limit of the analytical

procedures used to determine the constituent

values in the time series. The number associated

with each call of the detection limit option

refers to the order of the constituents on the

VAR statement. The use of the detection limit

option is most important when several different

analytical procedures with different degrees of

sensitivity were used to determine values of the

same constituent in the time series. In this

case, the highest detection limit of all the

procedures should be used.

The detection limit option sets all values

less than or equal to the detection limit equal

to one-half the value of the detection limit.

This option would not be used when the test

is applied to Flow-Adjusted Concentrations (FAC).

VAR statement

VAR dectime variables;

The names of the variables to be tested for trends are listed in the

VAR statement. The first variable must contain the decimal ti;ne values

corresponding to the times the observations in the time series were made.

Dectime is in the form of decimal time; for example, 12 noon, June 1, 1975,

will be 1975.4178. Up to 15 additional numeric variables may be included.

The total number of seasonal values (number of seasons times the number of

water years) may not exceed 1200. The VAR statement is not optional and

must be included.

58

Page 64: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

BY statement BY variables;

A BY statement may be used with PROC SEASKEN to obtain separate

analyses on observations in groups defined by the BY variables. The input

data set must be sorted in order of the BY variables.

DETAILS

Missing Values

Missing values may appear in a time series used in SEASKEN. The exist­

ence of missing values presents no theoretical problem for applying the

seasonal Kendall test for trend. Comparisons of data pairs where one member

is missing are not included in the calculation of the test statistic. (Inter­

nally, missing values are represented as -1E31.)

One or more seasons may be devoid of data; for example, one may use

SEASON=12 and have data only for the summer. In this case, all other months

will be set to missing values.

Formulas

The test statistic, Si, is:

ni-1 niSi = I I sgn (Xij-Xik)

k=l j=k+l

Where n-j are the number of annual values for season i,

X-jj the seasonal value for season i and year j,

X-j|< the seasonal value for season i and year k,

and

1 if e > 0sgn (0 ) = , 0 if 0 = 0

-1 if 0 < 0

59

Page 65: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

The expected value of Si is 0, E [S n-] = 0 and its variance is:

n. (n,-l)(2n,+5) - ft. (t.-l)(2t.+5) ii i j ii i

Var [Si] = 18

where ti is the extent of a given tie (number of X's involved in tie)

for season i,

and I denotes the summation over all ties.

The composite statistic of the seasonal statistics, Si, is S 1 :

season E [S 1 ] =J E [Si] = 0

and the variance of S 1 is:

season season n . (n.-l)(2n.+5)Var [S 1 ] = I Var [Si] = I J 1 n

i=l i=l 18

The normal approximation with a continuity correction of 1 (toward zero)

is used to estimate p = Prob [|S'|>_s] (the probability that S 1 will depart

from zero by the amount s or more). The standard normal deviate, Z, is

calculated by:

f S' - 1(Var S 1 ) 172 if S 1 > 0

Z = < 0 if S 1 = 0

S 1 + 1(Var S 1 ) 172 if S 1 < 0

The p-level of the test is determined from Z using the standard normal

distribution. The p-level is the probability of obtaining a Z value that is

as large or larger in absolute value than the one obtained if the null hypo­

thesis were true (i.e., there was actually no trend). If one pre-selects a

significance level a (the risk of rejecting the null hypothesis when it is

60

Page 66: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

actually true), then one should reject whenever the p-level is less than a.*

A typical value for a is 0.05.

The statistic T (tau) is:

season cT=

1=1 ni( ni

Note that T may only take on values between -1 and +1. Negative values

indicate downwards trend, positive values indicate upwards trend. It is a

type of rank correlaton coefficient between the variable and time.

The seasonal Kendall slope estimator is the median value of

d ijk = ( x ij - x ik) /(J-k ) for a 11 (Xlj. *ik) Pa^5

where d-jj^ is the slope between seasonal values for season i, year j and

season i, year k with j>k.

The slope estimate is valid only when all of the data are reported as

above the limit of detection. If there are only a few "less thans" it can be

viewed as a reasonable approximation.

Printed output

For each variable SEASKEN prints (see figures Al and A2)

1. the variable name (VARIABLE)

2. the variable label, if any

3. the total number of non-missing observations in the input data (NOBS)

4. the number of seasonal values constructed from the observations (NVALS)

5. the statistic tau (T) (TAU)

6. The significance probability (p-level) of the trend, two-sided (P LEVEL)

7. The estimate of trend magnitude, in units per year (SLOPE)

61

Page 67: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

EXAMPLES

Example 1: Annual Mean Streamflow

In this example (figure A-l), PROC SEASKEN is called to test for a

trend in the annual mean streamflow observed at a U.S. Geological

Survey streamflow gaging station. The data was entered from card input

(lines 9-19).

Example 2: NASQAN Data

In this example (figure A-2), PROC SEASKEN is called to test for

trends in 10 water quality constituents at three U.S. Geological Survey

NASQAN stations. The data was previously stored as a SAS data set on a

direct access storage device. Note that the SAS data set, TREND.MONTHLY

was sorted by STATION (line 6) so that the BY statement option (line 8)

could be used with SEASKEN.

62

Page 68: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

en CO

1 /

/ A

i2

//

CLA

iS3

//P

RO

CL

ld

OU

D

SN

=W

RD

.PR

OC

LI8

/DIS

P4

//A

E

XE

C

Wrt

OS

AS

/DS

Nl=

NU

LLF

1LE

/DS

N2

5 //

SY

SIN

D

O

*6

OA

TA

SF

LO

*/;

7 IN

PU

T

WY

EA

K

AM

U

iol/'L

IST

;8

DECT

IME=

WYEA

R-0.

25;

9 LA

BEL

AMQ=ANNUAL ME

AN STREAMFLOW;

10

CARD

S;11

1925

801U 1926

12

1932

4660 1933

13

1939

7720 1940

14

1946

7660 1947

15

1953

6300 1954

16

1960

6340 1961

17

1967

6050 1968

18

1974

9930 1975

19

1981

5540

20 21

PR

OC

S

EA

SK

EN

S

EA

SO

N=

1;

22

V

AR

D

EC

TIM

E

AM

U,'

23

/*24

//

= SHR

=NULLFILE

4760

5930

3570

3430

2840

4650

7450

7180

1927

1934

1941

1948

1955

1962

1969

1976

10800

5630

2410

6930

5100

8330

7280

8180

1928

1 935

1942

1949

1956

1963

1970

1 977

10300

3430

3650

8370

5410

3880

6840

3080

1929

1936

1943

1950

1957

1964

1971

1978

4950

5230

5950

10400

3520

2700

7130

6440

1930

1937

1944

1951

1958

1965

1972

1979

10500

6960

6880

9440

8690

5160

4450

6870

1931

1938

1 945

1952

1959

1966

1973

1980

2200

7140

4910

8290

10200

4280

11200

6470

Figu

re A

l.--

Exam

ple

input

and

outp

ut us

ing

PROC SEASKEN

to test fo

r a

tren

d in

an

nual

me

an streamflow

Page 69: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

STATISTICAL ANALYSIS SYSTEM

J5:3B THURSDAY, AUGUST IB, 1983

SEASONAL KEKOAll TEST AND SLOPE ESTIMATOR FOR TREND MAGNITUPF

WATER YEARS 1925-19P1

VARIABLE

MOBS

NVALS

TAU

P LEVFL

SLOPE

APC

ANNUAL FEAN STREAMFLOH

57

57

0.0&

0.670

9.B39

NOBS IS THE NUMBER OF NON-MISSING OBSERVATIONS IN THE ORIGINAL DATA.

NVALS IS THE NUMBER OF NON-MISSING SEASONAL VALUES CONSTRUCTED.

cr»

Page 70: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

1 //A3 JO

dI

II CLASS

3 //

PR

OC

LId

t>

0 D

SN

=W

RD

.PR

OC

LI3

/DIS

P=

SH

R4

//A

E

Xh

C

»)R

I>$

AS

/DS

N1

=N

UL

LF

ILE

/DS

N2

=5

//T

RE

ND

O

D

DS

N=

US

ER

IO.F

ILE

NA

ME

* 0

ISP

=O

L0

6 //S

rS

lND

D*

7 PROC SURT UATA=TREND.MONTHLY;BY STATION,*

8 PHOC SEASKtN

0 ATA = T«END.MONTHLY SEASON=12 DL3 = 0.1 OL4 = 0.01 OL7 = 0.1

y BY

ST

ATIO

N;10

VAR OECTIME P70300 P00410 P00630 P00665 P00915 P00925 P00930 P00940 P00945 P0095

1 1

0 ;

1 2

/*13

//

Fig

ure

A

2.~

Exa

mp

le

input

and

outp

ut

usi

ng

PR

OC

SEAS

KEN

to

test

for

tre

nd

s in

w

ate

r-q

ua

lity

constitu

ents

.

Page 71: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

ST

AT

IS

TIC

AL

A

NA

LY

SIS

S

TA

TIO

N

lOF

NT

H R

AT

ION

N

tlH

^E K

=S

Y S

I

SE

AS

ON

AL

K

EH

OA

LL

T

ES

T

AN

D

SL

OP

E

ES

TIM

AT

OR

FO

R

TR

E^

I)

MA

GM

lIU

Df

WA

TER

Y

EA

RS

1975-1

981

8:r

j?

FK

IDA

Y,

AU

GU

ST

IV

, 1

9B

3

V4R

IAIL

EM

OD

SN

VA

LS

TA

UP

LE

VE

LS

LOP

E

CT>

P70

30C

J

PD

04

13

P00639

PD

06

&5

PD

09

15

P0

09

25

P00933

PD

09

40

P00945

P3

09

50

SO

LID

S,

RF

SIO

UF

A

T 1

hO

DE

C.

C D

ISS

OL

VE

D

/IK

AL

1N

ITY

F

IELD

(M

G/L

A

S

CA

C03)

NI1

30

SE

N,

N0

2*N

03

T

OT

AL

(MG

/L

AS

N

)

I'HnS

PM

OH

US

, T

OT

AL

(MG

/L

AS

P

I

CA

LC

IUM

D

ISS

OLV

ED

(M

G/L

A

S

CA

)

KA

GW

SK

IK,

DIS

SO

LV

ED

(M

G/L

A

S

MG

)

SO

DIU

M,

DIS

SO

LV

ED

(M

G/L

AS

N

A )

CM

L3

RID

E.

DIS

SO

LV

ED

(M

G/L

A

S

CD

SU

LF

AT

E

DIS

SO

LV

ED

(M

G/L

A

S

S04)

FL

UT

RIO

E.

DIS

SO

LV

ED

(M

G/L

A

S

F)

77 66 76

76

77

77

77

77

77 77

74 63 73

73

74 74 74 74 74 74

0.1

19

-0.0

7?

0 . ?

? 3

-O.C

f.3

-0.0

77

0.0

31

-0.0

?1

0.0

93

-0.1

75

-0.0

46

0.2

59

0.^

-65

0.0

24

0.5

59

0.4

69

0.7

94

. 0.^

77

0.3

76

0.0

87

0.5

98

4 .0

00

-1.2

92

.1000

-.1

00

0E

-21

-.5000

-1000E

-29

--1

00

0E

-29

.1H

33

-.6453

--1

00

0E

-29

N3B

S

IS

TMF

NU

MR

F.1?

OF

NO

N-M

ISS

ING

O

BS

ER

VA

TIO

NS

IN

T

4F

O

RIG

INA

L

DA

TA

. N

/AL

S

IS

THE

M

UK

9ER

O

F N

ON

-MIS

SI»

G

SE

AS

ON

AL

V

AL

UE

S

CO

NS

TR

UC

TE

D.

Page 72: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

STATISTICAL

A N

A

L Y

S 1

5S

Y S

T F

M

01

SU

IItJ

V

I'JF

NT

IFIC

AT

ION

N

tJH

*Efc

=(

33

74

10

0

SF

AS

DN

AL

KE

UD

ALL

TE

ST

A

ND

S

LOP

E

ES

TIM

AT

OR

FO

R

TR

EN

D

MA

GN

ITU

DE

WA

TE

R

YE

AR

S

1973-1

981

VA

RIA

BL

E

PJ0

33

D

P00410

P00630

P30fi55

P0

09

1ri

P009?5

pooy

sa

P3

09

^0

P009I5

P009

I>:)

SO

LID

S,

RE

SID

UE

A

T If

lO

DE

C.

C D

ISS

OLV

ED

AL

K4

LIM

ITY

F

IELD

C

MC

/L

AS

C

/CD

3)

NlT

RO

RfM

t N

f.'P

+ rm

i T

3T

AI

CM

G/L

A

S

N)

PH

OS

PH

OR

US

, T

OT

AL

(MG

/L

AS

P

)

C«LC

IUM

D

ISS

OLV

ED

(H

G/L

AS

C

A)

MA

GM

FS

IUH

* D

ISS

OL

VE

D

CM

G/L

A

S

KG

)

SODI

UM,

Dis

soLv

tn

(MG

/L

AS

NA>

CH

IOR

IOE

, O

ISS

GLV

FD

(M

G/L

A

S

CD

SU

LFA

TE

D

lSS

f)LV

FD

(K

G/L

A

S

SO

*)

FLU

3R

10E

, D

ISS

OL

VE

D

(MG

/L

AS

F

)

NO

US

9B B6

93

9? 9H 98

98

98

9B 9B

NV

AL

S

96

ft'i

91 90

96

96

96

96

96

96

TA

U

-0.0

73

-0.2

H

0.?

36

0.

10

7

-O.C

05

-0.0

6^

0.1

17

0.2

PO

-0.1

PZ

-0.1

26

P L

EV

EL

0.4

00

0.0

2?

0.0

07

0.2

35

0.3

23

0.4

56

0.1

6B

0.0

09

0.0

32

0.0

7H

SLC

JPE

-2.0

00

-4.r

67

.eoo

oE-o

i

.50

00

5-0

2

-.6

66

7

-.2

00

0

.16

67

.50

00

-1.3

33

-.1

00

0E

-29

N3B

S

15

THE

N

UM

OE<

? JJ

F N

lN-M

ISS

lMG

D

BS

ER

YA

TID

NS

IN

TH

E

OR

IGIN

AL

DA

TA

. N

YA

LS

IS

IM

F

NU

MB

ER

O

F N

CN

-K.IS

SIN

G

SE

AS

ON

AL

V

AL

UE

S

CO

NS

TR

UC

TE

D.

Page 73: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

ST

AT

IS

TIC

AL

A

NA

LY

SIS

5-

YS

TtP

S

TA

TIO

N

IDE

NT

IFIC

AT

ION

N

UM

»EC

t«03

37*>

r.»nO

8:3

2

FR

IP/I

Y,

AU

f.U

ST

1

9,

19

83

SE

AS

ON

AL

K

EN

DU

L

TE

ST

A

ND

S

L3

PE

F

ST

IPA

T3*

FUR

T

RE

ND

M

AG

NIT

UD

E

WA

TER

Y

E4R

S

1975-1

9R

1

VA

RIA

BL

EN

VA

LS

T A

UP

LE

VE

LS

LOP

E

P70

3130

PO

O*.

ID

P00630

PD

05

S5

P0091&

P00925

P00933

P0

09

HO

P0

09

I5

PD

09

50

CT>

oo

sun

ns,

R

fsio

ue

AT

IPO

DEC

. c

DISS

OLV

ED

AL

KA

LIN

ITY

F

IELD

(M

G/L

A

S

CA

CD

3)

NIT

RO

GE

N,

NO

?*

K'O

3

TO

TA

L

(HG

/L

AS

N

)

FM

CIS

PM

CIR

US

, T

OT

AL

«M

f./L

A

S

P>

LA

LC

1JM

D

ISS

OL

VE

D

(MG

/L

AS

C

A)

MA

GN

FS

IUH

, D

ISS

OL

VE

D

(MG

/L

AS

M

G)

SC

IDIIJ

M.

DIS

SO

LV

ED

(M

G/L

A

S

NA

)

CH

L3

RID

Et

DIS

SO

LV

ED

(M

G/L

A

S

CD

SU

LF

AT

E

DIS

SO

LV

ED

(M

G/L

A

S

SO

*)

FL

UD

RID

E,

DIS

SO

LV

ED

1C

/L

AS

F

)

12 63 7^>

75

72

73

73

76

74 74

70

62 72

72

71 71 71 72

72

72

0.0

11

-O.O

ftl

0.1

74

0.1

30

0.0

56

-0.0

06

0.0

53

0.1

74

-0.1

47

-0.0

27

0.9

57

0.6

43

0.0

9ft

0.2

22

0.6

23

1.0

00

0.6

64

0.0

98

0.1

67

o.so

o

.5t'.

35

-.9750

.75

50

E-0

1

63

33

E-0

2

.7500

-.1

00

0E

-29

.6000E

-01

.6333

-1.7

17

-.1000E

-29

N38S

IS

T

HE

N

UH

BE

4 O

F N

ON

-MIS

SIN

G

OB

SE

RV

AT

ION

S

IN

THE

O

RIG

INA

L

DA

TA

. N

*AL

S

IS

TH

E

MJ

KIE

'J

OF

NO

N-M

ISS

ING

S

EA

SO

NA

L

VA

LU

ES

C

ON

ST

RU

CT

ED

.

Page 74: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

Appendix B: PROC SEASRS user's guide with examples

The SEASRS procedure tests for differences in the location parameters of

two separate periods in a time series using a modified version of the Wilcoxon

rank-sum test (Bradley, 1968, p. 105). This test is equivalent to the

Mann-Whitney test described in Conover (1971, p. 224). The null hypothesis

for this test is that two populations comprised by data from two separate

periods in a time series are identical. This test assumes that sampling was

random.

If the null hypothesis is true, no distinction can be made between the n

observations in the first period and the m observations in the second period

of the time series. In effect, all were taken from a common population. There­

fore, each of the possible combinations of the n+m observations taken from

the common population were equally likely to have become the two samples

actually collected. For each of these possible combinations exists a value of

the test statistic, W. This statistic is the sum of the ranks of the n

observations within the combined (n+m observations) sample. (The smallest

value in the combined sample receives a rank of 1, the next smallest a rank of

2, etc.). The null hypothesis is rejected if the value of the test statistic

W differs from the expected value of W by a preselected value corresponding to

a desired probability.

For a more thorough discussion of the Wilcoxon rank-sum test, and examples

of its use, the reader is referred to Bradley (1968, p. 105) and Hollander and

Wolfe (1973, p. 68).

SPECIFICATIONS

The following statements may be used in the SEASRS procedure:

PROC SEASRS SEASON = n DATE = x options;

BY variables;

VAR variables.

69

Page 75: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

The PROC SEASRS statement invokes the procedure. The VAR statement is

used to specify the numeric variables for the analysis. The BY statement is

optional. The observations must be in chronological order. This can be done

by using PROC SORT and sorting by the variables in the BY statement followed

by DECTIME. For example:

PROC SORT; BY variable DECTIME;

PROC SEASRS statement

The PROC SEASRS statement has the form:

PROC SEASRS SEASON = n DATE = x options;

SEASON = n gives the number of seasonal values per year.

For example, SEASON = 12 would be used for

data collected monthly and SEASON = 52 would be

used for data collected weekly. SEASON = 1 may

be used for annual summary data, such as average

annual streamflow. Each water year will be

divided into n equal length seasons. Note that

for SEASON=12, for example, the 12 seasons will

not correspond exactly to the 12 calendar months,

since months are not of equal length. For

each season of each year, there may be no

observations (a missing value will be assumed as

the seasonal value), one observation (that

value will be used as the seasonal value),

or several (not more than 400) observations

(the median of the observations will be used as

the seasonal value).

This statement is not optional and must be

included.

70

Page 76: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

DATE = xxxx gives the time separating the two periods of the

time series. DATE is in the form of decimal

time, for example, 12 noon, June 1, 1975, will be

1975.4178. If the two periods in the time series

are widely separated, any date in the gap will

suffice. An observation occurring at precisely

time DATE is placed in the second period.

This statement is not optional and must be

included.

The options that may be used in the PROC SEASRS statement follow.

DATA = SASdataset gives the name of the SAS dataset to be used by

PROC SEASRS. If it is omitted, the most recently

created SAS data set is used.

DL1 - DL15 = detection limit

gives the detection limit of the analytical

procedures used to determine the constituent

values in the time series. The number associated

with each call of the detection limit option

refers to the order of the constituents on the

VAR statement. The use of the detection limit

option is most important when several different

analytical procedures with different degrees of

sensitivity were used to determine values of the

same constituent in the time series. In this

case, the highest detection limit of all the

procedures should be used.

71

Page 77: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

The detection limit option sets all values

less than or equal to the detection limit equal

to one-half the value of the detection limit.

This option would not be used when the test is

applied to Flow-Adjusted Concentration (FAC).

VAR statement

VAR dectime variables;

The names of the variables to be tested are listed in the VAR

statement. The first variable must contain the decimal time values

corresponding to the times the observations in the time series were made.

Dectime is in the form of decimal time; for example, 12 noon, June 1,

1975, will be 1975.4178. Up to 15 additional numeric variables may be

included. The total number of seasonal values (number of seasons times

the sum of the number of water years in the first period plus the number

of water years in the second period) may not exceed 1200. The VAR statement

is not optional and must be included.

BY statement

BY variables;

A BY statement may be used with PROC SEASRS to obtain separate

analyses on observations in groups defined by the BY variables. The input

data set must be sorted in order of the BY variables.

DETAILS

Missing values

Missing values may be included in time series used in SEASRS. The

existance of missing values presents no theoretical problem for applying the

Mann-Whitney-Wilcoxon rank-sum test for seasonal data. Ranks of observations

with missing values are not included in the calculation of the test statistic.

(Internally, missing values are represented as -1E31.)

72

Page 78: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

One or more seasons may be devoid of data; for example, one may use

SEASON=12 and have data only for the summer. In this case all other months

will be set to missing values.

Formulas The test statistic, W-j, is:

niWi = I Rn

j=l

where n-j is the number of annual values for season i in the first period

in the time series,

and Rn are the ranks of the seasonal values for season i in the first

period of the time series.

The expected value of W-j is:

E [Wi] = [ ni (ni + mi + 1) ] / 2

where mi is the number of annual values for season i in the second

period in the time series,

and its variance is:

Var [Wi] = [ni mi (ni + mi +1) ] / 12.

The composite statistic of the seasonal statistic, Wi, is W and is

defined as:

seasonW = I W .

i = l i

The expectation of W is:

seasonE [W] = I E [W ]

1 = 1 i

and its variance is:

seasonVar [W] = I [W ].

1=1 i

73

Page 79: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

The normal approximation is used to estimate p = Prob [|W - E [W]|>w]

(the probability that W will depart from its expected value by the amount w or

more). The standard normal deviate, Z, is calculated by:

W - E[W] Z = (Var[W]) 1/2 .

The p-level of the test is determined from Z using the standard normal distri­

bution. The p-level is the probability of obtaining a Z value that is as large or

larger in absolute value than the one obtained if the null hypothesis were true

(i.e., there was actually no trend). If one pre-selects a significance level a (th

risk of rejecting the null hypothesis when it is actually true), then one should

reject whenever the p-level is less than a. A typical value for a is 0.05.

An estimate of the magnitude of the step trend is taken as the median of

the difference between all pairs of seasonal values, one from each period but

of the same season.

The step trend estimate is valid only when all of the data are reported

as above the limit of detection. If there are only a few "less thans" it can

be viewed as a reasonable approximation.

Printed Output

For each variable SEASRS prints (see figures Bl and B2):

1. the variable name (VARIABLE)

2. the variable label, if any

3. the number of original observations (NOBS) and number of constructed

seasonal values (NVALS) in the first series

4. the CUTOFF DATE value

5. the number of original observations and number of constructed seasonal

values in the second series

6. the significance probability of the difference, two-sided (P LEVEL)

7. the estimate of the step trend (STEP)

74

Page 80: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

EXAMPLES

Example 1: Annual Mean Streamflow

In this example (figure B-l), PROC SEASRS is called to test for differences

in annual mean streamflows observed at a U.S. Geological Survey Streamflow

gaging station before and after construction of a series of reservoirs in the

drainage basin. The data was entered from card input (lines 9-19).

Example 2: NASQAN Data

In this example (figure B-2), PROC SEASRS is called to test for differences

in 10 water-quality constituents at three U.S. Geological Survey NASQAN stations

before and after implementation of the Surface Mining Control and Reclamation

Act of 1977. The second and third stations are located in watersheds mined

for coal. The first station is not and serves as a control. Note that the

SAS data set, TREND.MONTHLY was sorted by STATION (line 6) so that the BY

statement option (line 8) could be used with SEASRS.

75

Page 81: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

1 2 3 4 5 6 7 8 910 1

112 13 14 15 16 1 7

18 19 20

21 22 23 24

//U1 JOd

// CLASS

//PROCLId

OD DSN = «IRD.PROCLIl3*DISP = SHR

//A EXEC WRDSAS/DSN1 =NU LL F I

L E/ D SN2 = NU L LF

I L E

/ / S Y S

I N

DO

*DATA SFLO

W;IN

PUT

WYEA

R AM

Q (JJ/'LIST;

DECUME = WYEAR-0.25;

LABE

L AM

U=AN

NUAL

ME

AN ST

REAM

FLOW;

CARD

S;1925

1932

1939

1946

1953

1960

1 967

1974

1981

8010

4660

7720

7660

63UO

6340

6050

9930

5540

1926

1933

1940

1947

1954

1961

1968

1975

4760

5930

3570

3430

2840

4650

7450

7180

1927

1934

1941

1948

1955

1962

1 969

1976

10800

5630

2410

6930

5100

8330

7280

8180

1928

1 935

1942

1949

1956

1963

1 970

1977

10300

3430

3650

8370

5410

3880

6840

3080

1929

1936

1943

1950

1957

1964

1971

1978

4950

5230

5950

10400

3520

2700

7130

6440

1930

1937

1944

1951

1958

1965

1972

1979

10500

6960

6880

9440

8690

5160

4450

6870

1931

1938

1945

1952

1959

1966

1973

1980

2200

7140

4910

8290

10200

4280

11200

6470

PROC SEASRS SEASON=1 DATE=1963.75;

VAR DECTIME AHQ;

/*

Fig

ure

B

l. E

xam

ple

in

pu

t an

d outp

ut

usi

ng

PROC

SE

ASRS

to

te

st

for

a st

ep

in

annu

al

mea

n st

rea

mflo

w

Page 82: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

ST

AT

IS

TIC

AL

A

NA

LY

SIS

S

TS

TE

M

MA

NN

-WH

ITN

EY

-WK

CO

XA

N

RA

NK

SU

M

TE

ST

F

OR

S

EA

SO

NA

L

DA

TA

THURSDAY, AUGUST in, 1983

VARIABLE

FIRST SERIES

(1925-1963)

MOBS

NVALS

CUT3FF DATE

SECOMD SERIES

(1964-1981)

NOBS

NVALS

P LFVEL

STEP

AFO

ANNUAL HEAN STREAKFLOH

39

39

1963.75

0.770

750.0

NOBS

IS THE NUMBER OF NON-MISSIHG OBSERVATIONS IN THE ORIGINAL DATA.

NVALS IS

THE NUMBER OF MON-MISSIMG SEASONAL VALUES CDMSIRUCTEO.

Page 83: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

1 //d2

JOI3

2 // CLASS

3 //PROCL1B

00 DSN*WRO.PROCLIB/.DISP = SHR

A //A EXEC WRDSAS,DSN1 *NULLF1LE,DSN2=NULLFILE

5 //TRENO

l)D

OSN=USERID. F

ILEN AME/-0

I SP»OL D

6 //SYS1N DO

*7

PHOC

SOKT OATA=TREND.MONTHLY;BY

STAT

ION;

8 PR

OC SEASRS DA

TA=T

REND

.MON

THLY

SEASON=12

OATE

=197

9.A

OL3=0.1

OLA=

0.01

OL?s0.1

OL9

10=0

.I;BY

STATION;

10

VAR

DECTIME

P703

00 POOA1Q P0

0630

P0

0665

P0

0915

P0

0925

P00930 P009AO P0

09A5

P009

511

0;12

/*13

//

^,

Figu

re B2.--Example in

put

and

outp

ut u

sing PROC SE

ASRS

to te

st for

step

tr

ends

in w

ater-quality

00

cons

titu

ents

.

Page 84: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

ST

AT

IS

TIC

AL

A

NA

LY

SIS

S

YS

TE

M

ST

AT

ION

ID

EN

TIF

ICA

TIO

N

NU

*«B

E**

D3

27

65

00

MA

NN

-WH

ITN

EY

-HIL

CD

XA

N

RA

NK

S

UM

T

ES

T

FO

R

SE

AS

ON

AL

D

AT

A

15

:40

T

HU

RS

DA

Y*

AU

GU

ST

IB,

1983

VA

RIA

BL

E

P7

03

00

P00410

P0

06

30

P0

06

65

P00915

P00925

P0

09

30

P00940

P0

09

45

P0

09

50

FIR

ST

S

ER

IES

(1

97

5-1

97

9)

MD

BS

N

VA

LS

SO

LID

S,

RE

SID

UE

A

T

180

DE

C.

C D

ISS

OL

VE

D

ALK

ALIN

ITY

F

IELD

(M

G/L

A

S

CA

C03)

NIT

RO

GE

N,

NO

2 * N

O 3

T

OT

AL

(M

G/L

A

S

N)

PH

OS

PH

OR

US

, T

OT

AL

(M

G/L

A

S P

)

CA

LC

IUM

D

ISS

OLV

ED

H

G/L

A

S C

A )

MA

GN

ES

IUM

, D

ISS

OL

VE

D

(MG

/L

AS

M

G)

SO

DIU

M.

DIS

SO

LV

ED

(M

G/L

A

S

NA

)

CH

LO

RID

E,

DIS

SO

LV

ED

(M

G/L

A

S

CD

SU

LF

AT

E

DIS

SO

LV

ED

(M

G/L

A

S

S0

4)

FL

UO

RID

E,

DIS

SO

LV

ED

(M

G/L

A

S

F)

49

49

49

49

49

49

49

49

49

49

47

47

47

47

47

47

47

47

47

47

CU

T3

FF

D

AT

E

1979.4

0

1979.4

0

1979.4

0

1979.4

0

1979.4

0

1979.4

0

1979.4

0

1979.4

0

1979.4

0

1979.4

0

SE

CO

ND

S

ER

IES

(1

97

9-1

99

1)

NO

BS

N

VA

LS

20

17

27

27

2B

2B 2fl

2B

2B 2B

27 16 26 26

27

27

27

27

27

27

P LE

VE

L

0.5

26

0.6

62

0.0

09

0.4

39

0.5

66

0.6

52

0.0

30

0.2

75

0.0

00

0.2

60

SIE

P

9.0

00

2.0

00

.3003

.1000E

-01

-1.0

00

.0

-1.1

00

-1.0

00

-5.0

00

.0

NO

BS

IS

T

HE

N

UM

BE

R

OF

N

ON

-MIS

SIN

G

OB

SE

RV

AT

ION

S

IN

TH

E

OR

IGIN

AL

D

AT

A.

NV

AL

S

IS

TH

E

NU

MB

ER

O

F

NO

N-K

ISS

ING

S

EA

SO

NA

L

VA

LU

ES

C

ON

ST

RU

CT

ED

.

Page 85: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

ST

AT

IS

TIC

AL

A

NA

LY

SIS

S

YS

TF

M

ST

AT

ION

ID

EN

TIF

ICA

TIO

N

NU

MB

ER

=0337*1

DO

MA

NN

-WH

ITN

EY

-HJ

LC

OX

AN

R

AN

K

SU

M

TE

ST

F

OR

S

EA

SO

NA

L

DA

TA

15M

O

TH

UR

SD

AY

. A

UG

US

T

18,

1983

VA

RIA

BL

E

FIR

ST

S

ER

IES

(1973-1

979)

MOBS

NVALS

CUTOFF DATE

SECOMD SERIES

(1979-19B1)

NOBS

NVALS

P LEVEL

STEP

P70300

P00410

P 0

0630

P0

06

65

P00915

P00925

P00930

P00940

P00945

§

P00950

SO

LID

S,

RE

SID

UE

A

T

10

0

DE

C.

C D

ISS

OL

VE

D

AL

KA

LIN

ITY

F

IEL

D

(HG

/L

AS

C

AC

03)

NIT

RO

GE

N*

N0

2+

N0

3

TO

TA

L I *G

/L

AS

N

)

PH

OS

PH

OR

US

* T

OT

AL

(HG

/L

AS

P

I

CA

LC

IUM

D

ISS

OLV

ED

(N

G/L

A

S

CA

)

MA

GN

ES

IUM

* D

ISS

OL

VE

D

(MG

/l

AS

M

G)

SO

DIU

M*

DIS

SO

LV

ED

(M

G/L

A

S

NA

)

CH

LO

RID

E*

DIS

SO

LV

ED

(M

G/L

AS

C

L1

SU

LFA

TE

D

ISS

OLV

ED

(M

G/L

A

S

SO

*)

FLU

OR

ID

E.

DIS

SO

LV

ED

(M

G/L

AS

F

)

70

70

65

64 70

70

70

70

70

70

69

69

6*

63

69

69

69

69

69

69

1979.

40

19

79

. 40

1979.4

0

19

79

.40

19

79

.40

1979.4

0

1979.4

0

1979.4

0

1979.4

0

19

79

.40

2B 16 ?n 28 2B 2B ?B 2B 2B 28

27 15 27

27 27 27 27

27

27

27

0.1

66

0.2

11

0.0

01

0.6

54

0.5

7B

0.2

45

0.5

7B

0.6

0B

0.0

06

0.7

46

-14.5

0

-14

.00

.5000

.1000E

-01

-2.0

00

-2.0

00

.6000

1.0

09

-7.0

00

.0

NC1BS

IS THE NUMBER OF NON-MISSING OBSERVATIONS IN THE ORIGINAL DATA.

NVALS IS

THE NUMBER OF NON-MISSING SEASONAL VALUES COMSTRUCTED.

Page 86: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

ST

AT

ION

IDE

NT

IFIC

AT

ION

MA

NN

-WH

1T

NE

Y-H

1L

CO

XA

N

RA

NK

S

UM

VA

RIA

BL

E

P70300

P0

04

10

P0

06

30

P0

06

65

P00915

P00925

P0

09

30

P00940

P00945

P0

09

50

SO

LID

S,

RE

SID

UE

A

T

1PO

D

EC

. C

DIS

SO

LV

ED

AL

KA

LIN

ITY

F

IEL

D

(MG

/L

AS

C

AC

03 )

NIT

RO

GE

N,

N0

2*N

03

T

OT

AL

(MG

/L

AS

N

)

PH

OS

PH

OR

US

, T

OT

AL

(M

G/L

A

S

P)

CA

LC

IUM

D

ISS

OL

VE

D

(MG

/L

AS

C

A)

MA

GN

ES

IUM

, D

ISS

OL

VE

D

(MG

/L

AS

M

G)

SO

DIU

M,

DIS

SO

LV

ED

(M

G/L

A

S

NA

)

CH

LO

RID

E,

DIS

SO

LV

ED

(M

G/L

A

S

CD

SU

LF

AT

E

DIS

SO

LV

ED

(M

G/L

A

S

S0

4I

FLU

OR

IDE

, D

ISS

OL

VE

D

(MG

/L

AS

F

)

FIR

ST

S

ER

IES

(1

97

5-1

97

9)

VDBS

NV

ALS

47

4

6

47

46^

46

4

6

46

46

45

45

46

45

46

45

47

46

47

4

6

47

46

TE

ST

FO

R

S Y

S T

F 3

3 7

9 530

SE

AS

ON

AL

DA

TA

M }*

>:**

SE

CO

MO

S

ER

IES

(1

97

9-1

9R

1)

CU

TO

FF

D

AT

E

NO

BS

N

VA

LS

19

79

.40

1979.4

0

1979.4

0

1979.4

0

1979.4

0

1979.4

0

1979.4

0

1979.4

0

1979.4

0

1979.4

0

25

16

29

29

27

27

27

29

27

27

?4 16 26

26 26

26 26 26 26

26

0 T

HU

RS

DA

Y,

P LE

VE

L

0.7

88

0.2

79

0.1

6B

0.1

33

O.P

42

0.1

39

0.5

47

0.5

12

O.O

B?

0.3

5?

AU

GU

ST

IP

,

ST

EP

-3.5

00

-10

.00

.30

00

.30

00

E-O

J

-1.0

00

-2.0

00

-1.0

00

-1.0

00

-8.0

00

.3

NO

RS

IS

TH

E

NU

MB

ER

OF

NO

N-M

ISS

IMG

O

BS

ER

VA

TIO

NS

IN

TH

E

OR

IGIN

AL

D

AT

A.

NV

ALS

IS

TH

E

NU

MB

ER

O

F N

ON

-MIS

SI1

G

SE

AS

ON

AL

VA

LU

ES

C

ON

ST

RU

CT

ED

.

Page 87: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

Appendix C: Source code for SAS procedures

Two separate programs are required to add a procedure to the Statistical

Analysis System at a user's installation, a parsing module and a procedure

module. The parsing module acts as a control program for the procedure and

defines permissible options and parameters for the procedure. The procedure

module inputs the appropriate data and computes the test statistic. The parsing

module for Proc SEASKEN is given in figure C-l. The procedure module is given

in figure C-2. The parsing module for Proc SEASRS is given in figure C-3.

The procedure module is given in figure C-4. Information about SAS parsing

and procedure modules can be found in the SAS Programmer's Guide (SAS Institute,

Inc., 1981a). Only minimal JCL is shown since JCL is highly installation

dependent.

82

Page 88: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

oo CO

1 2 3 A 5 6 7 8 910 1

112 13

1 A

15 16 17 18 19

//C1 JOb

// CLASS

// EXEC ASMSAS

//ASM.SYSIN DD

*PRINT

NOGEN

PROC

SASPROC NAME=SEASKEN,LOADMOD=SEASKEN2,DEFLIST=1

tDEFMODE=NUMERIC

PARMS

SASLIST

DL1,1,DL2,2,DL3,It

DL4,4,DL5,5,MODE=NUMER I

C

PARMS

SASLIST

DL11/11

tDL12t

12,DL13,13,DL14/U,MODE=NUMERIC

PARMS

SASLIST

DL15,15/SEASON,16/MODE=NUMER1C

LISTS

SASLIST

VARIABLESt

1tVAR

t1*MODE=NUMERIC

SASEND

END

//LKED.SYSIN DD

*SETSSI ACU00003

NAME SEASKEN(R)

/*

Figure

Cl.

--Pa

rsin

g module fo

r the

Seas

onal

Kendall

test

an

d slope

estimator

proc

edur

e

Page 89: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

fD

0ro

i-a-sonfDexc-sfD

3OO-£1

fD

-bO-srt-rrfD

OOfDOJCOO3CU

7^fD3CLQ)

t

rt-fDtort-

&3 0.

to

O-afD

fD tort- _i.3 CUrt-O-s a-s0ofDO.C-sfD

Zooooc'<r>3^35c;o;ci-.» » > > O m o II m m m z as < r- r- -« a c » > > -«

»-» C co II » » o*- z z co T3O xococm»-'3>3>»^m 0 »113300110 XZZ»

Z«<-H>"T> ^33* > --» O Z - >. m 3 Z 3 -» ^ <-> | «N m -4

^- O -* ui Z "O

> o O m > 3» >> 2 0* 1- CO Z20 O > m T3-to o >. 03 r- o-< 3 " > m ON oo c s x r- v/i Nmo rn 3 ON ^ ZNO z > 1-1 v/» > r-

o oo > Z ZCD X oo -» -n cir~ -v ui o >O < 1 >^ 30 Z0 » -» 3 <A » > 3» H-, O Z 33

> m >-> o as L>4 TI >r- -» o zm ^« M -n 31-

>Z n O>Z n>Zc_Coo-4

XZ n»

Z nO>

n> Z

C

-H

CO

oomzmooo oc33>-l>?>23 S QJ

OC ff)»OOO| OC22;oomoo>22T32C:

o » r- x -tV.~va O»«^«^>«^l-.

>>»-»»-»3o o>-»-imSOJ «^-»3coC-tui>mr>ov^> mz>«-'-t:c

S^N >C-t co^«>

Z v/» m > ^ o Z23»-^ -lXi-i-»T3<-13 3>"DIVim^-<m ><»O«-«ZT3> T3m>-iO-»> me" m^oz^v^Z^J» si-i-t-i^oZ Q3 -< «M V/1 (JO-Dm 33 o ^ ooor- > o ^00 -< -^ -*> ^» > w»2 -* m ^r- o < > z ^ m zo z < > >z r-< 00J, /^X -»O U»

z >2 Z> c»3 >m -«> mZ 00r- «> <\jm ^m >r- -«> >z c n ^»O -»X V/13 ^> >Z

-n

O^33%

C Z CD OJQ

0c:-H

zm

-H

O

mj»c»

z

M cm

o03COmx<> Mi iozoo

>zo nOX)3

-4

Xm

oom»oooz J»r-

< j>r-c mCO

-* X 0O co m r~

»c -< o >

-H>a3>o>mo-H>-n<<:<m»>o of -"^ or-«-r-3r->zor- it -»-tor--t 3zoTJ| -Hr--Dr-O-tT3| ^Zfc-ll r»f-^-3>3 33

m c >-> Z<co22m -nr-oo-tO co-i»«-z <<:-* occoco-<T}zcooCOmmmZC » i-*<3oo» x »-*C> * m »<r>-»x>03 oooo3»~v»oo

C X X 3C« *-. » X X CO -> 1-i» m m »O z-» mx»<Ji>

m <^ c o v^ -tOO-HO 3-nO voo Cm> ff>OD > oo^vr-co-t om<-t i -l-t> *3 3> J» OZCO -< » TJ < OO O O i-" m >

-t -n > * * Z» -» Q3 -» > -1 O < 1 W Z1-1 » m »^ oOO 33 OO 03-t 1-1 001-1 » T> *+

0 03 50 -»oo r~ o >j\ m 3 ~

00 >00 Z

m » <.X 00 J»o r-r- ooc: ^xCO -»>-< v/»

m >Z

o c» n 3»

-4

-t mX 00m *^

<\j H '-'f-^ \

3 -4m j»

C< <^> ->33 Ut> 1 V^

> >CDf-m

<v;

c_0a

Page 90: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

51

C SAVE LABEL.

52

DO 11

J=1 ,5

53

LA8EL(J,I )=NLABEL(J)

54

11 CONTINUE

55

N08S(I)=0

56

NVALSCI)=0

57

10 CONTINUE

58

SETUP*.FALSE.

59

C CYCLE TO GET EACH OBSERVATION.

60

20 CALL INPUT(IEND)

61

C WRAP UP IF

ALL OBSERVATIONS HAVE BEEN PROCESSED.

62

IF(IEND.EQ.1)GO TO 40

63

C G

ET

A

N

OB

SE

RV

AT

ION

.6

4

KO

BS

=K

OB

S+

16

5

CA

LL

tfA

RX

<1

/Y>

66

IF

(SE

TU

P)

GO

TO

8

067

C FIRST OBSERVATION* GET READY.

68

C CALCULATE TIME OF OCT.

1 OF WATER YEAR OF FIRST OBSERVATION.

69

YEAR=Y(1)+0.25

70

dASETM=IFIX(YEAR)-0,25

71

NDATESC1)=YEAR

72

C GET NUMBER OF

SEASONS.

73

PERYR=PARM(16)

74

DO 70 1=1,1200

75

HAVE(I)=.FALSE.

76

70 CONTINUE

77

LAST=1

78

SETUP*.TRUE.

79

80 CONTINUE

80

C PROCESS OBSERVATION,

81

M=CYC1)-BASETM)*PERYR+1.0

82

IF (M.GE.LAST) GO TO 200

83

WRITE (IPRINT,9001> KOBS

84

9001 FORMAT

(' OBSERVATION NUMBER

1,110,

85

& '

IS OUT OF CHRONOLOGICAL ORDER.

1)

86

STOP

87

200 CONTINUE

88

IF CM.LE.1200) GO TO 210

89

WRITE <IPRINT,9002) KOBS

90

9002 FORMAT

(' OBSERVATION NUMBER', 110,'

IS LATER THAN SEASON 1200.')

91

STOP

92

210 CONTINUE

93

C MULTIPLE OBSERVATIONS?

94

IF CHAVE(M)) GO TO 90

95

C IMO. SAVE.

96

HAVECM)=.TRUE.

97

K = 2

98

LAST=M

99

DO 30 1=1,NV

100

C PREPARE FOR MULTIPLE OBSERVATIONS.

Page 91: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

101

VAL=FIXMIS(Y(I+1))

102

L(I)=0

103

IF (VAL.GT.XCHEK) L(I)=1

104

IF (VAL.GT.XCHEK) NOBS(I) = NOBS( I)+1

105

IF (VAL.GT.XCHEK) NVALS(I)=NVALS(I)+1

106

X(M*I)=VAL

107

SORT(1,I)=VAL

108

30 CONTINUE

109

GO TO 20

110

C MULTIPLE OBSERVATIONS

111

90 CONTINUE

112

00 110 1=1,NV

113

IF (K.EQ.2.AND.L(I).EQ.1) NVALS( I

) = NVALS(I)-1

114

VAL=FIXMIS(Y(I+1))

115

IF (VAL.LT.XCHEK) GO TO 110

116

NOBS(I)=NOBS(I)+1

117

L(I)=L(I)+1

118

SORT(L( I),I)=VAL

119

110 CONTINUE

120

CALL INPUT(IEND)

121

C CYCLE UNTIL NEW SEASON.

122

IF (IEND.EQ.1) GO TO 120

123

KOBS=KOBS+1

124

CALL VARX(1*Y)

125

NEWM*(Y(1)-BASETM)*PERYR+1.0

126

IF (NEWM.NE.M) GO TO 120

127

K=K+1

128

C LIMIT TO 400 OBSERVATIONS* MISSING OR NOT* IN ONE SEASON.

129

IF (K.LE.400) GO TO 90

130

WRITE (IPRINT*9005) KOBS

131

9005 FORMAT

( AT OBSERVATION NUMBER,M10,

132

& '

THERE WERE MORE THAN 400 OBSERVATIONS IN THAT SEASON.

1)

133

STOP

134

C GET MEDIANS.

135

120 CONTINUE

136

DO 130 1=1,NV

137

C ANY NON-MISSING OBSERVATIONS?

138

IF (L(I).EQ.O) GO TO 130

139

C YES.

140

NVALSU )=NVALS(I) + 1

141

IH=(L(I)+1)/2

142

EVEN=2*IH.EQ.L(I)

143

C FIND MEDIAN.

144

CALL VSRTA(SORT(1

,1 ),L(I) )

145

IF (.NOT.EVEN) X(M,I)= SORT(IH,I)

146

IF (EVEN)

X(M,I)=(SORT(IH,I)+SORT(IH+1,I))/2.0

147

130 CONTINUE

148

LAST=M

149

C CONTINUE PROCESSING IF

END-OF-FILE NOT ENCOUNTERED.

150

IF (IEND.NE.1 )

GO TO SO

Page 92: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

151

40 IF (M.GT.1) GO TO 50

152

WRITE

( IPRINT/9003)

153

9003 FORMAT

(' THERE ARE FEWER THAN

2 SEASONS.

1)

154

STOP

155

50 CONTINUE

156

N=LAST

157

NDATES(2)=Y(1)+0.25

158

IF (LAST*(LAST/PERYR+1,0).LE.60000.0) GO TO 60

159

vJRI

TE (IPRINT/9004)

160

9004 FORMAT

(' THE COMBINATION OF

YEARS AND SEASONS EXCEEDS

1/

161

& '

AN INTERNAL LIMIT.

1)

162

STOP

163

60 CONTINUE

164

DO

1 50

M = 1/LAST

165

IF (HAVECM)) GO TO 150

166

DO 140

1 = 1,NV

167

X(M/I)=XMISS

168

140 CONTINUE

169

150 CONTINUE

170

RETURN

171

END

172

C PERFORM KENDALL TEST.

173

SUBROUTINE SEAS

174

COMMON /STATS/ NV/N/NOBS(15)/NVALS(15),NDATES(

2),TAU(15)/

175

& ALPHA(15)/SLOPE(15)

176

COMMON /DATA/ X(1200,15>

177

REAL YC60000)

00

178

REAL*8 PARM

-J

179

REAL XCHEK/-1.0E30/

180

LOGICAL ODD

181

LOGICAL*1 WASTIEC1200)

182

NPER=PARM(16)

183

PERYR=NPER

184

DO

1 J=1/NV

185

C BYPASS DETECTION LIMIT PROCESSING IF

NONE SPECIFIED.

186

IF (PARMCJ).EQ.O.ODO) GO TO 50

187

DLIMIT=PARM(J)

188

DO 100 I=1/N

189

IF (X(I/J).LE.DLIMIT.AND.XCI,J).GT.O.O)

X( I/J )=0.5 *DL IMIT

190

100 CONTINUE

191

50 CONTINUE

192

C ZERO OUT THE COUNTERS.

193

DO 60 1=1,N

194

WASTIECI)=.FALSE.

195

60 CONTINUE

196

NPLUS=0

197

NMINUS=0

198

NCOMPT=0

199

VARTOT=0.0

200

INDEX=0

Page 93: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

201

FIXVAR=0.0

202

C LOOP THROUGH THE SEASONS.

203

DO 10 ISEAS*1,NPER

204

NCOMP=0

205

N1=N-NPER

206

C LOOP THROUGH YEARS FOR VALUES IN SEASON ISEAS.

207

DO 20 ISTART=ISEAS,N1,NPER

208

C VALID VALUES?

209

IF

(X(ISTART,J).LE.XCHEK) GO TO 20

210

C VALUE IS ALWAYS TIED WITH ITSELF.

211

NTIE=1

21

2

N2=

IST

AR

T+

NP

ER

21

3

C T

RY

E

AC

H

LA

TE

R

SE

AS

ON

.214

DO

3

0

IEN

D=

N2

*N,N

PE

R215

C VALID VALUE?

216

IF (X(IEND,J).LE.XCHEK) GO TO 30

217

C COMPARE.

218

NCOMP=NCOMP+1

219

INDEX=INDEX+1

220

YY=(X(IEND,J)-X(ISTART,J))/«IEND-ISTART)/PERYR)

221

IF (YY.GT.0,0) NPLUS=NPLUS+1

222

IF (YY.LT.0.0) NMINUS=NMINUS+1

223

IF (YY.EQ.0.0) NTIE=NTIE+1

224

C MARK VALUES THAT ARE TIED.

225

IF (YY.EQ.0.0) WAST IE(I END) = .TRUE.

226

C SAVE ADJUSTED DIFFERENCES.

227

Y(INDEX)=YY

228

30 CONTINUE

00

229

C UPDATE VARIANCE CORRECTION IF TIES OCCURED AND TIES

230

C WERE NOT COUNTED BEFORE.

231

IF (WTIE.NE.1.AND..NOT.WASTIE(ISTART))

FI XVAR=FI XVAR+NT IE*(NT IE-

232

& 1.0)*(2.0*NTIE+5.0)/18.0

233

20 CONTINUE

234

C ACCUMULATE THIS MONTH'S RESULTS.

235

NCOMPT=NCOMPT+NCOMP

236

NMONTH=(1.0+SQRT(1,0+8.0*NCOMP))/2.0

237

VARTOT*VARTOT+NMONTH*(NMONTH-1.0)*(2.0*NMONTH+5.0)/18.0

238

10 CONTINUE

239

C DONE COMPARING.

240

S=NPLUS-NMINUS

241

VARTOT=VARTOT-FIXVAR

242

C WERE THERE ANY VALID COMPARISONS AND AT

LEAST TWO DIFFERENT VALUES?

243

IF (NCOMPT.GT.O.AND.VARTOT.GT.O.O) GO TO 40

244

C NONE. GO HOME EMPTY.

245

TAU(J)=0.0

246

ALPHA(J)=1.0

247

S'LOPE(J)=0.0

248

GO TO

1249

40 CONTINUE

250

C CALCULATE THE STATISTICS.

Page 94: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

251

TAU(J)=S/NCOUPT

252

C CONTINUITY CORRECTION.

253

IF (S.GT.0.0)

S = S-1

254

If (S.LT.0.0) S=S*1

255

Z=S/SQ*T(VARTOT)

256

C COMPARE TO THE STANDARD NORMAL DISTRIBUTION.

257

IF (Z.LE.0.0) ALPHA(J)=2.0*C0FN(Z)

258

IF (Z.GT.0.0) ALPHA(J)=2.0*(1.0-CDFN(Z))

259

C SORT THE DIFFERENCES. VSRTA

IS AN IMSL ROUTINE.

260

CALL V/SRTA (Y,INDEX)

261

C PICK THE MEDIAN.

262

ODO = MOD (INDEX,2) .EQ.1

263

IF (ODD) YMED=Y((INDEX+1)/2)

264

IF (.NOT.ODD) YMED=0.5*(Y(INDEX/2)+Y((INDEX/2)+1))

265

SLOPEU )=YMED

266

IF (SLOPEU).NE.0.0) GO TO

1267

C ADJUST FOR THE FACT THAT TAU AND ALPHA MAY SAY THERE

IS A

268

C SIGNIFICANT TREND BUT THE ESTIMATE OF THE SLOPE

IS269

C ZERO DUE TO TIES.

270

IF (NMINUS.GT.NPLUS) SLOPE(

J )=-1.0E-30

271

IF (NMINUS.LT.NPLUS) SLOPE(

J )=1.0E-30

272

1 CONTINUE

273

RETURN

274

END

275

C REPORT RESULTS.

276

SUBROUTINE OUTPUT

277

COMMON /LABCM/ NAME,LABEL

278

REAL*8 NAME(15),LABEL(5,15>

C5

279

COMMON /STATS/ NV,N,NOBS(15),NVALS(1 5),NDATES(2),TAU(1 5)*

280

& ALPHAM 5),SLOPE(1 5)

281

COMMON /IOUNIT/ IPRINT

282

C STANDARD SAS HEADING.

283

CALL STITLECO,LINES)

284

WRITE

( IPRINT,6001) NDATES

285

6001 FORMAT (/26X,'SEASONAL KENDALL TEST AND SLOPE ESTIMATOR FOR'/

286

& '

TREND MAG NI TUD E '

/ MOX, '

W AT E R YEARS

' ,

I 4, '

- f

, U / / )

287

WRITE (IPRINT,6002)

288

6002 FORMAT C VARIABLE*

,50X, NOBS

NVALS

TAU

P',

289

& '

LEVEL

SLOPE'/1X,107( '-')/)

290

00 10 1=1,NV

291

WRITE (IPRINT,6003)

NAME(I),(LABEL(J/I),J=1,5),NOBS(I),NVALS(I)

292

£ TAU( I),ALPHA(I),SLOPE(I)

293

6003 FORMAT (1X,A8/3X,5A8,2I10,2F10.3/G15.4/)

294

10 CONTINUE

295

WRITE

( IPRINT,6004)

296

6004 FORMAT (/" NOBS IS

THE NUMBER OF NON-MISSING OBSERVATIONS',

297

& '

IN THE ORIGINAL DATA.'/

298

S *

NVALS IS

THE NUMBER OF NON-MISSING SEASONAL VALUES',

299

& ' CONSTRUCTED.')

300

RETURN

Page 95: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

301

EN

D30

2 c

CUM

ULAT

IVE

DIS

TRIB

UTI

ON

FU

NCTI

ON

FOR

THE

NORM

AL

DIS

TRIB

UTI

ON

.303

C PRIMARY REFERENCE

IS ABRAMOWITZ AND STEGUN/

304

C N8S HANDBOOK OF MATHEMATICAL FUNCTIONS/ EQ. 26.2.19.

305

FUNCTION CDFN(X)

306

IF

(X) 10/20/30

307

10 CONTINUE

308

IF (X.LT.-6.0) GO TO 40

30V

T=-X

31

0

CD

FN

=0

.5/(

1.0

+0

.04

98

67

34

70

*T+

0.0

21

U1

00

61

*T**

2+

0.0

03

27

76

26

3*T

**3

31 1

X

+ 0.3

80036E

-4*T

**4+

0..488906E

-4*T

**5 +

0.5

3830E

-5*T

**6)*

*16

31

2

RE

TU

RN

313

20 CONTINUE

314

CDFN=0.5000

315

RETURN

316

30 CONTINUE

317

IF (X.GT.6.0) GO TO 50

318

CDFN=1.0-0.5/(1.0+0.0498673470*X+0.0211410061*X**2+0.0032776263*X

319

X**3+0.380036E-4*X**4+0.488906E-4*X**5+0.53830E-5*X**6)**16

320

RETURN

321

40 CONTINUE

322

CDFN'0.0000

323

RETURN

324

50 CONTINUE

325

CDFN=1.0000

326

RETURN

327

END

328

C CONVERT

A SAS MISSING VALUE TO ONE RECOGNIZED BY THESE ROUTINES.

329

FUNCTION FIXMIS(X)

330

REAL*8 X/VALUE

331

EQUIVALENCE(VALUE/M1SSX)

332

VALUE=X

333

IF (VALUE.EQ.O.ODO.AND.MISSX.NE.O) VALUE=-1.OD31

334

FIXMIS=VALUE

335

RETURN

336

END

337

//LKED.SYSIN DD

*338

ENTRY ENTRY

THIS STATEMENT MUST BE PRESENT

339

SETSSI ADOOOOOO

340

NAME SEASKEN2(R>

341

/*

342

//

Page 96: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

1 //C3 JOB

2 //

CLASS

3 // EXEC AS

rtSA

S4

//ASM.SYSIN DD

*5

PRINT

NOG EN

6 PROC

SASPROC NAME=SEASRS,LOADMOD=SEASRS2,DEFLIST=1

,7

DEFHODE=NUMERIC

8 PARMS

SASLIST

9 PARMS

SASLIST

10

PARMS

SASLIST

11

PARMS

SASLIST

DL15,15

,SEASON,16

,DATE

,17,MODE=NUMERIC

12

LISTS

SASLIST

13

SASEND

1 I*

END

15

//LKED.SYSIN DO

*16

SETSSl ACU00003

17

NAME SEASRSCR)

18

/*19

//

Fig

ure

C

3.-

-Pars

ing

mod

ule

for

the

Sea

sona

l M

ann-W

hitn

ey-

Wilc

oxo

n

rank

sum

te

st

and

slope

estim

ato

r p

roce

du

re.

Page 97: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

1 //C4 JOB

2 // CLASS

3 // EXEC FORTSAS

4 //C.SYSIN DU

*5

C MOTIF* SAS.

6 CALL SASFHX

7 C

PROCESS THE DATA.

8 C

GET NUMBER OF VARIABLES FROM SAS.

9 NV1=NOVAR(1)

10

C NV IS THE NUMBER OF VARIABLES EXCLUSIVE OF THE TIME VARIABLE.

11

NV=NV1-1

12

IF (NV.GT.O) GO TO 10

13

CALL VARERR

14

STOP

15

10 CONTINUE

16

C READ IN

DATA.

17

CALL READ (NV1)

18

DO 20 J=1,NV

19

C COMPUTE RANK SUM FOR EACH VARIABLE.

20

CALL SEASRS (J)

21

20 CONTINUE

22

C WRITE OUT RESULTS.

23

CALL OUTPUT (NV)

24

STOP

25

END

26

C SUBROUTINE TO READ IN THE OBSERVATIONS AND FORM THE SEASONAL VALUES,

27

SUBROUTINE READ (NV1)

28

COMMON /DATA/ X(1200

115)

,NX1 ,NX2

,ALPHA(15)

DF(15)

,CUTOFF,

29

& NOBS1(15>,NOBS2<15>,NVALS1(15>,NVALS2(15>,NDATES<4)

30

REAL*8 CUTOFF

31

COMMON /LABINF/ NAME(15)*LABEL<5,15)

32

INTEGER NOBS<15)

,NVALS(15)

33

DIMENSION L(15)

34

COMMON /IOUNIT/ IPRINT

35

REAL*8 NAME/LA3EL/Y<16>*PARM,BASETM/PERYR

36

REAL SORT<400*15>

37

LOGICAL*1 HAVE(1200)t

SETUP,SECOND,EVEN

38

COMMON /NAMECM/ NTYPE

tNPOS,NLNG*NVARO,NNAME,NLABEL,NFORM,NIFORM,

39

& NFL,NFD*NF,NJUST

40

INTEGER*2 NTYPE,NPOS,NLNG,NVARO,NFL,NFD,NF

,NJUST

41

REAL*8 NNAME,NLABEL<5),NFORM,NIFORM

42

REAL XCHEK/-1.0E30//XMISS/-1.OE31/

43

M = 0

44

KOBS=0

45

NV=NV1-1

46

C GET SPECIFICTION OF EACH VARIABLE.

47

DO 10 1=1,NV

48

C CALL SAS TO LOAD COMMON BLOCK.

49

CALL NAMEVC1,1+1,NTYPE>

50

C SAVE NAME.

Fig

ure

C

4.-

-Pro

cedure

m

odul

e fo

r th

e

Sea

sona

l M

an

n-W

hitn

ey-

Wilc

oxo

n

rank

sum

te

st

and

slope

estim

ato

r p

roce

du

re.

Page 98: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

51

NAME<I>=NNAME

52

C SAVE LABEL.

53

00

11 J=1,5

5A

LABELCJ/ I)=NLABEL<J)

55

11 CONTINUE

56

NOBS(I)=0

57

NVALS(I>=0

58

10 CONTINUE

59

SETUP=.FALSE.

60

SECONi)=.FALSE.

61

MBASd = 1

62

C CYCLE TO GET EACH OBSERVATION.

63

20 CALL INPUT(IEND)

64

C WRAP UP

IF ALL OBSERVATIONS HAVE BEEN PROCESSED.

65

IF (IENO.EQ.1) GO TO AO

66

C

GE

T

AN

O

BS

ER

VA

TIO

N.

67

K

OB

S=

K03S

+1

68

C

AL

L

VA

RX

d/Y

)69

IF

(SE

TU

P)

GO

TO

7

070

C FIRST OBSERVATION/ GET READY.

71

C CALCULATE TIME OF OCT.

1 OF WATER YEAR OF FIRST OBSERVATION,

72

YEAR=Y(1)+0.25

73

NDATESC1)=YEAR

74

BASETM=IFIX(YEAR)-0.25

75

C GET NUMBER OF

SEASONS.

76

PERYR=PARM(16)

77

C GET CUTOFF DATE.

78

CUTOFF=PARM(17)

79

DO 60 1=1/1200

80

HAVE(I) = .FALSE.

81

60 CONTINUE

82

LAST=1

83

SETUP=.TRUE.

84

C PROCESS OBSERVATION.

85

70 CONTINUE

86

IF (SECOND.OR. Yd ).LT. CUTOFF) GO TO 80

87

C FIRST OBSERVATION AFTER CUTOFF DATE.

88

NDATES(2)=YEAR

89

SECOND=.TRUE.

90

MBASE=LAST+1

91

NX1=LAST

92

DO 75 I=1/NV

93

NOBS1(I)=NOBS(I)

94

N03S(I)=0

95

NVALS1( I)=NVALS(I)

96

NVALS(I)=0

97

75 CONTINUE

98

YEAR=Y(1>+0.25

99

aASET,"l=IFIX(YEAR)-0.25

100

NDATES(3)=YEAR

Page 99: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

10

1

80

CO

NT

INU

E102

YE

AR

=Y

(1)+

0.2

51

03

M

=(Y

d)-

8A

SE

TM

)*P

ER

YR

+M

8A

SE

104

IF

CM

.GE

.LA

ST

) G

O

TO

90

105

WR

ITE

(1

PR

INT

/90

01

) K

03

S106

90

01

F

OR

MA

T

('

OB

SE

RV

AT

ION

N

UM

BE

R1,H

O,

10

7

& '

IS

OU

T

OF

CH

RO

NO

LO

GIC

AL

O

RD

ER

.1

)108

ST

OP

109

90 CONTINUE

110

IF (M.LE.1200) GO TO 100

111

WRITE (IPRINT,9002) K09S

112

9002 FORMAT

( OBSERVATION NUMBER', 110,'

IS LATER THAN SEASON 1200.')

113

STOP

114

100 CONTINUE

115

C MULTIPLE OBSERVATIONS?

116

IF (HAVE(M) )

GO TO 110

117

C NO. SAVE.

118

HAVE(M)=.TRUE.

119

K=2

120

LAST=M

121

00 30 1=1,NV

122

C PREPARE FOR POSSIBLE MULTIPLE OBSERVATIONS.

1 23

VAL=FIXMIS (YU+1 )

)124

L(I)=U

125

IF (VAL.GT.XCHEK) L(I)=1

126

IF (VAL.GT.XCHEK) NOBS(I)=N08S(I)+1

127

IF (VAL.GT.XCHEK) NVALS(I)=NVALS(I)+1

128

SORTU, I)=VAL

129

30 X(M,I)=VAL

130

GO TO 20

131

C MULTIPLE OBSERVATIONS

132

110 CONTINUE

133

00 130 1=1,NV

134

IF (K.EQ.2.AND.L(I),EQ.1 )

NVALS ( I

)=NVALS(I)-1

135

VAL=FIXMIS(Y(I+1) )

136

IF (VAL.LT.XCHEK) GO TO 130

137

N08S(I)=NOaS(I)+1

138

L(I) = L< I)

+ 1

139

SORT(L( I)»I) = VAL

140

130 CONTINUE

141

CALL INPUT(IEND)

142

C CYCLE UNTIL NEW SEASON.

143

IF (IEND.EQ.1) GO TO 140

144

KOBSsKOBS+1

145

CALL VARX(1,Y)

146

NEWM=(Y(1)-BASETM)*PERYR+M8ASE

147

IF (NEWM.NE.M) GO TO 140

148

K=K+1

149

C LIMIT TO 400 OBSERVATION, MISSING OR NOT,

IN ONE SEASON.

150

IF (K.LE.400) GO TO 110

Page 100: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

en

1 51

1 52

1 53

154

155

1 56

1 57

158

1 59

160

1 61

162

163

164

165

166

167

163

169

170

171

172

1 73

1 74

1 75

176

177

178

1 79

180

181

182

183

184

185

186

187

1 88

189

190

191

192

193

194

195

196

197

198

199

200

WRITE

( IPRINT,9005) K08S

9005 FORMAT

(' AT

OBSERVATION NUMBER

1, 110,

& ' THERE WERE MORE THAN 400 OBSERVATIONS

STOP

GET MEDIANS

140 CONTINUE

DO 150

1 = 1, NV

ANY NON-MISSING 09S E RVAT I

ONS ?

IF (L(I).EQ.O) GO TO

1 50

YES.

NVALS(I)=NVALS(I)+1

IN THAT SEASON.

1)

150

EVEN=2*IH.EQ.L(I)

FIND MEDIAN.

CALL VSRTA(SORT(1,I),L(I))

IF (.NOT.EVEN) X(M,I)= SORT(IH,I)

IF (EVEN)

X(M,I) = (SORT( IH,I )+ SORT(IH+1,I))/2.0

CONTINUE

LAST=M

CONTINUE PROCESSING IF

END-OF-FILE

(IEND.NE.1) GO TO 70

NOT ENCOUNTERED.

IF40 IF

(M.GT.1) GO TO 50

WRITE

( IPRINT,9003)

9003 FORMAT C THERE ARE FEWER THAN

2 SEASONS.

1)

STOP

50 CONTINUE

IF (SECOND) GO TO 160

WRITE

( IPRINT,9004)

9004 FORMAT C THERE ARE NO OBSERVATIONS AFTER TJHE CUTOFF DATE.

1)

STOP

160 CONTINUE

NDATES(4)=Y(1)+0.25

NX2=LAST-NX1

DO 170 1=1,NV

N08S2U )=NOBS( I)

NVALS2(I)=NVALS(I)

170 CONTINUE

I SET UNUSED CELLS TO MISSING.

DO 210 M=1,LAST

IF (HAVE(M)) GO TO 210

DO 200 1=1,NV

X(M,I)=XMISS

200 CONTINUE

210 CONTINUE

RETURN

END

! PERFORM RANK SUM TEST.

SUBROUTINE SEASRS (J)

COMMON /DATA/ X(1200,15),NX1,NX2,ALPHA(15),DF(15),CUTOFF,

& NOdS1(15),N08S2(15),NVALS1(15),NVALS2(15),NDATES(4)

Page 101: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

201

REAL*8 CUTOFF

202

DIMENSION Y<1200)/R<1200)

203

REAL*8 PARM

204

REAL XCHEK/-1.OE30/

205

IF (NVALS1(J).EQ.0.OR.NVALS2<J).EQ.O) GO TO 700

206

NPER=PARM<16)

207

WS=O.U

208

EW=U.O

209

VW=U.O

210

LAST=NX1+NX2

211

C BYPASS DETECTION LIMIT PROCESSING

IF NONE SPECIFIED.

212

IF (PARMU).EQ.0.000) GO TO 20

213

ULIMIT=PARM(J)

214

DO 1J 1=1,LAST

215

IF

( X(I^J).LE.DLIMIT.AND.X<I,J) .GT.0.0) X(I

,J)=0.5*DL IM

I T

216

10 CONTINUE

217

20 CONTINUE

218

C LOOP THROUGH THE SEASONS.

219

DO 500 IM=1,NPER

220

C LOOP THROUGH YEARS FOR VALUES IN

SEASON IM.

221

C FIRST PERIOD.

222

NI

= 0

223

DO 60 I=IM/NX1/NPER

224

XX=X(I,J)

225

IF(XX.LT.XCHEK) GO TO 60

226

NI

a NI

+

1227

Y(NI)

= XX

228

60 CONTINUE

229

C SKIP SEASONS IF NO VALUES.

230

IF(NI.EQ.O) GO TO 500

231

C SECOND PERIOD.

232

MI

* 0

233

DO 70 I=IM,NX2,NPER

234

XX=X(I+NX1,J)

235

IF(XX.LT.XCHEK) GO TO 70

236

MI

= MI

+ 1

237

Y(MH-NI)

= XX

238

70 CONTINUE

239

C SKIP SEASON IF

NO VALUES.

240

IF (MI.EQ.O) GO TO 500

241

NN

= Ml

+ NI

242

CALL RANKCY/R/NN)

243

RSUM *

0.0

244

DO 130

I =

1/ NI

245

RSUM

= RSUM

+ R(I)

246

130 CONTINUE

247

RSSQ=0.0

248

DO 14Q 1=1,NN

249

RSSQ=RSSQ+R(I)**2

250

140 CONTINUE

Page 102: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

251

C ACCUMULATE STATISTICS.

252

WS=WS+RSUM

253

EW=EvJ + NI*(NN+1 )/2.0

254

VW=VU+MI*N1*(RSSU/NN-<NN+1)**2/4.0>/(NN-1>

255

500 CONTINUE

256

C CLACULATE FINAL STATISTICS.

257

IF(VW.LE.O.O) GO TO 700

258

Z=<-<WS-EW)/SQRT(VW))

259

IF (Z.LE.0.0) ALPHA(J>=2.0*CDFN(Z>

260

IF (Z.GT.0.0) ALPHA(J)=2.0*(1,0-COFN(Z))

261

C GET ESTIMATE OF JUMP.

262

CALL SEARSD(X(1,J>,NX1,X(NX 1+1,J),NX2,NPER,OF(J>)

263

RETURN

264

700 CONTINUE

265

ALPHA(J)=1.0

266

OF(J)=0.0

267

RETURN

268

END

269

C CALCULATE AN ESTIMATE OF THE STEP TREND.

270

SUBROUTINE SEARSO(X1,NX1

,X2,NX2*NPER,0)

271

COMMON /IOUNIT/ IPRINT

272

REAL X1(NX1)

,X2(NX2)

273

REAL Y(12000)

274

REAL XCHEK/-1.OE30/

275

LOGICAL EVEN

276

NY1*( (NX1-1 >/NPER>+1

277

NY2 = «NX2-1 >/NPER> + 1

276

NMAX=NY1*NY2*12

279

IF (NMAX.LE.12000) GO TO 10

280

dRITE

( IPRINT,9001) NX1,NX2

281

9001 FORMAT

(' THE

Y ARRAY

IN SEARSO

IS TOO SMALL.

1/

282

& 'NX1=',I6/'NX2=',16)

283

STOP

284

10 CONTINUE

285

C CALCULATE THE DIFFERENCE BETWEEN EACH PAIR OF VALUES -

ONE IN

286

C THE FIRST SERIES/ THE OTHER OF THE SECOND, AND BOTH OF THE

287

C SAME SEASON.

288

K=0

239

DO 40 IM=1,NPER

290

DO 30 I=IM,NX1,NPER

291

XF=X1(I)

292

IF (XF.LT.XCHEK) GO TO 30

293

DO 20 J=IM,NX2,NPER

294

XL=X2(J)

295

IF (XL.LT.XCHEK) GO TO 20

296

K»K+1

297

Y(K)=XL-XF

298

20 CONTINUE

299

30 CONTINUE

300

40 CONTINUE

Page 103: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

301

C GET MEDIAN.

302

CALL VSRTA(Y/K)

303

IH=« + 1)/2

304

EVEN=2*IH.EQ.K

305

IF (EVEN)

D=(Y(IH)+Y(IH+1))/2.0

306

IF (.NOT.EVEN) 0=Y(IH)

307

RETURN

308

END

309

C REPORT RESULTS.

310

SUBROUTINE OUTPUT (NV)

311

COMMON /DATA/ X(1200,15)/NX1/NX2/ALPHA(15)/DF(15)/CUTOFF/

312

& N03S1 (15)/N08S2(15)/NVALS1 (

1 5 )/NVA LS2 (

1 5 )/ NDATES (4

)313

REAL'S CUTOFF

314

COMMON /LABINF/ NAME(15)/LABEL(5/15>

315

REAL*8 NAME/LABEL

316

COMMON /IOUNIT/ IPRINT

317

C STANDARD SAS TITLE.

318

CALL STITLE (0/LINES)

319

WRITE (IPRINT,6001)

320

6001 FORMAT (/39X/ MANN-WHITNEY-WILCOXAN RANK SUM TEST FOR SEASONAL'/

321

& '

DATA'///)

322

WRITE (IPRINT/6002) NDATES

323

6002 FORMAT (53X/'

FIRST SERIES

'/16X/' SECOND SERIES

'/324

& 52X/'

('/I4/'-'/I4/» )

'/16X/'

('/14/ '

- '

/14/ ) '

/325

& '

VARIABLE'/

326

& 43X/'

NOBS

NVALS

'/'

CUTOFF DATE

'/327

& '

NOBS

NVALS'/

^

328

& 5X/'P LEVEL'/5X/'STEP'/1X/123('-')/)

00

329

DO 10 I=1/NV

330

WRITE (IPRINT/6003) NAME(I)/(LABEL(J/I)/J=1/5)/NOBS1(I)/NVALS1(I)/

331

& CUTOFF/NOBS2(I)/NVALS2(I)/ALPHA(I)/OF(I)

332

6003 FORMAT (1X/A8/3X/5A8/16/18/F13.2/ 11O/I8/F12.3/G15.4/)

333

10 CONTINUE

334

WRITE (IPRINT/6004)

335

6004 FORMAT (//' NOBS IS THE NUMBER OF NON-MISSING OBSERVATIONS

'/336

& 'IN THE ORIGINAL DATA.'/

337

& '

NVALS IS

THE NUMBER OF NON-MISSING SEASONAL VALUES'/

338

& ' CONSTRUCTED.

1)

339

RETURN

340

HNO

341

C CUMULATIVE DISTRIBUTION FUNCTION FOR THE NORMAL DISTRIBUTION.

342

C PRIMARY REFERENCE IS ABRAMOWITZ AND STEGUN,

343

C N8S HANDBOOK OF MATHEMATICAL FUNCTIONS/ EQ. 26.2.19.

344

FUNCTION CDFN(X)

345

IF

(X) 10/20/30

346

10 CONTINUE

347

IF (X.LT.-6.0) GO TO 40

348

T=-X

349

CDFN=d.5/(1.0+0.0498673470*T+0.0211410061*T**2+0.0032776263*T**3

350

& +0.380036E-4*T**4+0.488906E-4*T**5+0.53830E-5*T**6)**16

Page 104: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

351

RETURN

352

20 CONTINUE

353

CDFN=U.50U

354

RETURN

355

30 CONTINUE

356

IF (X.GT.6.0) GO TO 50

357

CDFN=1.0-0.5/(1.0+0.0498673470*X+0.0211410061*X**2+0.0032776263*X

358

& **3+0.380036E-4*X**4+0.488906E-4*X**5+0.53830E-5*X**6> **16

359

RETURN

360

40 CONTINUE

361

COFN=0.000

362

RETURN

363

50 CONTINUE

364

CDFN=1.000

365

RETURN

366

END

367

C CO

NVER

T A

SAS

MISS

ING

VALUE

TO ON

E RECOGNIZED BY

THESE

ROUT

INES

.368

FUNC

TION

FIXMIS(X)

369

REAL

*8 X,

VALU

E37

0 EQUIVALENCE(VALUE^MISSX)

371

VALUE'X

372

IF (VALUE.EQ.O.ODO.AND.MISSX.NE.O) VALUE=-1.0D31

373

FIXMIS*VALUE

374

RETURN

375

END

376

SUBROUTINE RANK(XsRsN)

377

C COMPUTES THE RANKS OF

THE VALUES IN

VECTOR

XVD

378

C X

IS NOT RE-ARRANGED ON RETURN

4X3

379

C IN

CASES OF TIES/ MID-RANKS ARE USED

380

C MISSING VALUES ARE NOT ALLOWED

381

REAL X(N>, R(N>, Y(1200)

382

INTEGER ORDC1200)

383

C INITIALIZE ORD AND

Y384

00 10

I

= 1, N

385

ORD(I)

- I

386

Y(I)

= X(I)

387

10 CONTINUE

388

C REARRANGE

Y IN

ASCENDING ORDER

389

CALL VSRTR(Y,N,ORD>

390

C INITIAL RANKING

391

DO 1UO

I =

1*N

392

R(ORO(1»

* I

393

100 CONTINUE

394

C ADJUST RANKS FOR TIES

395

1=1

396

C VALUE ALWAYS TIED WITH ITSELF

397

IEND =

I398

150 IEND

= IEND +

1399

IF (IEND.LE.N.AND.Y(IEND).EQ.Y( I)) GO TO 150

400

C COMPUTE AVERAGE RANK

Page 105: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

401

AVE

= <IEND*<IEND-1)-I*(I-1)>/<2.0*<IEND-I))

402

IENDM1

= IEND -

1403

DO 190

J =

It IENDM1

404

R<ORD(J»

= AVE

405

190 CONTINUE

406

I =

IEND

407

IF(I.LT.N) 60 TO 150

40°

RETURN

4 0 v

END

410

//LKED.SYSIN DD

*411

ENTRY ENTRY

THIS STATEMENT MUST BE PRESENT

412

SETSSI ADOJOOOO

413

NAME SEASRS2(R)

414

/*

415

//

O

O

Page 106: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

REFERENCES

Belsley, D. A., Kuh, Edwin, and Welsch, R. E., 1980, Regression diagnostics:

New York, John Wiley and Sons, 292 p.

Bradley, 0. V., 1968, Distribution-free statistical tests: Englewood Cliffs,

N. J., Prentice-Hall, 388 p.

Briggs, J. C., 1978, Nationwide surface water quality monitoring networks of

the U.S. Geological Survey, in Establishment of Water-Quality Monitoring

Programs, San Francisco, June 1978, Proceedings: Minneapolis, American

Water Resources Association, p. 49-57.

Chatterjee, Samprit, and Price, Bertram, 1977, Regression analysis by example

New York, John Wiley and Sons, 462 p.

Conover, W. J., 1971, Practical nonparametric statistics: New York, John

Wiley and Sons, 462 p.

Cook, R. D., 1977, Detection of influential observations in linear regression

Technometrics, v. 19, p. 15-18.

Daniel, Cuthbert, and Wood, F. S., 1980, Fitting equations to data, (2nd ed.)

New York, John Wiley and Sons, 458 p.

Draper, N. R., and Smith, Harry, 1981, Applied Regression Analysis (2nd ed.)

New York, John Wiley and Sons, 709 p.

Fuller, F. C., Jr., and Tsokos, C. P., 1971, Time series analysis of water

pollution data: Biometrics, v. 27, p. 1017-1034.

Hirsch, R. M., Slack, J. R., and Smith, R. A., 1982, Techniques of trend

analysis for monthly water quality data: Water Resources Research,

v. 18, no. 1, p. 107-121.

Hollander, Myles, and Wolfe, D. A., 1973, Nonparametric statistical methods:

New York, John Wiley and Sons, 503 p.

101

Page 107: NONPARAMETRIC TESTS FOR TRENDS IN WATER … · Mann-Whitney-Wilcoxon rank sum test and slope estimator pro cedure on a water-quality data time series ... By Charles G. Crawford, James

Kendall, Maurice, 1975, Rank correlation methods: London, Charles Griffin

and Co., Ltd., 202 p.

Lettenmaier, D. P., 1976, Detection of trends in water quality data from records

with dependent observations: Water Resources Research, v. 12, no. 5,

p. 1037-1046.

SAS Institute, Inc., 1979, SAS users guide, 1979 edition: Cary, N. C.,

SAS Institute, Inc., 494 p.

SAS Institute, Inc., 1981a, SAS Programmer's guide, 1981 edition, Cary, North

Carolina, SAS Institute, Inc. 184 p.

SAS Institute, Inc., 1981b, SAS/GRAPH users guide, 1981 edition: Cary, North

Carolina, SAS Institute, Inc., 126 p.

SAS Institute, Inc., 1982a, SAS users guide - basics, 1982 edition: Cary,

North Carolina, SAS Institute, Inc., 924 p.

SAS Institute, Inc, 1982b, SAS users guide - statistics, 1982 edition: Cary,

North Carolina, SAS Institute, Inc., 584 p.

Smith, R. A., Hirsch, R. M., and Slack, J. R., 1982, A study of trends in total

phosphorus measurements at NASQAN stations: U.S. Geological Survey Water-

Supply Paper 2190, 34 p.

U.S. Geological Survey - WATSTORE User's Guide

U.S. Geological Survey Computer User's Manual

102

irU.S. GOVERNMENT PRINTING OFFICE : 1983-421-614/588

View publication statsView publication stats