IBM SPSS Amos 21 Laptop User Manual


 
56
Example 2
This table gives a line-by-line explanation of the program:
Program Statement Explanation
Dim Sem As New AmosEngine
Declares Sem as an object of type
AmosEngine. The methods and
properties of the Sem object are used to
specify and fit the model.
Sem.TextOutput
Creates an output file containing the
results of the analysis. At the end of the
analysis, the contents of the output file
are displayed in a separate window.
Sem.Standardized()
Sem.ImpliedMoments()
Sem.SampleMoments()
Sem.ResidualMoments()
Displays standardized estimates, implied
covariances, sample covariances, and
residual covariances.
Sem.BeginGroup …
Begins the model specification for a
single group (that is, a single
population). This line also specifies that
the SPSS Statistics file Attg_yng.sav
contains the input data.
Sem.AmosDir()
is the location of the Amos program
directory.
Sem.AStructure("recall1 (v_recall)")
Sem.AStructure("recall2 (v_recall)")
Sem.AStructure("place1 (v_place)")
Sem.AStructure("place2 (v_place)")
Sem.AStructure("recall1 <> place1 (cov_rp)")
Sem.AStructure("recall2 <> place2 (cov_rp)")
Specifies the model. The first four
AStructure statements constrain the
variances of the observed variables
through the use of parameter names in
parentheses. Recall1 and recall2 are
required to have the same variance
because both variances are labeled
v_recall. The variances of place1 and
place2 are similarly constrained to be
equal. Each of the last two
AStructure
lines represents a covariance. The two
covariances are both named cov_rp.
Consequently, those covariances are
constrained to be equal.
Sem.FitModel()
Fits the model.
Sem.Dispose()
Releases resources used by the Sem
object. It is particularly important for
your program to use an AmosEngine
object’s
Dispose method before creating
another AmosEngine object. A process is
allowed to have only one instance of an
AmosEngine object at a time.
Try/Finally/End Try
This Try block guarantees that the
Dispose method will be called even if an
error occurs during program execution.