Description Usage Arguments Details Value Warning Author(s) Examples

View source: R/boot.paired.per.R

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.

1 2 3 |

`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 is "greater". |

`R` |
the number of bootstrap replications; default is 9999. |

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.

A list with class "boot.paired" containing the following components:

`Boot.values ` |
the point estimates for the differences between the means 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 or NULL |

`Pop.1 ` |
the first population. |

`Pop.2 ` |
the second population. |

`n ` |
the sample size. |

`Statistic ` |
the name of the statistic, here diff.mean. |

`Observed ` |
the observed point estimate for the difference between the means. |

`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 | ```
# 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
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.