clean: Simplify a lvm object

cleanR Documentation

Simplify a lvm object

Description

Remove variables with no link.

Usage

clean(x, ...)

## S3 method for class 'lvm'
clean(x, rm.exo = TRUE, rm.endo = TRUE, rm.latent = TRUE, ...)

Arguments

x

lvm-object

...

additional arguments to lower level functions

rm.exo

should exogenous variables with no links be removed from the object?

rm.endo

should endogenous variables with no links be removed from the object?

rm.latent

should latent variables with no links be removed from the object?

Examples


m <- lvm()
m <- regression(m, x=paste0("x",1:5),y="y1")
m <- regression(m, x=paste0("x",1:5),y="y2")
covariance(m) <- y1~y2

cancel(m) <- y1 ~ x1
cancel(m) <- y2 ~ x1
clean(m)

m <- lvm(y1 ~ eta + x1, y2 ~ eta, y3 ~ eta + x2)
latent(m) <- ~eta
clean(m)
m
cancel(m) <- y1 ~ eta
cancel(m) <- y2 ~ eta
cancel(m) <- y3 ~ eta
clean(m)

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