senSlope: Compute the Sen Slope

View source: R/senSlope.R

senSlopeR Documentation

Compute the Sen Slope

Description

Computes the Sen slope with confidence interval and an intercept for paired data.

Usage

senSlope(formula, data, subset, na.action, intercept = "Ac", CI = 0.95)

Arguments

formula

a model formula with exactly one explanatory variable.

data

the data.

subset

any descriptiopn to subset data.

na.action

the function to handle missing values.

intercept

a character string indicating the method to compute the intercept. See Details.

CI

the desired confidence interval for the slope.

Details

The argument intercept may be either "Ac" or "A1m." If it is "Ac," then the intercept is computed from the median of y and x, also known as the Conover method. If it is "A1m," then the intercept is chosen so that the median of the residuals is zero.

Value

An object of class "senSlope" with these components:

call

the matched call.

coefficients

the intercept ans Sen slope.

slope.CI

the lower and upper confidence limits of the Sen slope.

residuals

the residuals of the regression.

fitted.values

the fitted values.

na.action

information about any missing values.

x

the explanatory variable.

y

the response variable.

var.names

the response and explanatory variable names.

model

the model frame.

References

Dietz, E.J., 1989, Teaching regression in a nonparametric statistics course: The American Statstician, v. 43, p. 35–40

Helsel, D.R., and Hirsch, R.M., 2002, Statistical methods in water resources: U.S. Geological Survey Techniques of Water-Resources Investigations, book 4, chap. A3, 522 p.

Sen, P.K., 1968, Estimates of the regression coefficient based on Kendall's tau: Journal of the American Statistical Association, v. 63 p. 1379–1389

See Also

kensen.test, serial.test

Examples

## Not run: 
library(smwrData)
data(SaddlePeaks)
senSlope(Flow ~ Year, data=SaddlePeaks)

## End(Not run)

USGS-R/smwrStats documentation built on Oct. 11, 2022, 6:15 a.m.