statsmodels.stats.robust_compare.TrimmedMean

class statsmodels.stats.robust_compare.TrimmedMean(data, fraction, is_sorted=False, axis=0)[source]

class for trimmed and winsorized one sample statistics

axis is None, i.e. ravelling, is not supported

Parameters:
dataarray_like

The data, observations to analyze.

fractionfloat in (0, 0.5)

The fraction of observations to trim at each tail. The number of observations trimmed at each tail is int(fraction * nobs)

is_sortedbool

Indicator if data is already sorted. By default the data is sorted along axis.

axisint

The axis of reduce operations. By default axis=0, that is observations are along the zero dimension, i.e. rows if 2-dim.

Attributes:
data_trimmed

numpy array of trimmed and sorted data

data_winsorized

winsorized data

mean_trimmed

mean of trimmed data

mean_winsorized

mean of winsorized data

std_mean_trimmed

standard error of trimmed mean

std_mean_winsorized

standard error of winsorized mean

var_winsorized

variance of winsorized data

Methods

reset_fraction(frac)

create a TrimmedMean instance with a new trimming fraction

ttest_mean([value, transform, alternative])

One sample t-test for trimmed or Winsorized mean

Properties

data_trimmed

numpy array of trimmed and sorted data

data_winsorized

winsorized data

mean_trimmed

mean of trimmed data

mean_winsorized

mean of winsorized data

std_mean_trimmed

standard error of trimmed mean

std_mean_winsorized

standard error of winsorized mean

var_winsorized

variance of winsorized data


Last update: Oct 29, 2024