yuen: Independent samples t-tests on robust location measures...

Description Usage Arguments Details Value References See Also Examples

View source: R/yuen.R

Description

The function yuen performs Yuen's test for trimmed means, yuenbt is a bootstrap version of it. akp.effect and yuen.effect.ci can be used for effect size computation. The pb2gen function performs a t-test based on various robust estimators, medpb2 compares two independent groups using medians, and qcomhd compares arbitrary quantiles.

Usage

1
2
3
4
5
6
7
8
yuen(formula, data, tr = 0.2, ...)
yuenbt(formula, data, tr = 0.2, nboot = 599, side = TRUE, ...)
akp.effect(formula, data, EQVAR = TRUE, tr = 0.2, nboot = 200, alpha = 0.05, ...)
yuen.effect.ci(formula, data, tr = 0.2, nboot = 400, alpha = 0.05, ...)
pb2gen(formula, data, est = "mom", nboot = 599, ...)
medpb2(formula, data, nboot = 2000, ...)
qcomhd(formula, data, q = c(0.1, 0.25, 0.5, 0.75, 0.9),
       nboot = 2000, alpha = 0.05, ADJ.CI = TRUE, ...)

Arguments

formula

an object of class formula.

data

an optional data frame for the input data.

tr

trim level for the mean.

nboot

number of bootstrap samples.

side

side = TRUE indicates two-sided method using absolute value of the test statistics within the bootstrap; otherwise the equal-tailed method is used.

est

estimate to be used for the group comparisons: either "onestep" for one-step M-estimator of location using Huber's Psi, "mom" for the modified one-step (MOM) estimator of location based on Huber's Psi, or "median", "mean".

q

quantiles to be used for comparison.

alpha

alpha level.

ADJ.CI

whether CIs should be adjusted.

EQVAR

whether variances are assumed to be equal across groups.

...

currently ignored.

Details

If yuenbt is used, p-value computed only when side = TRUE. medpb2 is just a wrapper function for pb2gen with the median as M-estimator. It is the only known method to work well in simulations when tied values are likely to occur.qcomhd returns p-values and critical p-values based on Hochberg's method.

Value

Returns objects of classes "yuen" or "pb2" containing:

test

value of the test statistic (t-statistic)

p.value

p-value

conf.int

confidence interval

df

degress of freedom

diff

trimmed mean difference

effsize

explanatory measure of effect size

call

function call

qcomhd returns an object of class "robtab" containing:

partable

parameter table

References

Algina, J., Keselman, H.J., & Penfield, R.D. (2005). An alternative to Cohen's standardized mean difference effect size: A robust parameter and confidence interval in the two independent groups case. Psychological Methods, 10, 317-328.

Wilcox, R. (2012). Introduction to Robust Estimation and Hypothesis Testing (3rd ed.). Elsevier.

Wilcox, R., & Tian, T. (2011). Measuring effect size: A robust heteroscedastic approach for two or more groups. Journal of Applied Statistics, 38, 1359-1368.

Yuen, K. K. (1974). The two sample trimmed t for unequal population variances. Biometrika, 61, 165-170.

See Also

t1way,t1waybt

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
set.seed(123)
## Yuen's test
yuen(Anxiety ~ Group, data = spider)

## Bootstrap version of Yuen's test (symmetric CIs)
yuenbt(Anxiety ~ Group, data = spider)

## Robust Cohen's delta
akp.effect(Anxiety ~ Group, data = spider)

## Using an M-estimator
pb2gen(Anxiety ~ Group, data = spider, est = "mom")
pb2gen(Anxiety ~ Group, data = spider, est = "mean")
pb2gen(Anxiety ~ Group, data = spider, est = "median")

## Using the median
medpb2(Anxiety ~ Group, data = spider)

## Quantiles
set.seed(123)
qcomhd(Anxiety ~ Group, data = spider, q = c(0.8, 0.85, 0.9), nboot = 500)

Example output

Call:
yuen(formula = Anxiety ~ Group, data = spider)

Test statistic: 1.2958 (df = 13.91), p-value = 0.21614

Trimmed mean difference:  -6.75 
95 percent confidence interval:
-17.9294     4.4294 

Call:
yuenbt(formula = Anxiety ~ Group, data = spider)

Test statistic: -1.1936 (df = NA), p-value = 0.23706

Trimmed mean difference:  -6.75 
95 percent confidence interval:
-18.8452     5.3452 

[1] -0.5213571
Call:
pb2gen(formula = Anxiety ~ Group, data = spider, est = "mom")

Test statistic: -7, p-value = 0.20367
95% confidence interval:
-17.9167    4.0476 

Call:
pb2gen(formula = Anxiety ~ Group, data = spider, est = "mean")

Test statistic: -7, p-value = 0.07179
95% confidence interval:
-14.5833    0.5833 

Call:
pb2gen(formula = Anxiety ~ Group, data = spider, est = "median")

Test statistic: -10, p-value = 0.30718
95% confidence interval:
-20    5.5 

Call:
medpb2(formula = Anxiety ~ Group, data = spider)

Test statistic: -10, p-value = 0.3365
95% confidence interval:
-17.5    7.5 

Call:
qcomhd(formula = Anxiety ~ Group, data = spider, q = c(0.8, 0.85, 
    0.9), nboot = 500)

Parameter table: 
     q n1 n2    est1    est2 est1-est.2   ci.low   ci.up p.crit p.value
1 0.80 12 12 48.9839 57.1887    -8.2048 -17.9930  1.5542 0.0250   0.060
2 0.85 12 12 50.5786 59.3112    -8.7326 -17.3006 -0.1963 0.0500   0.040
3 0.90 12 12 52.2870 61.6133    -9.3263 -18.4765  1.4122 0.0167   0.036

WRS2 documentation built on July 20, 2021, 9:06 a.m.

Related to yuen in WRS2...