IBM SPSS Amos 21 Laptop User Manual


 
588
Example 37
Other Aspects of the Analysis in Addition to Model
Specification
In Example 8, the data file Grnt_fem.sav was specified interactively (by choosing
File > Data Files on the menus). You can do the same thing here as well. As an
alternative, you can specify the Grnt_fem.sav data file within the plugin by adding the
following lines to the Mainsub function:
pd.SetDataFile(1, MiscAmosTypes.cDatabaseFormat.mmSPSS, _
"C:\Program Files\IBM\SPSS\Amos\21\Examples\English\grnt_fem.sav", "", "", "")
Similarly, in Example 8, standardized estimates were requested interactively (by
choosing View > Analysis Properties on the menus). As an alternative to requesting
standardized estimates interactively, you can request them within a plugin by adding
the following line to the Mainsub function:
pd.GetCheckBox("AnalysisPropertiesForm", "StandardizedCheck").Checked = True
Generally, any aspect of an analysis that can be specified interactively can be specified
within a plugin by using the methods and properties of the pd class.
Defining Program Variables that Correspond to Model Variables
There are five pd methods that create an object in a path diagram: Observed,
Unobserved, Path, Cov and Caption. Each of these methods returns a reference to the
object that it creates. For example, the Observed method creates an observed variable
in the path diagram and also returns a reference to that observed variable. Instead of
writing the lines
pd.Observed("wordmean")
pd.Unobserved("verbal")
to create an observed variable called wordmean and an unobserved variable called
verbal, you can write the following lines (in Visual Basic):
Dim wordmean As PDElement = pd.Observed("wordmean")
Dim verbal As PDElement = pd.Unobserved("verbal")