Learn R Programming

asbio (version 0.3-1)

boot.ci.M: Bootstrap CI of M-estimators differences of two samples

Description

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 similar to a function written by Wilcox (2005) but does not compute two-tailed p-values as these are often in conflict with the calculated confidence intervals. The default method for bootstrap confidence intervals is the percentile method which is recommended by Wilcox (2005) for M-estimators.

Usage

boot.ci.M(X1, X2, alpha = 0.05, est = huber.one.step, R = 1000, type = "perc")

Arguments

X1
Sample from population one.
X2
Sample from population two.
alpha
Significance level.
est
Location estimator; default is the Huber one step estimator.
R
Number of bootstrap samples.
type
Method for computing bootstrap confidence intervals. Other alternatives are given in boot.ci from the library boot.

Value

  • Returns a list with one component, a dataframe containing summary information from the analysis:
  • R.usedThe number of bootstrap samples used. This may not = R if NAs occur because MAD = 0.
  • ci.typeThe method used to construct the confidence interval.
  • confThe level of confidence used.
  • seThe bootstrap distribution of differences standard error.
  • originalThe original, observed difference.
  • lowerLower confidence bound.
  • upperUpper confidence bound.

References

Manly, B. F. J. (1997) Randomization and Monte Carlo methods in biology, 2nd edition. Chapman and Hall, London.

See Also

bootstrap, boot

Examples

Run this code
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