Description Usage Arguments Details Examples
Generic interface to add links to a lvm.
1 2 3 4 5 6 7 8 |
x |
a lvm model |
... |
arguments to be passed to lower levels functions |
var1 |
the first variable (character) or a formula describing the link to be added to the lvm |
var2 |
the second variable (character). Only used if var1 is a character. |
covariance |
does the link is bidirectional. Ignored if one of the variable is exogenous. |
allVars |
all the existing variables. |
warnings |
should a warning be displayed when no link is added |
The argument allVars is useful for lvm.reduce
object where the command vars(x)
does not return all variables. The command vars(x, xlp = TRUE)
must be used instead.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## Not run:
addLink <- lavaPenalty:::addLink
m <- lvm()
regression(m) <- c(y1,y2,y3)~u
regression(m) <- u~x1+x2
latent(m) <- ~u
m2 <- m
addLink(m, x1 ~ y1)
addLink(m, y1 ~ x1)
coef(addLink(m, y1 ~ y2, covariance = TRUE))
addLink(m2, "x1", "y1")
addLink(m2, "y1", "x1")
coef(addLink(m, "y1", "y2", covariance = TRUE))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.