Learn R Programming

wBoot (version 1.0.3)

boot.paired.per: Percentile Bootstrap Paired-Samples Test and CI for Two Means

Description

Obtains a paired-samples confidence interval and (optionally) performs a paired-samples hypothesis test for the difference between two population means, using the percentile bootstrap method.

Usage

boot.paired.per(x, y, variable = NULL, null.hyp = NULL,
                alternative = c("two.sided", "less", "greater"),
                conf.level = 0.95, type = NULL, R = 9999)

Arguments

x
a (non-empty) numeric vector of data values.
y
a (non-empty) numeric vector of data values.
variable
an optional character string that gives the name of the variable 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
R
the number of bootstrap replications; default is 9999.

Value

  • A list with class "boot.paired" containing the following components:
  • Boot.valuesthe point estimates for the differences between the means obtained from the bootstrap.
  • Confidence.limitsthe confidence limit(s) for the confidence interval.
  • Headerthe main title for the output.
  • Variablethe name of the variable under consideration or NULL
  • Pop.1the first population.
  • Pop.2the second population.
  • nthe sample size.
  • Statisticthe name of the statistic, here diff.mean.
  • Observedthe observed point estimate for the difference between the means.
  • Replicationsthe number of bootstrap replications.
  • Meanthe mean of the bootstrap values.
  • SEthe standard deviation of the bootstrap values.
  • Biasthe difference between the mean of the bootstrap values and the observed value.
  • Percent.biasthe percentage bias: 100*|Bias/Observed|.
  • Nullthe null-hypothesis value or NULL.
  • Alternativethe alternative hypothesis or NULL.
  • P.valuethe P-value or a statement like P < 0.001 or NULL.
  • p.valuethe P-value or NULL.
  • Levelthe confidence level.
  • Typethe type of confidence interval.
  • Confidence.intervalthe confidence interval.

Warning

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.

concept

  • Bootstrap
  • Percentile bootstrap
  • Paired-sample inferences
  • Confidence interval
  • Hypothesis test
  • Inferences for two means

Details

Note that x and y must have the same length, as together they represent the paired data. Also note, for instance, that alternative = "greater" is the alternative that x variable has a larger mean than y variable.

Examples

Run this code
# The number of inappropriate words out of 10 that were identified in the
# Times New Roman (TNR) and Gigi fonts by each of 25 participants.
data("fonts")
str(fonts)
attach(fonts)

# 90% confidence interval for the difference between the mean number of
# inappropriate words out of 10 identified for the TNR and Gigi fonts.
boot.paired.per(TNR, GIGI, conf.level = 0.90)

# A right-tailed test with null hypothesis 2, and a 95% (default) lower
# confidence bound for the difference between the mean number of
# inappropriate words out of 10 identified for the TNR and Gigi fonts. 
boot.paired.per(TNR, GIGI, null.hyp = 2, alternative = "greater")
# Not significant at the 5% level.

# A right-tailed test with null hypothesis 1, and a 95% (default) lower
# confidence bound for the difference between the mean number of
# inappropriate words out of 10 identified for the TNR and Gigi fonts.
boot.paired.per(TNR, GIGI, null.hyp = 1, alternative = "greater")
# Significant at the 5% level.

detach(fonts)   # clean up

Run the code above in your browser using DataLab