The following program shows how to display various fit measures for multiple models (i.e., when the Model method has been used more than once).
Imports System.Diagnostics
Module MainModule
' Npar Method Example 2
Sub Main()
Dim Sem As New AmosEngineLib.AmosEngine
Dim i As Integer
Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")
Sem.AStructure("visperc = (a) spatial + (1) err_v")
Sem.AStructure("cubes = (b) spatial + (1) err_c")
Sem.AStructure("lozenges = (c) spatial + (1) err_l")
Sem.AStructure("paragraph = (d) verbal + (1) err_p")
Sem.AStructure("sentence = (e) verbal + (1) err_s")
Sem.AStructure("wordmean = (f) verbal + (1) err_w")
Sem.Var("spatial", 1)
Sem.Var("verbal", 1)
Sem.Model("Congeneric")
Sem.Model("tau-equivalent", "a = b = c", "d = e = f")
For i = 1 To 2
Debug.WriteLine("")
Debug.WriteLine("Model number " & i)
Sem.FitModel(i)
Debug.WriteLine("Chi Square = " & Sem.Cmin)
Debug.WriteLine("Degrees of Freedom = " & Sem.df)
Debug.WriteLine("p = " & Sem.p)
Debug.WriteLine("Number of parameters = " & Sem.npar)
Debug.WriteLine("Noncentrality parameter = " & Sem.Ncp & " (" & Sem.NcpLo & _
", " & Sem.NcpHi & ")")
Debug.WriteLine("Rmsea = " & Sem.Rmsea & " (" & Sem.RmseaLo & ", " & Sem.RmseaHi & ")")
Debug.WriteLine("Test of close fit, p = " & Sem.Pclose)
Next
Sem.Dispose()
End Sub
End Module