View source: R/objectivematrices.R
objectivematrices | R Documentation |
Generate objects of the correct structure for use in custom objective functions.
objectivematrices(
data,
factor.structure,
capacity = NULL,
matrices = c("lvcor"),
n.random = 0,
item.invariance = "congeneric",
repeated.measures = NULL,
long.invariance = "strict",
mtmm = NULL,
mtmm.invariance = "configural",
grouping = NULL,
group.invariance = "strict",
comparisons = NULL,
auxiliary = NULL,
use.order = FALSE,
software = "lavaan",
cores = NULL,
objective = NULL,
ignore.errors = FALSE,
analysis.options = NULL,
suppress.model = FALSE,
...
)
data |
A data.frame containing all relevant data. |
factor.structure |
A list linking factors to items. The names of the list elements correspond to the factor names. Each list element must contain a character-vector of item names that are indicators of this factor. |
capacity |
A list containing the number of items per subtest. This must be in the same order as the |
matrices |
Which matrix to extract. Can be one of |
n.random |
The number of random draws to base values on. If 0 (the default) values are in the matrices are set to 0 and can be overwritten later. If any value larger than 0, the mean from |
item.invariance |
A character vector of length 1 or the same length as |
repeated.measures |
A list linking factors that are repeated measures of each other. Repeated factors must be in one element of the list - other sets of factors in other elements of the list. When this is |
long.invariance |
A character vector of length 1 or the same length as |
mtmm |
A list linking factors that are measurements of the same construct with different methods. Measurements of the same construct must be in one element of the list - other sets of methods in other elements of the list. When this is |
mtmm.invariance |
A character vector of length 1 or the same length as |
grouping |
The name of the grouping variable. The grouping variable must be part of |
group.invariance |
A single value describing the assumed invariance of items across groups. Currently there are four options: 'configural', 'weak', 'strong', and 'strict'. Defaults to 'strict'. When |
comparisons |
A character vector containing any combination of 'item', 'long', 'mtmm', and 'group' indicating which invariance should be assessed via model comparisons. The order of the vector dictates the sequence in which model comparisons are performed. Defaults to |
auxiliary |
The names of auxiliary variables in |
use.order |
A logical indicating whether or not to take the selection order of the items into account. Defaults to |
software |
The name of the estimation software. Can currently be 'lavaan' (the default) or 'Mplus'. Each option requires the software to be installed. |
cores |
The number of cores to be used in parallel processing. If |
objective |
A function that converts the results of model estimation into a pheromone. See 'details' for... details. |
ignore.errors |
A logical indicating whether or not to ignore estimation problems (such as non positive-definite latent covariance matrices). Defaults to |
analysis.options |
A list additional arguments to be passed to the estimation software. The names of list elements must correspond to the arguments changed in the respective estimation software. E.g. |
suppress.model |
A logical indicating whether to suppress the default model generation. If |
... |
Additional arguments passed either to |
Returns an object of class stuartFixedObjective
Martin Schultze
empiricalobjective
, extractobjective
, objectivematrices
# Extract latent correlation matric
# requires lavaan
# number of cores set to 1 in all examples
data(sups)
fs <- list(pro = names(sups)[2:13],
fee = names(sups)[14:20])
mats <- objectivematrices(sups, fs, 3,
cores = 1)
mats
mats$lvcor$use[,] <- FALSE
mats$lvcor$use[2, 1] <- TRUE
mats$lvcor$use
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.