126
Example 6
Fitting Multiple Models
To fit all three models, A, B, and C in a single analysis, start with the following
program, which assigns unique names to some parameters:
Since the parameter names are unique, naming the parameters does not constrain them.
However, naming the parameters does permit imposing constraints through the use of
the Model method. Adding the following lines to the program, in place of the
Sub Main()
Dim Sem As New AmosEngine
Try
Sem.TextOutput()
Sem.Standardized()
Sem.Smc()
Sem.AllImpliedMoments()
Sem.TotalEffects()
Sem.FactorScoreWeights()
Sem.Mods(4)
Sem.Crdiff()
Sem.BeginGroup(Sem.AmosDir & "Examples\Wheaton.sav")
Sem.AStructure("anomia67 <--- 67_alienation (1)")
Sem.AStructure("anomia67 <--- eps1 (1)")
Sem.AStructure("powles67 <--- 67_alienation (b_pow67)")
Sem.AStructure("powles67 <--- eps2 (1)")
Sem.AStructure("anomia71 <--- 71_alienation (1)")
Sem.AStructure("anomia71 <--- eps3 (1)")
Sem.AStructure("powles71 <--- 71_alienation (b_pow71)")
Sem.AStructure("powles71 <--- eps4 (1)")
Sem.AStructure("67_alienation <--- ses")
Sem.AStructure("67_alienation <--- zeta1 (1)")
Sem.AStructure("71_alienation <--- 67_alienation")
Sem.AStructure("71_alienation <--- ses")
Sem.AStructure("71_alienation <--- zeta2 (1)")
Sem.AStructure("educatio <--- ses (1)")
Sem.AStructure("educatio <--- delta1 (1)")
Sem.AStructure("SEI <--- ses")
Sem.AStructure("SEI <--- delta2 (1)")
Sem.AStructure("eps3 <--> eps1 (cov1)")
Sem.AStructure("eps1 (var_a67)")
Sem.AStructure("eps2 (var_p67)")
Sem.AStructure("eps3 (var_a71)")
Sem.AStructure("eps4 (var_p71)")
Sem.FitModel()
Finally
Sem.Dispose()
End Try
End Sub