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

# S3 method for htest
confint(object, parm, level, ...)

pval(x, ...)

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

stat(x, ...)

# S3 method for htest
stat(x, ...)

# S3 method for uneval
stat(x, ...)

Arguments

object

a fitted model object or an htest object.

parm

a specification of which parameters are to be given confidence intervals, either a vector of numbers or a vector of names. If missing, all parameters are considered.

level

the confidence level required.

...

Additional arguments.

x

An object of class htest.

digits

number of digits to display in verbose output

verbose

a logical

Value

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

Examples

confint(t.test(rnorm(100)))
#>      mean of x      lower     upper level
#> 1 -0.006451192 -0.2071248 0.1942224  0.95
pval(t.test(rnorm(100)))
#>   p.value 
#> 0.3227409 
stat(t.test(rnorm(100)))
#>        t 
#> 1.539478 
confint(var.test(rnorm(10,sd=1), rnorm(20, sd=2)))
#>   ratio of variances     lower    upper level
#> 1          0.3064514 0.1064048 1.128764  0.95
pval(var.test(rnorm(10,sd=1), rnorm(20, sd=2)))
#>   p.value 
#> 0.1359995 
if (require(mosaicData)) {
data(HELPrct)
stat(t.test (age ~ shuffle(sex), data=HELPrct))
# Compare to test statistic computed with permuted values of sex.
do(10) * stat(t.test (age ~ shuffle(sex), data=HELPrct))
}
#> Using parallel package.
#>   * Set seed with set.rseed().
#>   * Disable this message with options(`mosaic:parallelMessage` = FALSE)
#>             t
#> 1  -0.9483430
#> 2   0.8458801
#> 3  -1.0342058
#> 4   0.1853414
#> 5  -0.2320483
#> 6  -0.2097493
#> 7   0.4114783
#> 8   2.2663608
#> 9   0.6008257
#> 10 -1.3415732