194
Example 11
Fitting Multiple Models
The following program fits both Models A and B. The program is saved in the file
Ex11-ab.vb.
Sub Main()
Dim Sem As New AmosEngine
Try
Sem.TextOutput()
Sem.BeginGroup(Sem.AmosDir & "Examples\Fels_fem.sav")
Sem.GroupName("girls")
Sem.AStructure("academic = (g1) GPA + (g2) attract + (1) error1")
Sem.AStructure("attract = " & _
"(g3) height + (g4) weight + (g5) rating + (g6) academic + (1) error2")
Sem.AStructure("error2 <--> error1")
Sem.BeginGroup(Sem.AmosDir & "Examples\Fels_mal.sav")
Sem.GroupName("boys")
Sem.AStructure("academic = (b1) GPA + (b2) attract + (1) error1")
Sem.AStructure("attract = " & _
"(b3) height + (b4) weight + (b5) rating + (b6) academic + (1) error2")
Sem.AStructure("error2 <--> error1")
Sem.Model("Model_A")
Sem.Model("Model_B", _
"g1=b1", "g2=b2", "g3=b3", "g4=b4", "g5=b5", "g6=b6")
Sem.FitAllModels()
Finally
Sem.Dispose()
End Try
End Sub