pgt: Graphical display for the "Student's" t distribution, given a...

View source: R/pgt.R

pgtR Documentation

Graphical display for the "Student's" t distribution, given a specified quantile

Description

A function to draw a Student's t distribution and shade a region defined by the quantile

Usage

pgt(quantile, df = 100, tail = "upper")

Arguments

quantile

The quantile value (t value) to be evaluated. Note that quantile should be positive if a two-tailed result is requested.

df

Degrees of freedom for the t distribution. Note that the default is 100.

tail

Area(s) to be shaded on the graph. If "upper", the function returns a graph with the upper tail area shaded and the upper tail probability displayed. If "lower", the function returns a graph with the lower tail area shaded and the lower tail probability displayed. If "two" the function returns a graph with both tails shaded and a summed two-tailed probability displayed.

Warning

Specifying extremely high or low quantiles may not yield visible shaded areas if the regions are beyond the limits of the X axis scale of the graph.
In addition, probabilities are rounded to five decimal places and will display as zero if below .000005. Use the pt function in this case.

Note

This function can be very helpful in instructional situations and can replace the "t table" from textbooks.

Author(s)

Bruce Dudek bruce.dudek@albany.edu

Examples

pgt(-1.76, df=25, tail="lower")
pgt(1.76, df=25, tail="upper")
pgt(1.76, df=25, tail="two")
pgt(2.31, df=10, tail="lower")
# don't use this next example form with tail="two"
# instead use the following example example form
pgt(-1.7, df=10, tail="two")
pgt(1.7, df=10, tail="two")


bcdudek/bcdstats documentation built on Aug. 15, 2024, 7:24 p.m.