apa_interval {papaja} | R Documentation |
Typeset Interval Estimate
Description
Creates a character string to report interval estimates, such as frequentist confidence or Bayesian credible intervals.
Usage
apa_interval(
x,
...,
conf.int = NULL,
interval_type = NULL,
enclose_math = FALSE
)
print_interval(
x,
...,
conf.int = NULL,
interval_type = NULL,
enclose_math = FALSE
)
## S3 method for class 'numeric'
apa_interval(
x,
y = NULL,
conf.int = NULL,
interval_type = NULL,
enclose_math = FALSE,
...
)
## S3 method for class 'matrix'
apa_interval(
x,
conf.int = NULL,
interval_type = NULL,
enclose_math = FALSE,
...
)
## S3 method for class 'data.frame'
apa_interval(x, ...)
## S3 method for class 'list'
apa_interval(x, ...)
apa_confint(x, ..., interval_type = "CI")
print_confint(x, ..., interval_type = "CI")
apa_hdint(x, ..., interval_type = "HDI")
print_hdint(x, ..., interval_type = "HDI")
Arguments
x |
Numeric. A vector (of length 2, unless |
... |
Arguments passed on to |
conf.int |
Numeric. Confidence level of the interval. Ignored if
level can be inferred from attributes of |
interval_type |
Character. Abbreviation indicating the type of interval
estimate, e.g. |
enclose_math |
Logical. Indicates whether the interval should be
enclosed in |
y |
Numeric. An optional vector of the same length as |
Details
If possible the confidence level of the interval is inferred from
attributes of x
. For a vector of length 2, the attribute conf.level
is
is consulted; for a matrix
or data.frame
the column names are used,
if they are of the format "2.5 \
If x
is a matrix
or data.frame
the row names are used as names for
the returned list
of intervals.
Value
A single interval is returned as a character
vector of length 1;
multiple intervals are returned as a named list
of character
vectors
of length 1.
See Also
Examples
apa_confint(1, 2, conf.int = 0.95)
apa_confint(c(1, 2), conf.int = 0.95)
apa_confint(matrix(c(1, 2), ncol = 2), conf.int = 0.95)
apa_confint(confint(lm(cars)))
apa_confint(confint(lm(cars)), digits = 3)