boottestonemed: Bootstrap Test One Median

Description Usage Arguments Value References Examples

Description

On page 311 of HMC (2019), a bootstrap test for a one sample location problem based on the sample mean is presented. For the function, boottestonemed, the sample median is used for the test statistic. The hypotheses tested, are:H 0 : θ = θ 0 versus H a : θ > θ 0 where θ 0 is spectified, (an input value of the function). The bootstrapped p-value is returned.

Usage

1
boottestonemed(sample, theta0, b)

Arguments

sample

a vector, is the sample

theta0

a number, the null value of the mean

b

an integer, the number of bootstrap resamples

Value

a list with origtest, pvalue, and teststatall

originaltest is the median of the sample

pvalue is the bootstrap p-value

teststatall contains the bootstrap test median

References

Hogg, R. McKean, J. Craig, A. (2018) Introduction to Mathematical Statistics, 8th Ed. Boston: Pearson.

Examples

1
2
3
4
sample <- c(4, 3, 2, 9)
theta0 <- .05
b <- 5
boottestonemed(sample, theta0, b)

austinragotzy/mathstat documentation built on May 13, 2019, 11:30 a.m.