clean: Simplify a lvm object

Description Usage Arguments Details Examples

Description

Remove variables with no link and simplify the class of the lvm object

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
clean(x, ...)

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

lavaReduce.clean.hook(x, rm.exo, rm.lp = TRUE, simplify.reduce = TRUE,
  simplify, ...)

lavaReduce.clean.hook(x, rm.exo, rm.lp = TRUE, simplify.reduce = TRUE,
  simplify, ...)

Arguments

x

lvm-object

...

additional arguments to lower level functions

rm.exo

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

rm.endo

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

rm.latent

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

rm.lp

should the linear predictors with no links be removed from the object ?

simplify.reduce

should the class lvm.reduced be droped if there is no linear predictor in the object?

simplify

should the class of the object be simplified ? Overwrite the simplify.x arguments.

Details

simplify means remove the class "lavaReduce" if no linear predictor is in the object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
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/lava.reduce documentation built on May 13, 2019, 1:41 a.m.