effects2: Effects Through Pathways With Small Sample Correction

effects2R Documentation

Effects Through Pathways With Small Sample Correction

Description

Test whether a path in the latent variable model correspond to a null effect. Similar to lava::effects but with small sample correction (if any). So far it only work for a single path related two variable composed of one or two edges.

Usage

effects2(object, linfct, robust, cluster, conf.level, ...)

## S3 method for class 'lvmfit'
effects2(
  object,
  linfct,
  robust = FALSE,
  cluster = NULL,
  conf.level = 0.95,
  to = NULL,
  from = NULL,
  df = lava.options()$df,
  ssc = lava.options()$ssc,
  ...
)

## S3 method for class 'lvmfit2'
effects2(
  object,
  linfct,
  robust = FALSE,
  cluster = NULL,
  conf.level = 0.95,
  to = NULL,
  from = NULL,
  ...
)

## S3 method for class 'lvmfit2'
effects(
  object,
  linfct,
  robust = FALSE,
  cluster = NULL,
  conf.level = 0.95,
  to = NULL,
  from = NULL,
  ...
)

Arguments

object

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

linfct

[character vector] The path for which the effect should be assessed (e.g. "A~B"), i.e. the effect of the right variable (B) on the left variable (A).

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.

conf.level

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

...

additional argument passed to estimate2 when using a lvmfit object.

from, to

alternative to argument linfct. See lava::effects.

df

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

ssc

[character] method used to correct the small sample bias of the variance coefficients: no correction (code"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.

Details

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 path.


lavaSearch2 documentation built on April 12, 2023, 12:33 p.m.