confint2: Confidence Intervals With Small Sample Correction

confint2R Documentation

Confidence Intervals With Small Sample Correction

Description

Extract confidence intervals of the coefficients from a latent variable model. Similar to lava::confint but with small sample correction.

Extract estimate, standard error, confidence intervals and p-values associated to each coefficient of a latent variable model. Similar to lava::confint but with small sample correction.

Usage

confint2(object, robust, cluster, transform, as.lava, conf.level, ...)

## S3 method for class 'lvmfit'
confint2(
  object,
  robust = FALSE,
  cluster = NULL,
  transform = NULL,
  as.lava = TRUE,
  conf.level = 0.95,
  ssc = lava.options()$ssc,
  df = lava.options()$df,
  ...
)

model.tables2(object, robust, cluster, transform, as.lava, conf.level, ...)

Arguments

object

a lvmfit or lvmfit2 object (i.e. output of lava::estimate or lavaSearch2::estimate2).

robust

[logical] should robust standard errors be used instead of the model based standard errors? Should be TRUE if argument cluster is not NULL.

cluster

[integer vector] the grouping variable relative to which the observations are iid.

transform

[function] transformation to be applied.

as.lava

[logical] when TRUE uses the same names as when using stats::coef.

conf.level

[numeric, 0-1] level of the confidence intervals.

...

additional argument passed to estimate2 when using a lvmfit object.

ssc

[character] method used to correct the small sample bias of the variance coefficients: no correction ("none"/FALSE/NA), correct the first order bias in the residual variance ("residual"), or correct the first order bias in the estimated coefficients "cox"). Only relevant when using a lvmfit object.

df

[character] method used to estimate the degree of freedoms of the Wald statistic: Satterthwaite "satterthwaite". Otherwise ("none"/FALSE/NA) the degree of freedoms are set to Inf. Only relevant when using a lvmfit object.

Details

When argument object is a lvmfit object, the method first calls estimate2 and then extract the confidence intervals.

When argument object is a lvmfit object, the method first calls estimate2 and then extract the confidence intervals.

Value

A data.frame with a row per coefficient.

A data.frame with a row per coefficient.

Examples

#### simulate data ####
set.seed(10)
dW <- sampleRepeated(10, format = "wide")
set.seed(10)
dL <- sampleRepeated(10, format = "long")
dL$time2 <- paste0("visit",dL$time)

#### latent variable models ####
e.lvm <- estimate(lvm(c(Y1,Y2,Y3) ~ 1*eta + X1, eta ~ Z1), data = dW)
confint(e.lvm)
confint2(e.lvm)
confint2(e.lvm, as.lava = FALSE)

bozenne/lavaSearch2 documentation built on Feb. 13, 2024, 10:18 p.m.