findNewLink {lavaSearch2}R Documentation

Find all New Links Between Variables

Description

Find all new links between variables (adapted from lava::modelsearch).

Usage

findNewLink(object, ...)

## S3 method for class 'lvm'
findNewLink(
  object,
  data = NULL,
  type = "both",
  exclude.var = NULL,
  rm.latent_latent = FALSE,
  rm.endo_endo = FALSE,
  rm.latent_endo = FALSE,
  output = "names",
  ...
)

Arguments

object

a lvm object.

...

[internal] only used by the generic method.

data

[optional] a dataset used to identify the categorical variables when not specified in the lvm object.

type

[character vector] the type of links to be considered: "regression", "covariance", or "both", .

exclude.var

[character vector] all links related to these variables will be ignore.

rm.latent_latent

[logical] should the links relating two latent variables be ignored?

rm.endo_endo

[logical] should the links relating two endogenous variables be ignored?

rm.latent_endo

[logical] should the links relating one endogenous variable and one latent variable be ignored?

output

[character] Specify "names" to return the names of the variables to link or specify "index" to return their position.

Value

A list containing:

Examples

library(lava)

m <- lvm()
regression(m) <- c(y1,y2,y3)~u
categorical(m,labels=c("M","F","MF")) <- ~X1
findNewLink(m, rm.endo = FALSE)
findNewLink(m, rm.endo = TRUE)
findNewLink(m, exclude.var = "X1")

regression(m) <- u~x1+x2
latent(m) <- ~u

findNewLink(m, rm.endo = FALSE)
findNewLink(m, rm.endo = TRUE)
findNewLink(m, rm.endo = TRUE, output = "index")
findNewLink(m, type = "covariance")
findNewLink(m, type = "regression")


[Package lavaSearch2 version 2.0.3 Index]