Description Usage Arguments Details Value Warning Author(s) Examples
Obtains a confidence interval and (optionally) performs a hypothesis test for one population mean, median, proportion, standard deviation, or user-defined function such as a trimmed mean, using the percentile bootstrap method.
1 2 3 | boot.one.per(x, parameter, null.hyp = NULL,
alternative = c("two.sided", "less", "greater"),
conf.level = 0.95, type = NULL, R = 9999)
|
x |
a (non-empty) numeric vector of data values. |
parameter |
the parameter under consideration. |
null.hyp |
the null-hypothesis value; if omitted, no hypothesis test is performed. |
alternative |
a character string specifying the alternative hypothesis; must be one of "two.sided" (default), "greater", or "less". |
conf.level |
the confidence level (between 0 and 1); default is 0.95. |
type |
a character string specifying the type of CI; if user-supplied, must be one of "two-sided", "upper-bound", or "lower-bound"; defaults to "two-sided" if alternative is "two.sided", "upper-bound" if alternative is "less", and "lower-bound" if alternative is "greater". |
R |
the number of bootstrap replications; default is 9999. |
For a proportion, the data must consist of 1s and 0s, with 1 corresponding to a success.
A list with class "boot.one" containing the following components:
Boot.values |
the point estimates for the parameter obtained from the bootstrap. |
Confidence.limits |
the confidence limit(s) for the confidence interval. |
Header |
the main title for the output. |
Variable |
the name of the variable under consideration. |
n |
the sample size. |
Statistic |
the name of the statistic. |
Observed |
the observed point estimate for the parameter. |
Replications |
the number of bootstrap replications. |
Mean |
the mean of the bootstrap values. |
SE |
the standard deviation of the bootstrap values. |
Bias |
the difference between the mean of the bootstrap values and the observed value. |
Percent.bias |
the percentage bias: 100*|Bias/Observed|. |
Null |
the null-hypothesis value or NULL. |
Alternative |
the alternative hypothesis or NULL. |
P.value |
the P-value or a statement like P < 0.001 or NULL. |
p.value |
the P-value or NULL. |
Level |
the confidence level. |
Type |
the type of confidence interval. |
Confidence.interval |
the confidence interval. |
This routine should be used only when bias is small and the sampling distribution is roughly symmetric, as indicated by the output of the bootstrap. Otherwise, use the BCa version.
Neil A. Weiss
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # Losses ($) for a sample of 25 pickpocket offenses.
data("loss")
str(loss)
# 95% (default) confidence interval for the mean loss of all pickpocket offenses.
boot.one.per(loss, mean)
# 95% (default) lower confidence bound for the mean loss of all pickpocket
# offenses, and a right-tailed test with null hypothesis 500.
boot.one.per(loss, mean, null.hyp = 500, alternative = "greater")
# 90% two-sided confidence interval for the mean loss of all pickpocket
# offenses, and a right-tailed test with null hypothesis 500.
boot.one.per(loss, mean, null.hyp = 500, alternative = "greater", conf.level = 0.90,
type = "two-sided")
# 95% (default) confidence interval for the standard deviation of losses of all
# pickpocket offenses.
boot.one.per(loss, sd)
# See the preceeding warning!
# 95% (default) confidence interval for the 20% trimmed mean.
twen.tm <- function(x) mean(x, trim = 0.20)
boot.one.per(loss, twen.tm)
|
Loading required package: boot
Loading required package: simpleboot
Simple Bootstrap Routines (1.1-7)
num [1:25] 447 207 627 430 883 313 844 253 397 214 ...
RESULTS OF PERCENTILE BOOTSTRAP FOR MEAN
SUMMARY Variable n Statistic Observed
STATISTICS loss 25 mean 513.32
BOOTSTRAP Replications Mean SE Bias Percent.bias
SUMMARY 9999 512.9011 51.18339 -0.419 0.0816
CONFIDENCE Level Type Confidence.interval
INTERVAL 95% two-sided (415.4, 614.5)
RESULTS OF PERCENTILE BOOTSTRAP FOR MEAN
SUMMARY Variable n Statistic Observed
STATISTICS loss 25 mean 513.32
BOOTSTRAP Replications Mean SE Bias Percent.bias
SUMMARY 9999 513.3129 51.44198 -0.00714 0.00139
HYPOTHESIS Null Alternative P.value
TEST 500 greater-than 0.401
CONFIDENCE Level Type Confidence.interval
INTERVAL 95% lower-bound 428.9 (LCB)
RESULTS OF PERCENTILE BOOTSTRAP FOR MEAN
SUMMARY Variable n Statistic Observed
STATISTICS loss 25 mean 513.32
BOOTSTRAP Replications Mean SE Bias Percent.bias
SUMMARY 9999 513.6203 51.34002 0.3 0.0584
HYPOTHESIS Null Alternative P.value
TEST 500 greater-than 0.403
CONFIDENCE Level Type Confidence.interval
INTERVAL 90% two-sided (429.9, 599.1)
RESULTS OF PERCENTILE BOOTSTRAP FOR SD
SUMMARY Variable n Statistic Observed
STATISTICS loss 25 sd 262.2309
BOOTSTRAP Replications Mean SE Bias Percent.bias
SUMMARY 9999 255.6688 29.46451 -6.56 2.5
CONFIDENCE Level Type Confidence.interval
INTERVAL 95% two-sided (197.3, 313.1)
RESULTS OF PERCENTILE BOOTSTRAP FOR TWEN.TM
SUMMARY Variable n Statistic Observed
STATISTICS loss 25 twen.tm 501.1333
BOOTSTRAP Replications Mean SE Bias Percent.bias
SUMMARY 9999 504.4689 64.44772 3.34 0.666
CONFIDENCE Level Type Confidence.interval
INTERVAL 95% two-sided (381.5, 631.4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.