Please enable JavaScript to view this site.

IBM® SPSS® Amos™ 28

Navigation: Programming with Amos > Class Reference > AmosDebug Class Reference > Methods > PrintX Method

PrintX, PrintTranspose, PrintTriangle Methods Example

Scroll Prev Top Next More

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

© 2021 Amos Development Corporation