2

I am confused with different robust methods to compare independent means. I found good explanation in statistical textbooks. For example yuen() in case of equal sample sizes. My samples are rather unequal, thus I would like to try a bootstrap-t method (from Wilcox book: Introduction to Robust Estimation and Hypothesis Testing, p.163). It says yuenbt() would be a possible solution.

But all textbooks say I can use vectors here:

yuenbt(x,y,tr=0.2,alpha=0.05,nboot=599,side=F)

If I check the local description it says:

yuenbt(formula, data, tr = 0.2, nboot = 599)

What's wrong with my trial:

x <- c(1,2,3)
y <- c(5,6,12,30,2,2,3,65)
yuenbt(x,y)

Why can't I use yuenbt-function with my two vectors? Thank you very much

StupidWolf
  • 45,075
  • 17
  • 40
  • 72
Mac
  • 183
  • 1
  • 13

1 Answers1

2

Looking at the help (for those wondering, yuenbt is from the package WRS2...) for yuenbt, it takes a formula and a dataframe as arguments. My impression is that it expects data in long format.

With your example data, we can achieve that like so:

library(WRS2)

x <- c(1,2,3)
y <- c(5,6,12,30,2,2,3,65)

dat <- data.frame(value=c(x,y),group=rep(c("x","y"), c(length(x),length(y))))

We can then use the function:

yuenbt(value~group, data=dat)
Heroka
  • 12,889
  • 1
  • 28
  • 38
  • Might there have been a change from the package WRS? I don't have profound knowledge about packages documentation. But those textbooks work with vectors ... – Mac Feb 28 '16 at 16:22
  • I have no idea, I'm not familiar with the package but just downloaded it to see and try to answer your question. Textbooks with code can become outdated. – Heroka Feb 28 '16 at 16:23
  • Thank you very much for your coding :) Now I can work on my interpretation of my bootstraping – Mac Feb 28 '16 at 16:31