setLink: Affect a given value to a link between two variables in a lvm

Description Usage Arguments Examples

Description

Generic interface to set a value to a link in a lvm.

Usage

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

## S3 method for class 'lvm'
setLink(x, var1, var2, value, warnings = FALSE)

Arguments

x

a lvm model

var1

the first variable (character) or a formula describing the link

var2

the second variable (character). Only used if var1 is a character.

value

the value to which the link should be set

warnings

should a warning be displayed when the link is not found in the lvm.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
setLink <- lavaPenalty:::setLink

m <- lvm()
regression(m) <- c(y1,y2,y3)~u
regression(m) <- u~x1+x2
latent(m) <- ~u
covariance(m) <- y1 ~ y2

m1 <- setLink(m, y3 ~ u, value = 1)
estimate(m1, sim(m,1e2))
# m1 <- setLink(m, u ~ y3, value = 1)

m2 <- setLink(m, y1 ~ y2, value = 0.5)
estimate(m2, sim(m,1e2))

## End(Not run)

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