IBM SPSS Amos 21 Laptop User Manual


 
238
Example 15
Modeling in VB.NET
Model A
The following program fits Model A. It is saved as Ex15-a.vb.
The
AStructure method is called once for each endogenous variable. The Mean method
in the girls’ group is used to specify that the means of the verbal ability and spatial
ability factors are freely estimated. The program also uses the
Mean method to specify
that verbal ability and spatial ability have zero means in the boys’ group. Actually,
Amos assumes zero means by default, so the use of the
Mean method for the boys is
unnecessary.
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.FitModel()
Finally
Sem.Dispose()
End Try
End Sub