kill.lp: Remove variables from linear predictors

Description Usage Arguments Examples

Description

Remove one or several variable from the linear predictors

Usage

1
2
3
lavaReduce.remove.hook(x, var, expar = TRUE, restaure = FALSE, ...)

lavaReduce.cancel.hook(x, value, expar = TRUE, restaure = FALSE, ...)

Arguments

x

lvm-object

var

the names of the variables that should be removed

expar

should the external parameters be also removed

restaure

should the link be kept while removing the linear predictor

...

argument passed to clean

value

the names of the variables that should be removed

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
m <- lvm()
m <- regression(m, x=paste0("x",1:10),y="y")
kill(m) <- "x7"

rm <- reduce(m, rm.exo = FALSE)

kill(rm) <- ~x6
kill(rm, value = "x1")
kill(rm, value = c("x2","x3"))
kill(rm, value = ~x4+x5)
kill(rm, value = ~LPy)


m <- lvm.reduced()
regression(m) <- y1 ~ x1+x2+x3
regression(m) <- y2 ~ z
covariance(m) <- y1 ~ y2
cancel(m) <- y1~x1+x2+x3
m
cancel(m) <- "y1 ~~ y2"
coef(m)

# see test/testthat/test-cancel.R

bozenne/lava.reduce documentation built on May 13, 2019, 1:41 a.m.