Utility functions related to the parameter table (partable)
# extract information from a parameter table
lav_partable_df(partable)
lav_partable_ndat(partable)
lav_partable_npar(partable)
lav_partable_attributes(partable, pta = NULL)# generate parameter labels
lav_partable_labels(partable, blocks = c("group", "level"),
group.equal = "", group.partial = "", type = "user")
# generate parameter table for specific models
lav_partable_independence(lavobject = NULL, lavdata = NULL,
lavpta = NULL, lavoptions = NULL, lavsamplestats = NULL,
sample.cov = NULL, sample.mean = NULL, sample.slopes = NULL,
sample.th = NULL, sample.th.idx = NULL,
sample.cov.x = NULL, sample.mean.x = NULL)
lav_partable_unrestricted(lavobject = NULL, lavdata = NULL,
lavpta = NULL, lavoptions = NULL, lavsamplestats = NULL,
sample.cov = NULL, sample.mean = NULL, sample.slopes = NULL,
sample.th = NULL, sample.th.idx = NULL,
sample.cov.x = NULL, sample.mean.x = NULL)
lav_partable_from_lm(object, est = FALSE, label = FALSE,
as.data.frame. = FALSE)
# complete a parameter table only containing a few columns (lhs,op,rhs)
lav_partable_complete(partable = NULL, start = TRUE)
# merge two parameter tables
lav_partable_merge(pt1 = NULL, pt2 = NULL, remove.duplicated = FALSE,
fromLast = FALSE, warn = TRUE)
A parameter table. see lavParTable
for more information.
Character vector. Which columns in the parameter table should be
taken to distinguish between different blocks of parameters (and hence
be given different labels)? If "blocks"
includes "group"
, a
suffix ".g"
and the group number (or group label) is added for
the parameters of all but the first group. If "blocks"
includes
"level"
, a suffix ".l"
and the level number is added for
the parameters of all but the first level. If "blocks"
includes,
say "foo"
, a suffix ".foo"
and the corresponding value of
"foo"
is added to all parameters.
The same options can be used here as in the fitting functions. Parameters that are constrained to be equal across groups will be given the same label.
A vector of character strings containing the labels of the parameters which should be free in all groups.
Character string. Can be either `user' or `free' to select all entries or only the free parameters from the parameter table respectively.
An object of class `lavaan'. If this argument is provided, it should be the only argument. All the values for the other arguments are extracted from this object.
An object of class `lavData'. The Data slot from a lavaan object.
A names list. The Options lsot from a lavaan object.
An object of class `lavSampleStats'. The SampleStats slot from a lavaan object.
The pta (parameter table attributes) slot from a lavaan object.
Optional list of numeric matrices. Each list element contains a sample variance-covariance matrix for this group. If provided, these values will be used as starting values.
Optional list of numeric vectors. Each list element contains a sample mean vector for this group. If provided, these values will be used as starting values.
Optional list of numeric matrices.
Each list element contains the sample slopes for this group (only used
when conditional.x = TRUE
).
If provided, these values will be used as starting values.
Optional list of numeric vectors. Each list element contains a vector of sample thresholds for this group. If provided (and also sample.th.idx is provided), these values will be used as starting values.
Optional list of integers. Each list contains the threshold indices for this group.
Optional list of numeric matrices. Each list element
contains a sample variance-covariance matrix for the exogenous variables
for this group (only used when conditional.x = TRUE
). If provided,
these values will be used as starting values.
Optional list of numeric vectors.
Each list element contains a sample mean vector for the exogenous variables
for this group (only used when conditional.x = TRUE
).
If provided, these values will be used as starting values.
Logical. If TRUE, include the fitted estimates in the parameter table.
Logical. If TRUE, include parameter labels in the parameter table.
Logical. If TRUE, return the parameter table as a data.frame.
An object of class lm
.
Logical. If TRUE, include a start column, based on the simple method for generating starting values.
A list containing parameter attributes.
A parameter table.
A parameter table.
Logical. If TRUE
, remove duplicated elements
when merging two parameter tables.
Logical. If TRUE
, duplicated elements are considered
from the bottom of the merged parameter table.
Logical. If codeTRUE, a warning is produced when duplicated elements are found, when merging two parameter tables.
# NOT RUN {
# generate syntax for an independence model
HS.model <- ' visual =~ x1 + x2 + x3
textual =~ x4 + x5 + x6
speed =~ x7 + x8 + x9 '
fit <- cfa(HS.model, data=HolzingerSwineford1939)
lav <- lav_partable_independence(fit)
as.data.frame(lav, stringsAsFactors = FALSE)
# how many free parameters?
lav_partable_npar(lav)
# how many sample statistics?
lav_partable_ndat(lav)
# }
Run the code above in your browser using DataLab