Actions

Talk

T distribution table

From OPOSSEM

The R source code for generating this table is as follows:

# Generate a table of cumulative probabilities for the t distribution
# for the wiki textbook.
#
# (C) 2011 Chris Lawrence <c.n.lawrence@gmail.com>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

tval <- c(0.95, 0.975, 0.995)
df <- c(1:39, seq(40, 120, by=10), 200, Inf)

m <- t(round(outer(tval, df, function(a, b) qt(a, b, lower=T)), 3))

df[length(df)] <- '∞'
colnames(m) <- c('90%', '95%', '99%')
rownames(m) <- df
library(xtable)

xtab <- xtable(m, digits=3)
print(xtab, type="html", file="ttable.html",
  html.table.attributes='border="1" cellspacing="0" cellpadding="2" align="center" style="text-align: center;"')

You will need the xtable package installed to generate the HTML table.