R/nobs.R

Defines functions nobs.cov_ML nobs.cov_Huber nobs.rq

# --------------------------------------
# Author: Andreas Alfons
#         Erasmus Universiteit Rotterdam
# --------------------------------------

## extract number of observations from median regression
#' @export
#' @import stats
nobs.rq <- function(object, ...) {
  residuals <- residuals(object)
  length(residuals)
}

## extract number of observations from Huber M-estimator of location and scatter
#' @export
#' @import stats
nobs.cov_Huber <- function(object, ...) {
  weights <- weights(object, type="relative")
  length(weights)
}

## extract number of observations from MLE of mean vector and covariance matrix
#' @export
#' @import stats
nobs.cov_ML <- function(object, ...) object$n

Try the robmed package in your browser

Any scripts or data that you put into this service are public.

robmed documentation built on July 9, 2023, 6:29 p.m.