onesampb: One-sample percentile bootstrap

Description Usage Arguments Value References See Also Examples

View source: R/onesampb.R

Description

Tests whether a robust location measure (median, Huber Psi) differs from a null value and reports a 95% confidence interval based on percentile bootstrap.

Usage

1
onesampb(x, est = "onestep", nboot = 2000, nv = 0, alpha = 0.05, ...)

Arguments

x

a numeric vector.

est

robust estimator to be used ("onestep", "mom", or "median").

nboot

number of bootstrap samples.

nv

value under H0.

alpha

alpha level.

...

currently ignored.

Value

Returns an object of class "onesampb" containing:

ci

95% confidence interval

estimate

robust location sample estimate

p.value

p-value

n

number of effective observations

call

function call

References

Wilcox, R. (2017). Introduction to Robust Estimation and Hypothesis Testing (4th ed.). Elsevier.

See Also

t1way

Examples

1
2
3
4
5
6
7
set.seed(123)
x <- rnorm(30)
onesampb(x, nboot = 100)    ## H0: Psi = 0

set.seed(123)
x <- rlnorm(30)
onesampb(x, est = "median", nv = 1)   ## H0: median = 1

Example output

Call:
onesampb(x = x, nboot = 100)

Robust location estimate: -0.0811 
95% confidence interval: -0.5183 0.3134 
p-value: 0.5 

Call:
onesampb(x = x, est = "median", nv = 1)

Robust location estimate: 0.9386 
95% confidence interval: 0.5723 1.463 
p-value: 0.821 

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

Related to onesampb in WRS2...