Learn R Programming

nlsem (version 0.8-1)

fill_model: Fills an empty structural equation model with parameters

Description

Creates a model of the same class as model and puts parameters where model has NA's.

Usage

fill_model(model, parameters)

Value

Gives back an object of class singleClass, semm, or nsemm.

Arguments

model

a model created by specify_sem or create_sem.

parameters

numeric vector with length of number of free parameters in model.
See count_free_parameters.

See Also

specify_sem, create_sem, count_free_parameters

Examples

Run this code
# specify model
model <- specify_sem(num.x = 4, num.y = 1, num.xi = 2, num.eta = 1, 
  xi = "x1-x2,x3-x4", eta = "y1", interaction = "eta1~xi1:xi2")
pars <- runif(count_free_parameters(model))
fill_model(model, parameters = pars)

Run the code above in your browser using DataLab