Extract confidence intervals, test statistics or p-values from an
htest object.
# S3 method for class 'htest'
confint(object, parm, level, ...)
pval(x, ...)
# S3 method for class 'htest'
pval(x, digits = 4, verbose = FALSE, ...)
stat(x, ...)
# S3 method for class 'htest'
stat(x, ...)
# S3 method for class 'uneval'
stat(x, ...)a fitted model object or an htest object.
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.
the confidence level required.
Additional arguments.
An object of class htest.
number of digits to display in verbose output
a logical
the extracted p-value, confidence interval, or test statistic
confint(t.test(rnorm(100)))
#> mean of x lower upper level
#> 1 0.02967354 -0.1755472 0.2348942 0.95
pval(t.test(rnorm(100)))
#> p.value
#> 0.6039811
stat(t.test(rnorm(100)))
#> t
#> -0.3345916
confint(var.test(rnorm(10,sd=1), rnorm(20, sd=2)))
#> ratio of variances lower upper level
#> 1 0.3279891 0.113883 1.208095 0.95
pval(var.test(rnorm(10,sd=1), rnorm(20, sd=2)))
#> p.value
#> 0.02553581
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))
}
#> t
#> 1 -1.03485015
#> 2 0.02986026
#> 3 0.98876997
#> 4 -0.27501184
#> 5 0.35325209
#> 6 -1.72610387
#> 7 0.00113302
#> 8 1.13971098
#> 9 0.58472115
#> 10 0.22917871