Package 'Ssarkartrim'

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

Help Index


Compute Trimmed-k Mean

Description

This function calculates the trimmed-k mean of a numeric vector by removing the k smallest and k largest values.

Usage

kTrimMean(dat, k)

Arguments

dat

A numeric vector of data.

k

An integer indicating how many smallest and largest values to trim.

Value

The trimmed-k mean of the data. Returns NA if not enough data points.

Examples

set.seed(5400)
dat <- rexp(20, rate = 0.5)
kTrimMean(dat, k = 2)