Learn R Programming

RSizeBiased (version 0.1.0)

T1T2.Mean.Var: Test statistic \(T_{n,r}^1\) or \(T_{n,r}^2\) depending on user input.

Description

The test statistics \(T_{n,r}^1\) and \(T_{n,r}^2\) are consistent estimators of the mean value \(\mathrm{E}(X)\) and variance \(\mathrm{Var}(X)\) respectively given an \(r-\)size biased sample.

Usage

T1T2.Mean.Var(datain,r, type)

Arguments

datain

The available sample points.

r

The size (order) of the distribution. The special cases \(r=1,2,3\) correspond to length, area, volume biased samples respectively and are the most frequently encountered in practice. The case \(r=0\) corresponds to random samples from the underlying distribution.

type

Numeric switch: type =1 corresponds to the T1 statistic while any other numeric value will cause calculation of T2.

Value

A scalar, the value of the test statistic for the given sample.

Details

The test statistic \(T_{n,r}^1\) is defined by

$$ T_{n,r}^{1}=\frac{\sum_{i=1}^n X_i^{1-r}}{\sum_{i=1}^n X_i^{-r}}.$$

The test statistic \(T_{n,r}^2\) is defined by

$$ T_{n,r}^{2}= \frac{\sum_{i=1}^n X_i^{2-r}}{\sum_{i=1}^nX_i^{-r}}-{\left(\frac{\sum_{i=1}^n X_i^{1-r}}{\sum_{i=1}^n X_i^{-r}}\right)^2}.$$

References

Economou et. al. (2021). Hypothesis testing for the population mean and variance based on r-size biased samples, under review.

Examples

Run this code
# NOT RUN {
#e.g.:
T1T2.Mean.Var(rgamma(100, 2,3),0, 1)
# }

Run the code above in your browser using DataLab