The dedicated program editor software is included in the suite of AMOS programs when you install it on your computer. The program editor software allows you to fully code your model and request any analysis you need without using the AMOS graphics window. It has a slightly different coding structure from that of the previous example of conceptualizing a model through the Plugins function. This section is not going to be comprehensive in all the functions in the program editor.You could write another book just on understanding how to use all the functions possible in the program editor. I am going to give you some of the most basic functions to create and conceptualize models and also the ability to request different output options. If you would like more details on how to use syntax in AMOS, there are some great resources available (Arbuckle 2017).
When you open the program editor, the following window should appear.
Figure 10.62 Opening Window of AMOS Program Editor
Under the “Module MainModule”, you can type in a description of the model or descrip- tion of the data being analyzed. It is just an area to give you greater clarity on the model you are working on.You do need to start each sentence with an apostrophe to let AMOS know this is just a description. Under the “Public Sub Main()” area is where you will place your code to request a model along with the output of the analysis.
Before we start coding syntax into the window, we need to tell AMOS what format we are going to use to anlayze the conceptual model. On the first line after the “Sub Main”, you should enter:
Dim Sem as New AmosEngine
This will let us use the methods and properties of an object (denoted as Sem) to conceptualize a model. At the start, we also need to include the Try\Finally\Dispose\End Try function.This function allows us to use the AmosEngine in the analysis but will, in essence, release resources in order to run an analysis again. To use this function, we are going to put “Try” on the line right below Dim Sem as New AmosEngine, and then when we are finished coding the syntax for our conceptual model, we are going to include the following program lines:
After the initial “Try” program line, we will start asking AMOS for the ability to see the output of our analysis. Here are some of the most popular requests:
Once we have listed the output we want, the next lines of program code will denote the relationships in the model. Unlike the coding with the Plugins, we are not required to note which objects are observable or unobservable. If the coding can not find a specific name in the data file, the coding will treat it as an unobservable. Before noting the relationships, we need to tell AMOS where the data file is. This is accomplished through the Sem.BeginGroup function. AMOS wants to know how many groups you have in your model. If there is only one group, AMOS wants to know where the data file is.You need to save your data file in a direc- tory that AMOS can easily find. Here is the default location where AMOS will look:
C:\Users\username\Appdata\Local\AmosDevelopment\AMOS\VersionNumber(I am using 26)
Depending on how the program is installed, it might also be:
C:\Program Files\IBM\SPSS\AMOS\Version number (26)
I have saved my data in a folder called “AppliedSEM”, and the data within that folder is called “Delight”. To request that this data be used in the analysis, we need to use the following program statement:
Sem.BeginGroup(Sem.AmosDir & “AppliedSEM\Delight.sav”)
To specify a relationship in the program editor, we need to use the Sem.Astructure function. This function will initially need to know where a single headed arrow is pointing to and then where it came from along with whether a constraint is placed on the relationship. Let’s use the same CFA example we did in using the syntax function in the Plugins option. In that example, we have a three construct model of Adaptive Behavior, Customer Delight, and Positive Word of Mouth. Adaptive Behavior had five indicators, so let’s address that construct first.To model adapt1 as a reflective observable of the Adaptive Behavior construct (unobservable), we need to use the following code:
Sem.AStructure(“adapt1 = (1) Adaptive_Behavior + (1) e7)
In this program statement, adapt1 is where the arrow is pointing,Adaptive_Behavior construct is where the arrow is pointing from and you will notice at the front is a “(1)”, which means the relationship has a constraint of one. Lastly, you will see that an error term is included for the adapt1 variable.With the inclusion of the “+” symbol, you can add another relationship going to adapt1. Notice that the error term is constrained to 1 as well. Here is what the code would look like for all the constructs in the CFA.
Sem.AStructure(“adapt1 = (1) Adaptive_Behavior + (1) e7”)
Sem.AStructure(“adapt2 = Adaptive_Behavior + (1) e8”)
Sem.AStructure(“adapt3 = Adaptive_Behavior + (1) e9”)
Sem.AStructure(“adapt4 = Adaptive_Behavior + (1) e10”)
Sem.AStructure(“adapt5 = Adaptive_Behavior + (1) e11”)
Sem.AStructure(“delight1 = (1)Customer_Delight + (1) e1”)
Sem.AStructure(“delight2 = Customer_Delight + (1) e2”)
Sem.AStructure(“delight3 = Customer_Delight + (1) e3”)
Sem.AStructure(“WOM1 = (1)Word_of_Mouth + (1) e4”)
Sem.AStructure(“WOM2 = Word_of_Mouth + (1) e5”)
Sem.AStructure(“WOM3 = Word_of_Mouth + (1) e6”)
Once the relationships have been specified, we need to ask for model fit indices.This is usually done in the program statements after the relationships have been specified.To do this, we need to include the following line:
Note we did not request that covariances be included in the CFA analysis. All independ- ent variables should be covaried, and in a CFA all variables are considered independent. With the AmosEngine function in AMOS, it will automatically covary those relationships for you. Unlike AMOS graphics, you do not have to denote that a covariance needs to be added between constructs. Let’s take a look at what the final code should look like in Figure 10.63.
Figure 10.63 Program Editor Code for CFA Model
You need to make sure you save your file after you have finished coding.To run the analysis, you will need to hit the green arrow icon at the top of the screen.
If the analysis runs to completion, the text output should appear in a separate window.The text output will look exactly the same as it does using the graphics interface. See Figure 10.64.
Let’s now extend our example to a full structural model where Adaptive Behavior leads to Customer Delight which leads to Positive Word of Mouth. We need to include a path
Figure 10.64 Output for Program Editor
relationship from construct to construct. In the program editor, we can use the relationship code <–, that is, the less than symbol and two dashes, resembling an arrow. If we want to include a relationship path from Adaptive Behavior to Customer Delight, we will add the fol- lowing program line:
Sem.AStructure(“Customer_Delight <– Adaptive_Behavior”)
Next, let’s add the error terms for the unobservable dependent constructs. We can use this arrow symbol again to add error terms. Let’s say I want to add the error term for the Cus- tomer Delight construct, and I will call it e12. Here is the program code to add that error term:
Sem.AStructure(“Customer_Delight <– (1) e12”)
If we wanted to add a covariance, we could also use this arrow symbol. If I wanted to corre- late the error terms for e1 and e2, I would use the following symbol <–>.This will denote a covariance in AMOS. Here is the program code:
Sem.AStructure(“e1 <–> e2”)
See Figure 10.6 to view the complete code for the full structural model.
To use the program editor option, you have to pay attention to detail. A missed parenthesis or a misspelled word will create an error message, but this message does not give you a lot of information on why the program is not running the analysis. At times, it can be quite frustrat- ing, but this can be avoided by taking a methodical approach to writing your code and making sure each line is correct before moving on to the next one.
Figure 10.65 Program Editor Code for Full Structural Model
Source: Thakkar, J.J. (2020). “Procedural Steps in Structural Equation Modelling”. In: Structural Equation Modelling. Studies in Systems, Decision and Control, vol 285. Springer, Singapore.
29 Mar 2023
27 Mar 2023
28 Mar 2023
30 Mar 2023
29 Mar 2023
30 Mar 2023