Learn R Programming

lavaan (version 0.5-17)

lav_partable: lavaan partable functions

Description

Utility functions related to the parameter table (partable)

Usage

# extract information from a parameter table
lav_partable_df(partable, group = NULL)
lav_partable_ndat(partable, group = NULL)
lav_partable_npar(partable)

# generate parameter table for specific models lav_partable_independence(lavobject = NULL, ov.names = NULL, ov = NULL, ov.names.x = NULL, sample.cov = NULL, meanstructure = FALSE, sample.mean = NULL, sample.th = NULL, parameterization = "delta", fixed.x = TRUE)

lav_partable_unrestricted(lavobject = NULL, ov.names = NULL, ov = NULL, ov.names.x = NULL, sample.cov = NULL, meanstructure = FALSE, sample.mean = NULL, sample.th = NULL, fixed.x = TRUE)

Arguments

partable
A parameter table. see lavParTable for more information.
group
Integer. If non-null, only consider this group.
lavobject
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.
ov.names
List of character vectors. Each list element contains the names of the observed variables for this group.
ov
Variable table. See varTable for more information.
ov.names.x
List of character vectors. Each list element contains the names of exogenous observed variables for this group.
sample.cov
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.
meanstructure
Logical. If TRUE, the means of the observed variables enter the model.
sample.mean
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.
sample.th
Optional list of numeric vectors. Each list element contains a vector of sample thresholds for this group. If provided, these values will be used as starting values.
parameterization
Currently only used if data is categorical. If "delta", the delta parameterization is used. If "theta", the theta parameterization is used.
fixed.x
If TRUE, the exogenous `x' covariates are considered fixed variables.

Examples

Run this code
# generate independence model for 3 variables with two groups
lav <- lav_partable_independence(ov.names = list( g1 = c("x1","x2","x3"),
                                                  g2 = c("x1","x2","x3") ))

# how many free parameters?
lav_partable_npar(lav)

# how many sample statistics?
lav_partable_ndat(lav)

# how many degrees of freedom?
lav_partable_df(lav)

Run the code above in your browser using DataLab