The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.

Type: Package
Title: Robust Linear Regressions
Version: 1.2.0
Author: Santiago I. Hurtado <santih@carina.fcaglp.unlp.edu.ar>
Maintainer: Santiago I. Hurtado <santih@carina.fcaglp.unlp.edu.ar>
Description: Provides an easy way to compute the Theil Sehn Regression method and also the Siegel Regression Method which are both robust methods base on the median of slopes between all pairs of data. In contrast with the least squared linear regression, these methods are not sensitive to outliers. Theil, H. (1992) <doi:10.1007/978-94-011-2546-8_20>, Sen, P. K. (1968) <doi:10.1080/01621459.1968.10480934>.
License: GPL-3
Depends: R (≥ 3.1.0)
ByteCompile: yes
Encoding: UTF-8
LazyData: true
NeedsCompilation: no
Packaged: 2020-06-08 13:06:11 UTC; santiago
Repository: CRAN
Date/Publication: 2020-06-12 10:20:05 UTC

Theil Sen Regression

Description

Compute Theil Sen Regression and Repeated Medians Regression (Siegel)

Usage

  theil_sen_regression(formula, data = NULL)

  siegel_regression(formula, data = NULL)

Arguments

formula

object of type formula, must be linear

data

optional data frame with the data used in formula in columns

Details

theil_sen_regression compute linear regression using the Theil–Sen estimator base on the median of the slopes. siegel_regression compute linear regression using the repeated median estimator for the slope, propose by Siegel (1982). The main difference is that siegel_regression is less sensitive to outliers in the data.

Value

Returns an object of type "lm"

References

- Theil, H., 1992. A rank-invariant method of linear and polynomial regression analysis. In: Henri Theil’s contributions to economics and econometrics. Springer, pp. 345–381. URL https://doi.org/10.1007/978-94-011-2546-8_20

- Sen, P. K., 1968. Estimates of the regression coefficient based on kendall’s tau. Journal of the American statistical association 63 (324), 1379–1389.

Examples

  # create x axis (t)
  t <- 1:100
  # create values that follow a linear relation with the x axis
  x <- rnorm(100,35,4)*t/100
  # add some outliers
  x[c(10,12,76,34,21)] <- x[c(10,12,76,34,21)] + 40
  model <- theil_sen_regression(x~t)
  lm_model <- lm(x~t)
  # compare linear regression with theil_sen_regression
  plot(x~t)
  abline(model,col='blue')
  abline(lm_model,col='red')

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.