{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Multiple Testing" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We'll begin by recreating the examples from this morning's lecture:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Coin Toss Experiments" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/html": [ "
binom.test {stats} | R Documentation |
Performs an exact test of a simple null hypothesis about the\n", "probability of success in a Bernoulli experiment.\n", "
\n", "\n", "\n", "\n", "binom.test(x, n, p = 0.5,\n", " alternative = c(\"two.sided\", \"less\", \"greater\"),\n", " conf.level = 0.95)\n", "\n", "\n", "\n", "
x | \n",
"\n",
" number of successes, or a vector of length 2 giving the\n", "numbers of successes and failures, respectively. \n", " |
n | \n",
"\n",
" number of trials; ignored if |
p | \n",
"\n",
" hypothesized probability of success. \n", " |
alternative | \n",
"\n",
" indicates the alternative hypothesis and must be\n",
"one of |
conf.level | \n",
"\n",
" confidence level for the returned confidence\n", "interval. \n", " |
Confidence intervals are obtained by a procedure first given in\n",
"Clopper and Pearson (1934). This guarantees that the confidence level\n",
"is at least conf.level
, but in general does not give the\n",
"shortest-length confidence intervals.\n",
"
A list with class \"htest\"
containing the following components:\n",
"
statistic | \n",
"\n",
" the number of successes. \n", " |
parameter | \n",
"\n",
" the number of trials. \n", " |
p.value | \n",
"\n",
" the p-value of the test. \n", " |
conf.int | \n",
"\n",
" a confidence interval for the probability of success. \n", " |
estimate | \n",
"\n",
" the estimated probability of success. \n", " |
null.value | \n",
"\n",
" the probability of success under the null,\n",
" |
alternative | \n",
"\n",
" a character string describing the alternative\n", "hypothesis. \n", " |
method | \n",
"\n",
" the character string |
data.name | \n",
"\n",
" a character string giving the names of the data. \n", " |
Clopper, C. J. & Pearson, E. S. (1934).\n", "The use of confidence or fiducial limits illustrated in the case of\n", "the binomial.\n", "Biometrika, 26, 404–413.\n", "
\n", "William J. Conover (1971),\n", "Practical nonparametric statistics.\n", "New York: John Wiley & Sons.\n", "Pages 97–104.\n", "
\n", "Myles Hollander & Douglas A. Wolfe (1973),\n", "Nonparametric Statistical Methods.\n", "New York: John Wiley & Sons.\n", "Pages 15–22.\n", "
\n", "\n", "\n", "prop.test
for a general (approximate) test for equal or\n",
"given proportions.\n",
"
\n", "## Conover (1971), p. 97f.\n", "## Under (the assumption of) simple Mendelian inheritance, a cross\n", "## between plants of two particular genotypes produces progeny 1/4 of\n", "## which are \"dwarf\" and 3/4 of which are \"giant\", respectively.\n", "## In an experiment to determine if this assumption is reasonable, a\n", "## cross results in progeny having 243 dwarf and 682 giant plants.\n", "## If \"giant\" is taken as success, the null hypothesis is that p =\n", "## 3/4 and the alternative that p != 3/4.\n", "binom.test(c(682, 243), p = 3/4)\n", "binom.test(682, 682 + 243, p = 3/4) # The same.\n", "## => Data are in agreement with the null hypothesis.\n", "\n", "\n", "