Creates a bootstrap confidence interval for location differences for two samples. The default location estimator is the Huber one-step estimator, although any estimator can be used. The function is based on a function written by Wilcox (2005). Note, importantly, that P-values may be in conflict with the confidence interval bounds.
boot.ci.M(X1, X2, alpha = 0.05, est = huber.one.step, R = 1000)
Sample from population one.
Sample from population two.
Significance level.
Location estimator; default is the Huber one step estimator.
Number of bootstrap samples.
Returns a list with one component, a dataframe containing summary information from the analysis:
The number of bootstrap samples used. This may not = R
if NAs
occur because MAD = 0.
The method used to construct the confidence interval.
The level of confidence used.
The bootstrap distribution of differences standard error.
The original, observed difference.
Lower confidence bound.
Upper confidence bound.
Manly, B. F. J. (1997) Randomization and Monte Carlo methods in Biology, 2nd edition. Chapman and Hall, London.
Wilcox, R. R. (2005) Introduction to Robust Estimation and Hypothesis Testing, 2nd edition. Elsevier, Burlington, MA.
# NOT RUN {
X1<-rnorm(100,2,2.5)
X2<-rnorm(100,3,3)
boot.ci.M(X1,X2)
# }
Run the code above in your browser using DataLab