136
Example 7
Modeling in VB.NET
The following program fits the model of this example. It is saved in the file Ex07.vb.
The final
AStructure line is essential to Felson and Bohrnstedt’s model. Without it,
Amos would assume that error1 and error2 are uncorrelated.
You can specify the same model in an equation-like format as follows:
Sub Main()
Dim Sem As New AmosEngine
Try
Sem.TextOutput()
Sem.Standardized()
Sem.Smc()
Sem.BeginGroup(Sem.AmosDir & "Examples\Fels_fem.sav")
Sem.AStructure("academic <--- GPA")
Sem.AStructure("academic <--- attract")
Sem.AStructure("academic <--- error1 (1)")
Sem.AStructure("attract <--- height")
Sem.AStructure("attract <--- weight")
Sem.AStructure("attract <--- rating")
Sem.AStructure("attract <--- academic")
Sem.AStructure("attract <--- error2 (1)")
Sem.AStructure("error2 <--> error1")
Sem.FitModel()
Finally
Sem.Dispose()
End Try
End Sub
Sub Main()
Dim Sem As New AmosEngine
Try
Sem.TextOutput()
Sem.Standardized()
Sem.Smc()
Sem.BeginGroup(Sem.AmosDir & "Examples\Fels_fem.sav")
Sem.AStructure("academic = GPA + attract + error1 (1)")
Sem.AStructure("attract = height + weight + rating + " _
& "academic + error2 (1)")
Sem.AStructure("error2 <--> error1")
Sem.FitModel()
Finally
Sem.Dispose()
End Try
End Sub