Ghement Statistical Consulting Company Ltd. 2014 Web: [email protected]

This preview shows page 1 - 2 out of 5 pages.

Ghement Statistical Consulting Company Ltd. © 2014Web: [email protected]E-mail: [email protected]Phone: 604-767-1250Performing the Mann-Kendall Test for Trend in RTo perform the Mann-Kendal test for trend in R, you can use the Kendallpackage developed by A.I.McLeod. This package can be installed in R with the command:install.packages("Kendall")Once the package is installed in R, you can attach it to each of your R sessions using the command:require(Kendall) The Kendall package has a function named MannKendall() which implements the non-parametric testfor monotonic trend detection known as the Mann-Kendall test. (A monotonic trend can be either anupward trend or a downward trend.)To illustrate the use of the MannKendall()function in R, we will use one of the data sets that comes withthis package: PrecipGL. First, let us attach this data set to the current R session, view it and also read itshelp file:data(PrecipGL)?PrecipGLView(PrecipGL)We can see from the help file that this data set contains information on the annual precipitation levels for the entire Great Lakes for the time period 1900-1986.How does R store the PrecipGL data set? We can use the str()command to find this out:str(PrecipGL)The output produced by str()indicates that R views this data set as a time series object:> str(PrecipGL)Time-Series [1:87] from 1900 to 1986: 31.7 29.8 31.7 33.1 31.3 ...- attr(*, "title")= chr "Annual precipitation, 1900-1986, Entire Great Lakes"Before implementing the Mann-Kendall test for trend to the PrecipGL time series, we should visualize this series using the R command below:plot(PrecipGL)

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture