Skip to contents

Extracts a confidence interval from an object and returns the interval as a text string.

Usage

text_confint(x, ...)

# S3 method for default
text_confint(
  x,
  param = NULL,
  level = 0.95,
  digits = getOption("out2text_coef_digits", 3),
  format = getOption("out2text_coef_format", "f"),
  sep = getOption("out2text_confint_sep", ", "),
  brackets = getOption("out2text_confint_brackets", c("[", "]")),
  ...
)

# S3 method for lm
text_confint(
  x,
  param = NULL,
  level = 0.95,
  digits = getOption("out2text_coef_digits", 3),
  format = getOption("out2text_coef_format", "f"),
  sep = getOption("out2text_confint_sep", ", "),
  brackets = getOption("out2text_confint_brackets", c("[", "]")),
  ...
)

# S3 method for lavaan
text_confint(
  x,
  param = NULL,
  level = 0.95,
  digits = getOption("out2text_coef_digits", 3),
  format = getOption("out2text_coef_format", "f"),
  sep = getOption("out2text_confint_sep", ", "),
  brackets = getOption("out2text_confint_brackets", c("[", "]")),
  standardized = FALSE,
  group = 1L,
  ...
)

Arguments

x

A supported object with coefficients in the results.

...

Optional arguments. To be passed to stats::confint().

param

The name of the term or parameter for which the coefficients will be returned.

level

The level of confidence. Default is .95.

digits

The number of decimal places to keep. To be passed to formatC().

format

The format string used in formatC(). Default is "f".

sep

The separator. Default is ", ".

brackets

The brackets. A character vector with two elements. Default is c("[", "]").

standardized

Logical. Whether the estimate in the standardized solution is to be returned. Default is FALSE.

group

For an lavaan-class object, the group from which the estimate is to be returned. Default is 1.

Value

A one-element character vector of the interval.

Details

Details (Include subjects for verbs.) (Use 3rd person forms for verbs.)

Examples


set.seed(894252)
n <- 10
x <- rnorm(n)
y <- .6 * x + rnorm(n, 0, .8)
out <- lm(y ~ x)
text_confint(out, "x")
#> [1] "[0.159, 0.708]"