reduce: Reduce latent variable model

Description Usage Arguments Examples

Description

Aggregate exogeneous variables into a linear predictor

Usage

1
2
3
4
reduce(x, ...)

## S3 method for class 'lvm'
reduce(x, link = NULL, endo = NULL, clean = TRUE, ...)

Arguments

x

lvm-object

...

additional arguments to be passed to the low level functions

link

the links that should be aggregated into linear predictors

endo

the endogeneous variables for which the related exogeneous variables should be aggregated

clean

should the lvm object be simplified using the clean function

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
## regression
m <- lvm()
m <- regression(m, x=paste0("x",1:10),y="y")
m

mtest <- m
cancel(mtest) <- y ~ x1 + x2 + x3 + x4 + x5
mtest
coef(mtest)
rm <- reduce(m)
rm
lp(rm, type = "link")
coef(rm)

coef(reduce(m))
reduce(m, rm.exo = TRUE)

reduce(m, link = paste0("y~x",1:5))

## lvm
m <- lvm()
m <- regression(m, x=paste0("x",1:10),y="y1")
m <- regression(m, x=paste0("x",11:30),y="y2")
covariance(m) <- y1~y2

system.time(
rm <- reduce(m)
)
coef(rm)
reduce(m, rm.exo = TRUE)

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