The following program creates a 1-dimensional array of strings and displays it three times — as a row vector, as a column vector and as a lower triangular matrix. The program then fits the model of Example 4 and displays the ML chi square statistic and degrees of freedom. Finally, it displays the matrix of total effects and its transpose.
Imports AmosEngineLib
Imports AmosEngineLib.AmosEngine.TMatrixID
Module MainModule
Sub Main()
Dim Sem As New AmosEngine
Dim AM As New AmosMatrix
Dim AD As New AmosDebug.AmosDebug
AD.FieldWidth = 8
AD.PrintX("AmosDebug Demonstration")
Dim A() As String
ReDim A(5)
A(0) = "aa"
A(1) = "bb"
A(2) = "cc"
A(3) = "dd"
A(4) = "ee"
A(5) = "ff"
AD.PrintX(A, "PrintX Demonstration")
AD.PrintTranspose(A, "PrintTranspose Demonstration")
AD.PrintTriangle(A, "PrintTriangle Demonstration")
Dim Result As Integer
Sem.NeedEstimates(DirectEffects)
Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Warren5v")
Sem.AStructure("performance = knowledge + value + satisfaction + error (1)")
Result = Sem.FitModel
If Result = 0 Then
AD.PrintX(Sem.Cmin, "Chi square")
AD.PrintX("Degrees of freedom is " & Sem.df)
Sem.GetEstimatesEx(TotalEffects, AM)
AD.FieldWidth = 12
AD.PrintX(AM, "Total Effects")
AD.PrintTranspose(AM, "Total Effects Transposed")
Else
AD.PrintX("Minimization failed")
End If
Sem.Dispose()
End Sub
End Module