Learn R Programming

lavaSearch2 (version 1.0.0)

findNewLink: Find all New Links Between Variables

Description

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

Usage

findNewLink(x, ...)

# S3 method for lvm findNewLink(x, data = NULL, exclude.var = NULL, rm.latent_latent = FALSE, rm.endo_endo = FALSE, rm.latent_endo = FALSE, output = "names", ...)

Arguments

x

a lvm model

...

additional arguments to be passed to lower levels functions.

data

an optional dataset used to identify the categorical variables if not specified in the lvm object.

exclude.var

all links related to these variables will be ignore.

rm.latent_latent

ignore links relating two latent variables.

rm.endo_endo

ignore links relating two endogenous variables

rm.latent_endo

ignore links relating one endogenous variable and one latent variable

output

return the names of the variables to link ("names") or their position ("index")

Value

A list

Examples

Run this code
# NOT RUN {
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")
# }

Run the code above in your browser using DataLab