| Title: | Trimmed-k Mean Estimator |
|---|---|
| Description: | Computes the trimmed-k mean by removing the k smallest and k largest values from a numeric vector. Created for STAT 5400 at the University of Iowa. |
| Authors: | Shouhardyo Sarkar [aut, cre] |
| Maintainer: | Shouhardyo Sarkar <[email protected]> |
| License: | GPL-3 |
| Version: | 1.0.0 |
| Built: | 2026-05-12 07:35:48 UTC |
| Source: | https://github.com/cran/Ssarkartrim |
This function calculates the trimmed-k mean of a numeric vector by removing the k smallest and k largest values.
kTrimMean(dat, k)kTrimMean(dat, k)
dat |
A numeric vector of data. |
k |
An integer indicating how many smallest and largest values to trim. |
The trimmed-k mean of the data. Returns NA if not enough data points.
set.seed(5400) dat <- rexp(20, rate = 0.5) kTrimMean(dat, k = 2)set.seed(5400) dat <- rexp(20, rate = 0.5) kTrimMean(dat, k = 2)