Specify a Structural Equation Model
Create the RAM specification of a structural equation model.
1 2 3 4
The (quoted) file from which to read the model specification,
including the path to the file if it is not in the current directory. If
An object of class
Each line of the RAM specification consists of three (unquoted) entries, separated by commas:
- 1. Arrow specification:
This is a simple formula, of the form
A -> Bor, equivalently,
B <- Afor a regression coefficient (i.e., a single-headed or directional arrow);
A <-> Afor a variance or
A <-> Bfor a covariance (i.e., a double-headed or bidirectional arrow). Here,
Bare variable names in the model. If a name does not correspond to an observed variable, then it is assumed to be a latent variable. Spaces can appear freely in an arrow specification, and there can be any number of hyphens in the arrows, including zero: Thus, e.g.,
A --> B, and
A>Bare all legitimate and equivalent.
- 2. Parameter name:
The name of the regression coefficient, variance, or covariance specified by the arrow. Assigning the same name to two or more arrows results in an equality constraint. Specifying the parameter name as
NAproduces a fixed parameter.
- 3. Value:
start value for a free parameter or value of a fixed parameter. If given as
semwill compute the start value.
Lines may end in a comment following
sem for further details on model specification.
An object of class
mod, suitable as input for
John Fox firstname.lastname@example.org
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
## Not run: model.dhp <- specify.model() RParAsp -> RGenAsp, gam11, NA RIQ -> RGenAsp, gam12, NA RSES -> RGenAsp, gam13, NA FSES -> RGenAsp, gam14, NA RSES -> FGenAsp, gam23, NA FSES -> FGenAsp, gam24, NA FIQ -> FGenAsp, gam25, NA FParAsp -> FGenAsp, gam26, NA FGenAsp -> RGenAsp, beta12, NA RGenAsp -> FGenAsp, beta21, NA RGenAsp -> ROccAsp, NA, 1 RGenAsp -> REdAsp, lam21, NA FGenAsp -> FOccAsp, NA, 1 FGenAsp -> FEdAsp, lam42, NA RGenAsp <-> RGenAsp, ps11, NA FGenAsp <-> FGenAsp, ps22, NA RGenAsp <-> FGenAsp, ps12, NA ROccAsp <-> ROccAsp, theta1, NA REdAsp <-> REdAsp, theta2, NA FOccAsp <-> FOccAsp, theta3, NA FEdAsp <-> FEdAsp, theta4, NA model.dhp ## End(Not run)