| Title: | Robustified t-Test |
|---|---|
| Description: | Performs one-sample t-test based on robustified statistics using median/MAD (TA) and Hodges-Lehmann/Shamos (TB). For more details, see Park, Wang and Hwang (2022) <doi:10.7232/iems.2022.21.3.432>. This work was partially supported by the National Research Foundation of Korea (NRF) grant funded by the Korea government (No. 2022R1A2C1091319). |
| Authors: | Chanseok Park [aut, cre]
|
| Maintainer: | Chanseok Park <[email protected]> |
| License: | GPL-2 | GPL-3 |
| Version: | 1.26.9 |
| Built: | 2026-09-18 06:10:50 UTC |
| Source: | https://github.com/appliedstat/r |
Calculates the Hodges-Lehmann estimate.
HL.estimate(x, na.rm = FALSE, IncludeEqual = FALSE)HL.estimate(x, na.rm = FALSE, IncludeEqual = FALSE)
x |
a numeric vector of observations. |
na.rm |
a logical value indicating whether NA values should be stripped before the computation proceeds. |
IncludeEqual |
FALSE (default) calculates median of ([x[i]+x[j])/2) with i<j. TRUE calculates median of ([x[i]+x[j])/2) with i<=j. |
Chanseok Park
Hodges, J. L. and E. L. Lehmann (1963). Estimates of location based on rank tests. Annals of Mathematical Statistics, 34, 598–611.
mean for calculating sample mean and
median for calculating sample median.
x = c(0:10, 50) HL.estimate(x)x = c(0:10, 50) HL.estimate(x)
Calculates the quantiles of the robustified t-test statistic (TA or TB).
q.robustified.t(p, n, test.stat=c("TA", "TB"), lower.tail=TRUE)q.robustified.t(p, n, test.stat=c("TA", "TB"), lower.tail=TRUE)
p |
vector of probabilities. |
n |
the sample size |
test.stat |
a character string specifying the test statistic. |
lower.tail |
logical; if TRUE (default), probabilities are p=P[X <= x], otherwise, p=P[X > x]. |
Using the empirical distributions of TA and TB statistics, it calculates the quantile.
Chanseok Park
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.
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.
doi:10.7232/iems.2020.19.2.386
qt for obtaining quantile value of Student t-distribution.
# quantile value of TA (using median and MAD) statistic q.robustified.t(p=0.01, n=10, test.stat="TA") # quantile value of TB (using Hodges-Lehmann and Shamos) statistic q.robustified.t(p=0.01, n=10, test.stat="TB")# quantile value of TA (using median and MAD) statistic q.robustified.t(p=0.01, n=10, test.stat="TA") # quantile value of TB (using Hodges-Lehmann and Shamos) statistic q.robustified.t(p=0.01, n=10, test.stat="TB")
Quantiles of the robustified statistic, TA. They are obtained using the extensive Monte Carlo simulation with 1E08 replicates.
Quantiles.TAQuantiles.TA
This data frame contains 97 rows and 500 columns.
Chanseok Park
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.
doi:10.7232/iems.2022.21.3.432
Quantiles of the robustified statistic, TB. They are obtained using the extensive Monte Carlo simulation with 1E08 replicates.
Quantiles.TBQuantiles.TB
This data frame contains 97 rows and 500 columns.
Chanseok Park
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.
doi:10.7232/iems.2022.21.3.432
Performs robustified one-sample t-test on a vector of data.
rt.test(x, alternative = c("two.sided", "less", "greater"), mu = 0, test.stat = c("TA", "TB"), conf.level = 0.95)rt.test(x, alternative = c("two.sided", "less", "greater"), mu = 0, test.stat = c("TA", "TB"), conf.level = 0.95)
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. |
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.
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. |
Chanseok Park
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.
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.
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.
doi:10.48550/arXiv.1805.12256
t.test for performing the Student t-test. prop.test for testing the proportion.
# 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)# 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)