Skip to contents

Creates formatted strings combining point estimates, optional confidence intervals, and significance stars from p-values.

Usage

eststar(est, pvalue, digits = 2, na = "", ci.low = NULL, ci.hi = NULL)

Arguments

est

Numeric vector of point estimates

pvalue

Numeric vector of p-values

digits

Number of decimal places for rounding (default: 2)

na

Character string to return for NA estimates (default: "")

ci.low

Numeric vector of confidence interval lower bounds (optional)

ci.hi

Numeric vector of confidence interval upper bounds (optional)

Value

Character vector of formatted estimate strings

Details

When confidence intervals are provided, format is: "est[ci.low ci.hi]***" When not provided, format is: "est***"

Examples

eststar(1.234, 0.001)
#> [1] "1.23**"
eststar(1.234, 0.001, digits = 3)
#> [1] "1.234**"
eststar(c(1.2, 2.3), c(0.01, 0.1))
#> [1] "1.20*" "2.30 "
eststar(1.234, 0.001, ci.low = 0.8, ci.hi = 1.7)
#> [1] "1.23[0.80 1.70]**"