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 |
... |
[internal] only used by the generic method. |
data |
[optional] a dataset used to identify the categorical variables when not specified in the |
type |
[character vector] the type of links to be considered: |
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 |
Value
A list containing:
M.links: a matrix with two columns indicating (by name or position) the exogenous and endogenous variable corresponding to each link.
links: the name of the additional possible links
directional: a logical vector indicating for each link whether the link is unidirectional (
TRUE
, i.e. regression link) or bidirectional (FALSE
, i.e. covariance link).
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")