Scripting with AMOS


New Member
Dear All,

I'm learning to use the programmatic approach to constructing and running models in AMOS. This is described in the "Using AMOS Graphics Without Drawing Path Diagrams" chapter of SPSS_AMOS user guide. I followed pretty much everything in this chapter and have been able to successfully run a test case (****I encountered a small problem, described at the end of this post****). I want to now extend this approach to run multiple models, each differing slightly in the attributes used, to find a suitable combination of attributes that give the model fit statistics in the desired range, i.e. a trial and error approach.

This is where I have a problem. I need some advice on how I can run multiple models in a loop with AMOS. Certainly, I do not want to write a long visual basic script with all possible combinations of attributes appearing one below the other. (Although, if I can find no other way, then I plan to generate a plugin using MATLAB or Fortran that will have all possible combination of my attributes printed one below the other)

The other problem I can foresee, if I was to use the above approach, is the dynamic file name allocation for each of the cases to be run. Is there a way to specify the filename in which AMOS puts the output for the required statistical parameters, coming from every attribute combination being tested?

**** Description of a problem mentioned earlier:****
For some reason, I got a System.Argument.Exception:The path is not a legal form. at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength)........ error, when trying to request the output. I get the path diagram on running the plugin, but could not obtain the values. I did find a workaround, in which, I have to use the "Write a Program" option from the Tools menu to get a VB script written with .SEM objects. Running this script gives me the required output. I wanted to know if there is a way of eliminating around this additional step.
**** ****

Eagerly waiting for a response.

Many Thanks,
Last edited: