Learn R Programming

mosaic (version 0.4-1)

interval: Extract summary statistics

Description

Extract confidence intervals, test statistics or p-values from an htest object.

Usage

interval(x, ...)

## S3 method for class 'htest': interval(x, verbose = FALSE, ...)

pval(x, ...)

## S3 method for class 'htest': pval(x, digits = 4, verbose = FALSE, ...)

stat(x, ...)

## S3 method for class 'htest': stat(x, ...)

Arguments

x
An object of class htest.
...
Additional arguments.
verbose
a logical
digits
number of digits to display in verbose output

Value

  • the extracted p-value, confidence interval, or test statistic

Examples

Run this code
interval(t.test(rnorm(100)))
pval(t.test(rnorm(100)))
stat(t.test(rnorm(100)))
interval(var.test(rnorm(10,sd=1), rnorm(20, sd=2)))
pval(var.test(rnorm(10,sd=1), rnorm(20, sd=2)))

data(HELPrct)
stat(t.test (age ~ shuffle(sex), HELPrct))
# Compare to test statistic computed with permuted values of sex.
do(10) * stat(t.test (age ~ shuffle(sex), HELPrct))

Run the code above in your browser using DataLab