Description Usage Arguments Value Examples
Perform a linear combination of posterior samples
1 |
lin_comb |
A string specifying a linear combination of variables, or a list of variable names if using |
obj |
An object of class |
ci |
The level for which a credible interval should be computed. |
rope |
Specify a ROPE. Optional. |
contrast |
A contrast matrix specifying which combinations to test. |
An object of class lin_comb
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 31 32 | # data
if (require(BGGM)) library(BGGM)
Y <- ptsd
# names
colnames(Y) <- letters[1:20]
# estimate model
est <- estimate(Y)
# test
bggm_comb <- lin_comb("a--c + a--d > b--c + b--d",
obj = est,
ci = 0.90,
rope = c(-0.1, 0.1))
# print
bggm_comb
# Using a contrast matrix to test pairwise differences
vars <- c("a--c", "a--d", "b--c")
contrast_mat <- matrix(c(1, -1, 0,
1, 0, -1,
0, 1, -1), nrow = 3, byrow = TRUE)
bggm_comb <- lin_comb(vars,
obj = est,
ci = 0.90,
contrast = contrast_mat)
# print
bggm_comb
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.