Calculates a confidence interval given a g_REML, a g_HPS, or a g_mlm object using either a central t distribution (for a symmetric interval) or a non-central t distribution (for an asymmetric interval).

Arguments

g

an estimated effect size object of class g_REML, class g_HPS, or class g_mlm.

cover

confidence level

bound

numerical tolerance for non-centrality parameter in qt.

symmetric

If TRUE (the default), use a symmetric confidence interval. If FALSE, use a non-central t approximation to obtain an asymmetric confidence interval.

Value

A vector of upper and lower confidence bounds.

Examples

data(Laski)
Laski_RML <- lme(fixed = outcome ~ treatment,
                 random = ~ 1 | case,
                 correlation = corAR1(0, ~ time | case),
                 data = Laski)
Laski_g_REML <- suppressWarnings(
  g_REML(Laski_RML, p_const = c(0,1), 
         r_const = c(1,0,1), returnModel = FALSE)
)
CI_g(Laski_g_REML, symmetric = TRUE)
#> [1] 0.8046224 2.0051521
CI_g(Laski_g_REML, symmetric = FALSE)
#> [1] 0.9143684 2.0046719

Laski_HPS <- with(Laski, effect_size_MB(outcome, treatment, case, time))
CI_g(Laski_HPS, symmetric = FALSE)
#> [1] 0.8786207 2.0639828

Laski_g_mlm <- g_mlm(mod = Laski_RML, p_const = c(0,1), r_const = c(1,0,1))
CI_g(Laski_g_mlm, symmetric = FALSE)
#> [1] 0.9143684 2.0046719