Learn R Programming

rt.test (version 1.26.9)

Robustified-t-test: Robustified t-test

Description

Performs robustified one-sample t-test on a vector of data.

Usage

rt.test(x, alternative = c("two.sided", "less", "greater"), 
  mu = 0, test.stat = c("TA", "TB"), conf.level = 0.95)

Value

A list with class "htest" containing the following components:

statistic

the value of the test statistic.

parameter

sample size (non-missing observations in the sample).

p.value

the p-value for the test.

conf.int

a confidence interval for the mean appropriate to the specified alternative hypothesis.

estimate

the specified hypothesized value of the median (TA) or the Hodges-Lehmann (TB).

sample.size

numeric scalar containing the number of non-missing observations in the sample used for the hypothesis test

null.value

the specified hypothesized value of the true mean.

alternative

a character string describing the alternative hypothesis.

method

a character string indicating which statistic (TA or TB) is used.

data.name

a character string giving the name(s) of the data.

Arguments

x

vector of quantiles.

alternative

a character string specifying the alternative hypothesis, must be one of "two.sided" (default), "greater" or "less". You can specify just the initial letter.

mu

a number indicating the true value of the mean.

test.stat

a character string specifying the test statistic.

conf.level

confidence level of the interval.

Author

Chanseok Park and Min Wang

Details

Based on the empirical distributions of the TA statistic (based on median and MAD) and the TB statistic (based on Hodges-Lehmann and Shamos), this function performs one-sample robustified t-test.

References

Park, C., M. Wang, and W.-Y. Hwang (2022). Empirical distributions of the robustified t-test statistics. Industrial Engineering & Management Systems, 21(3), 432-439.
tools:::Rd_expr_doi("10.7232/iems.2022.21.3.432")

Park, C., M. Wang, and W.-Y. Hwang (2020). A study on robustness of the paired sample tests. Empirical distributions of the robustified t-test statistics. Industrial Engineering & Management Systems, 19(2), 386-397.
tools:::Rd_expr_doi("10.7232/iems.2020.19.2.386")

Park, C. (2018). Note on the robustification of the Student t-test statistic using the median and the median absolute deviation. ArXiv e-prints, 1805.12256.
tools:::Rd_expr_doi("10.48550/arXiv.1805.12256")

See Also

t.test for performing the Student t-test.
prop.test for testing the proportion.

Examples

Run this code
# For robustified t-test (two-sided) using median and MAD (TA).
#    test.stat="TA" (default)
x = rnorm(10) 
rt.test(x)

# For robustified t-test (two-sided) using Hodges-Lehmann and Shamos (TB).
x = rnorm(10)
rt.test(x, test.stat="TB")

# 90% CI (two sides).
x = rnorm(10)
rt.test(x, conf.level=0.9)

# 90% CI (one side).
x = rnorm(10)
rt.test(x, alternative="less", conf.level=0.9)

Run the code above in your browser using DataLab