| setLink | R Documentation | 
Generic interface to set a value to a link in a lvm object.
setLink(object, ...)
## S3 method for class 'lvm'
setLink(object, var1, var2, value, warnings = FALSE, ...)
| object | a  | 
| ... | [internal] only used by the generic method. | 
| var1 | [character or formula] the exogenous variable of the new link or a formula describing the link to be added to the lvm. | 
| var2 | [character] the endogenous variable of the new link. Disregarded if the argument  | 
| value | [numeric] the value at which the link should be set. | 
| warnings | [logical] should a warning be displayed if the link is not found in the  | 
library(lava)
set.seed(10)
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, lava::sim(m,1e2))
# m1 <- setLink(m, u ~ y3, value = 1)
m2 <- setLink(m, y1 ~ y2, value = 0.5)
estimate(m2, lava::sim(m,1e2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.