Description Usage Arguments Value Examples
General function to specify a general latent growth components model.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
data |
Dataframe. Data object to be passed to lavaan. |
mmodel |
Object of class |
C_matrix |
Contrast matrix. Must be invertible. |
hypotheses |
List of numeric vectors. Each list element represents a hypothesis. For each hypothesis, the contrasts indicated by the elements of the vectors are tested against zero. |
covariates |
Not implemented yet. |
groups |
Not implemented yet. |
append |
Character. Syntax that is to be appended to lavaan syntax. |
verbose |
Boolean. Print details during procedure. |
compound_symmetry |
Boolean. When set to TRUE, compound symmetry is assumed. |
sphericity |
Boolean or formula. When set to TRUE, sphericity is assumed for all effects. |
multiv_tests |
Character vector. Multivariate test statistics that are to be computed.
Possible statistics are: |
univ_tests |
Character vector. Univariate test statistics that are to be computed.
Possible statistics are: |
randomization |
Not yet supported. |
... |
Additional arguments to be passed to lavaan. |
Function returns an lgc object. Use summary(object)
to print
hypotheses. Otherwise use object@sem_obj
to get access to the underlying
lavaan object.
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 33 | set.seed(323412431)
data("semnova_test_data", package = "semnova")
mmodel <- create_mmodel(
A1B1 = "var1",
A2B1 = "var2",
A3B1 = "var3",
A1B2 = "var4",
A2B2 = "var5",
A3B2 = "var6",
lv_scaling = "referent"
)
hypotheses <- list(
Intercept = c(1),
A = c(2, 3),
B = c(4),
AB = c(5, 6)
)
C_matrix <- matrix(
c(1, 1, 0, 1, 1, 0,
1, 0, 1, 1, 0, 1,
1,-1,-1, 1,-1,-1,
1, 1, 0,-1,-1, 0,
1, 0, 1,-1, 0,-1,
1,-1,-1,-1, 1, 1),
nrow=6
)
fit_lgc <- lgc(data = semnova_test_data, mmodel, C_matrix, hypotheses)
summary(fit_lgc)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.