Learn R Programming

sem (version 0.9-13)

specify.model: Specify a Structural Equation Model

Description

Create the RAM specification of a structural equation model.

Usage

specify.model(file = "")

## S3 method for class 'mod':
print(x, ...)

Arguments

file
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 "" (the default), then the specification is read from the standard input stream, and is term
x
An object of class mod to print, as produced by specify.model.
...
Ignored.

Value

  • An object of class mod, suitable as input for sem.

Details

Each line of the RAM specification consists of three (unquoted) entries, separated by commas: [object Object],[object Object],[object Object] Lines may end in a comment following #. See sem for further details on model specification.

See Also

sem

Examples

Run this code
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

Run the code above in your browser using DataLab