240
Example 15
Fitting Multiple Models
The following program (Ex15-all.vb) fits both models A and B.
Sub Main()
Dim Sem As New AmosEngine
Try
Sem.TextOutput()
Sem.Standardized()
Sem.Smc()
Sem.ModelMeansAndIntercepts()
Sem.BeginGroup(Sem.AmosDir & "Examples\Grnt_fem.sav")
Sem.GroupName("Girls")
Sem.AStructure("visperc = (int_vis) + (1) spatial + (1) err_v")
Sem.AStructure("cubes = (int_cub) + (cube_s) spatial + (1) err_c")
Sem.AStructure("lozenges = (int_loz) + (lozn_s) spatial + (1) err_l")
Sem.AStructure("paragrap = (int_par) + (1) verbal + (1) err_p")
Sem.AStructure("sentence = (int_sen) + (sent_v) verbal + (1) err_s")
Sem.AStructure("wordmean = (int_wrd) + (word_v) verbal + (1) err_w")
Sem.Mean("spatial", "mn_s")
Sem.Mean("verbal", "mn_v")
Sem.BeginGroup(Sem.AmosDir & "Examples\Grnt_mal.sav")
Sem.GroupName("Boys")
Sem.AStructure("visperc = (int_vis) + (1) spatial + (1) err_v")
Sem.AStructure("cubes = (int_cub) + (cube_s) spatial + (1) err_c")
Sem.AStructure("lozenges = (int_loz) + (lozn_s) spatial + (1) err_l")
Sem.AStructure("paragrap = (int_par) + (1) verbal + (1) err_p")
Sem.AStructure("sentence = (int_sen) + (sent_v) verbal + (1) err_s")
Sem.AStructure("wordmean = (int_wrd) + (word_v) verbal + (1) err_w")
Sem.Mean("spatial", "0")
Sem.Mean("verbal", "0")
Sem.Model("Model A") ' Sex difference in factor means.
Sem.Model("Model B", "mn_s=0", "mn_v=0") ' Equal factor means.
Sem.FitAllModels()
Finally
Sem.Dispose()
End Try
End Sub