# Programming with Amos (part 2)

*Part of the IBM SPSS Amos online Help, rendered for AI use. See `llms.txt` for the index.*

<a id="t_getestimatesmethodexample"></a>
###### GetEstimates Method Example

The following program fits Models A and B of Example 11. It displays the matrix of total effects for each group and model.

Imports System.Diagnostics Imports AmosEngineLib.AmosEngine.TMatrixID Imports Microsoft.VisualBasic Module MainModule  ' GetEstimates Method Example  Sub Main()  Dim CNames() As String, RNames() As String, X(,) As Double  Dim Sem As New AmosEngineLib.AmosEngine   Sem.NeedEstimates(TotalEffects)   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Fels_fem")  Sem.GroupName("girls")  Sem.AStructure("academic = (g1) GPA + (g2) attract + (1) e1")  Sem.AStructure( "attract = (g3) height + (g4) weight + (g5) rating + (g6) academic + (1) e2")  Sem.AStructure("e2 <--> e1")   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Fels_mal")  Sem.GroupName("boys")  Sem.AStructure("academic = (b1) GPA + (b2) attract + (1) e1")  Sem.AStructure( "attract = (b3) height + (b4) weight + (b5) rating + (b6) academic + (1) e2 ")  Sem.AStructure("e2 <--> e1")   Sem.Model("Model_A")  Sem.Model("Model_B", "g1=b1", "g2=b2", "g3=b3", "g4=b4", "g5=b5", "g6=b6")   'Print implied covariances for each model and each group  Dim ModelNumber As Integer  Dim GroupNumber As Integer  For ModelNumber = 1 To 2  Sem.FitModel(ModelNumber)  For GroupNumber = 1 To 2   Sem.GetEstimates(TotalEffects, X, GroupNumber)   Sem.ColumnNames(TotalEffects, CNames, GroupNumber)  Sem.RowNames(TotalEffects, RNames, GroupNumber)  Debug.WriteLine(vbCrLf & "Group " & GroupNumber & ", Model " & ModelNumber)  PrintMatrix(X, CNames, RNames)  Next  Next   Sem.Dispose()  End Sub  'Print a matrix in the debug window  Sub PrintMatrix(ByVal TheMatrix(,) As Double, ByVal CNames$(), ByVal RNames$())  Dim NRows1 As Integer, NColumns1 As Integer  Dim i As Integer, j As Integer  NRows1 = UBound(RNames)  NColumns1 = UBound(CNames)   Debug.Write(" ")  For j = 0 To NColumns1  Debug.Write(CNames(j).PadLeft(10))  Next  Debug.WriteLine("")   For i = 0 To NRows1  Debug.Write(RNames(i).PadRight(8))  For j = 0 To NColumns1  Debug.Write(TheMatrix(i, j).ToString(".00000").PadLeft(10))  Next  Debug.WriteLine("")  Next  End Sub End Module

<a id="t_getestimatesexmethod"></a>
###### GetEstimatesEx Method

*Help context ID: 5151*

Gets a matrix of estimates.

Syntax

*object*.**GetEstimatesEx** (*matrixID*, *theMatrix*)

*object*.**GetEstimatesEx** (*matrixID*, *theMatrix*, *groupNumber*)

The **GetEstimatesEx** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *matrixID* | An integer that specifies a matrix of estimates, as described in Settings. |
| *theMatrix* | An object of type [AmosMatrix](#t_1853). On return from **GetEstimatesEx** *theMatrix* contains the estimate of the matrix specified by *matrixID*. |
| *groupNumber* | Optional integer specifying a group number. The first group is group number 1. If *groupNumber* is omitted, the first group is used. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [3].

**Settings**

The settings for *matrixID* are:


| Constant | Value | Description |
| --- | --- | --- |
| SampleCovariances | 13 | Sample covariances. |
| SampleCorrelations | 14 | Sample correlations. |
| SampleMeans | 15 | Sample means. |
| ImpliedCovariances | 10 | The implied covariances among the observed variables in the model. |
| ImpliedCorrelations | 11 | The implied correlations among the observed variables in the model. |
| ImpliedMeans | 12 | The implied means of the observed variables in the model. |
| AllImpliedCovariances | 7 | The implied covariances among all variables in the model, with the exception of residual variables. |
| AllImpliedCorrelations | 8 | The implied correlations among all variables in the model, with the exception of residual variables. |
| AllImpliedMeans | 9 | The implied means of all variables in the model, with the exception of residual variables. |
| DirectEffects | 19 | Direct effects. |
| IndirectEffects | 20 | Indirect effects. |
| TotalEffects | 5 | Total effects. |
| StandardizedDirectEffects | 22 | Standardized direct effects. |
| StandardizedIndirectEffects | 23 | Standardized indirect effects. |
| StandardizedTotalEffects | 21 | Standardized total effects. |
| FactorScoreWeights | 6 | Factor score weights. |

Remarks

You have to use [NeedEstimates](#t_needestimatesmethod) to declare that estimates of a matrix will be needed before you can use **GetEstimatesEx** to obtain the estimates. For example, you have to use

*object*.[NeedEstimates](#t_needestimatesmethod) (StandardizedTotalEffects)

before using

*object*.**GetEstimatesEx** (StandardizedTotalEffects, …)

GetEstimatesEx differs from [GetEstimates](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_getestimatesmethod) in the following way. GetEstimatesEx assigns values to the members of an [AmosMatrix](#t_1853) object, which contains the matrix of estimates as well as the variable names and variable numbers associated with the matrix's rows and columns. [GetEstimates](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_getestimatesmethod), by contrast, merely sets a double array equal to the matrix of estimates. Additional calls to [RowNames](#t_rownamesmethod), [RowNumbers](#t_rownumbersmethod), [ColumnNames](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_columnnamesmethod) and [ColumnNumbers](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_columnnumbersmethod) are necessary if there is a need for the variable names and variable numbers associated with the matrix's rows and columns.

**GetEstimatesEx** is often more convenient, but [GetEstimates](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_getestimatesmethod) is faster.

See Also

[GetEstimates Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_getestimatesmethod)

[GetStandardErrors Method](#t_getstandarderrorsmethod)

[NeedEstimates Method](#t_needestimatesmethod)

<a id="t_getestimatesexmethodexample"></a>
###### GetEstimatesEx Method Example

The following program fits Models A and B of Example 11. It displays the matrix of total effects for each group and model.

Imports AmosEngineLib.AmosEngine.TMatrixID Module MainModule  ' GetEstimatesEx Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine  Dim am As New AmosEngineLib.AmosMatrix  Dim ad As New AmosDebug.AmosDebug  ad.DecimalPlaces = 4   Sem.NeedEstimates(TotalEffects)   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Fels_fem")  Sem.GroupName("girls")  Sem.AStructure("academic = (g1) GPA + (g2) attract + (1) e1")  Sem.AStructure("attract = (g3) height + (g4) weight + (g5) rating + (g6) academic + (1) e2")  Sem.AStructure("e2 <--> e1")   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Fels_mal")  Sem.GroupName("boys")  Sem.AStructure("academic = (b1) GPA + (b2) attract + (1) e1")  Sem.AStructure("attract = (b3) height + (b4) weight + (b5) rating + (b6) academic + (1) e2")  Sem.AStructure("e2 <--> e1")   Sem.Model("Model_A")  Sem.Model("Model_B", "g1=b1", "g2=b2", "g3=b3", "g4=b4", "g5=b5", "g6=b6")   'Print implied covariances for each model and each group  Dim ModelNumber As Integer, GroupNumber As Integer  For ModelNumber = 1 To 2  Sem.FitModel(ModelNumber)  For GroupNumber = 1 To 2  Sem.GetEstimatesEx(TotalEffects, am, GroupNumber)  ad.PrintX(am, "Model " & ModelNumber & ", Group " & GroupNumber)  Next  Next   Sem.Dispose()  End Sub End Module

<a id="t_getgroupnamemethod"></a>
###### GetGroupName Method

*Help context ID: 5176*

Gets the name of a group.

Syntax

*object*.**GetGroupName** ()

*object*.**GetGroupName** (*groupNumber*)

The **GetGroupName** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *groupNumber* | Optional group number. The first group is group number 1. If *groupNumber* is omitted, the first group is used. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [2] [3].

<a id="t_getgroupnamemethodexample"></a>
###### GetGroupName Method Example

In the following program, the **GetGroupName** method is used to display the group names in a two-group analysis.

Imports System.Diagnostics Module MainModule  ' GetGroupName Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine   Sem.TextOutput()   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\Fels_fem.sav")  Sem.GroupName("girls")  Sem.AStructure("academic = GPA + attract + error1 (1)")  Sem.AStructure("attract = height + weight + rating + academic + error2 (1)")  Sem.AStructure("error2 <--> error1")   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\Fels_mal.sav")  Sem.GroupName("boys")  Sem.AStructure("academic = GPA + attract + error1 (1)")  Sem.AStructure("attract = height + weight + rating + academic + error2 (1)")  Sem.AStructure("error2 <--> error1")   Dim i As Integer  For i = 1 To Sem.NumberOfGroups  Debug.WriteLine("Group " & i & " is called " & Sem.GetGroupName(i))  Next   Sem.Dispose()  End Sub End Module

<a id="t_getpclowerboundsgetpcupperboundsmethods"></a>
###### GetPCLowerBounds, GetPCUpperBounds Methods

*Help context ID: 5046*

Gets the lower and upper bounds of the bootstrap confidence intervals for the elements of a matrix of estimates, using the percentile method.

Syntax

*object*.**GetPCLowerBounds** (*matrixID*, *theMatrixBase0*)

*object*.**GetPCLowerBounds** (*matrixID*, *theMatrixBase0*, *groupNumber*)

*object*.**GetPCUpperBounds** (*matrixID*, *theMatrixBase0*)

*object*.**GetPCUpperBounds** (*matrixID*, *theMatrixBase0*, *groupNumber*)

The **GetPCLowerBounds** and **GetPCLowerBounds** method syntaxes have the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *matrixID* | An integer that specifies a matrix of estimates, as described in Settings. |
| *theMatrixBase0* | A double precision array, dimensioned in the calling routine as **Dim theMatrixBase0() As Double** or as **Dim theMatrixBase0(,) As Double** On return from **GetPCLowerBounds** each element of *theMatrixBase0* contains the lower bound on the confidence interval for the corresponding element of the matrix of estimates specified by *matrixID*. On return from **GetPCUpperbounds**, *theMatrixBase0* contains upper bounds. |
| *groupNumber* | Optional. A group number. The first group is group number 1. If *groupNumber* is omitted, the first group is used. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [3].

**Settings**

The settings for *matrixID* are:


| Constant | Value | Description |
| --- | --- | --- |
| SampleCovariances | 13 | Sample covariances. |
| SampleCorrelations | 14 | Sample correlations. |
| SampleMeans | 15 | Sample means. |
| ImpliedCovariances | 10 | The implied covariances among the observed variables in the model. |
| ImpliedCorrelations | 11 | The implied correlations among the observed variables in the model. |
| ImpliedMeans | 12 | The implied means of the observed variables in the model. |
| AllImpliedCovariances | 7 | The implied covariances among all variables in the model, with the exception of residual variables. |
| AllImpliedCorrelations | 8 | The implied correlations among all variables in the model, with the exception of residual variables. |
| AllImpliedMeans | 9 | The implied means of all variables in the model, with the exception of residual variables. |
| DirectEffects | 19 | Direct effects. |
| IndirectEffects | 20 | Indirect effects. |
| TotalEffects | 5 | Total effects. |
| StandardizedDirectEffects | 22 | Standardized direct effects. |
| StandardizedIndirectEffects | 23 | Standardized indirect effects. |
| StandardizedTotalEffects | 21 | Standardized total effects. |
| FactorScoreWeights | 6 | Factor score weights. |

Remarks

In order to use **GetPCLowerBounds** (*matrixID*), you must first use [NeedPCLowerBounds](#t_needpclowerboundsneedpcupperboundsmethods) (*matrixID*). For example, you have to use

*object*.[NeedPCLowerBounds](#t_needpclowerboundsneedpcupperboundsmethods) (FactorScoreWeights)

before using

*object*.**GetPCLowerBounds** (FactorScoreWeights, …)

Similarly, in order to use **GetPCUpperBounds** (*matrixID*), you must first use [NeedPCUpperBounds](#t_needpclowerboundsneedpcupperboundsmethods) (*matrixID*). For example, you have to use

*object*.[NeedPCUpperBounds](#t_needpclowerboundsneedpcupperboundsmethods) (FactorScoreWeights)

before using

*object*.**GetPCUpperBounds** (FactorScoreWeights, …)

[Bootstrap](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_bootstrapmethod) can be used to specify the number of bootstrap samples. By default, 1000 bootstrap samples will be generated.

[ConfidencePC](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_confidencepcmethod) can be used to specify the confidence level. By default, 90% confidence intervals will be estimated.

<a id="t_getpclowerboundsgetpcupperboundsmethodsexample"></a>
###### GetPCLowerBounds, GetPCUpperBounds Methods Example

This example demonstrates the **GetPCLowerBounds** and **GetPCUpperBounds** methods.

Imports System.Diagnostics Imports AmosEngineLib.AmosEngine.TMatrixID Imports Microsoft.VisualBasic Module MainModule  ' GetPCLowerBounds, GetPCUpperBounds Methods Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine  Sem.Bootstrap(2000)  Sem.ConfidencePC(90) '90% confidence intervals   Sem.NeedPCLowerBounds(FactorScoreWeights)  Sem.NeedPCUpperBounds(FactorScoreWeights)   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   Dim X(,) As Double  Dim RNames() As String  Dim CNames() As String   'Get the row and column variable names  Sem.RowNames(FactorScoreWeights, RNames)  Sem.ColumnNames(FactorScoreWeights, CNames)   'Print the lower bounds  Sem.GetPCLowerBounds(FactorScoreWeights, X)  Debug.WriteLine(vbCrLf & "Confidence intervals on factor score weights -- lower bound")  PrintMatrix(X, CNames, RNames)   'Print the upper bounds  Sem.GetPCUpperBounds(FactorScoreWeights, X)  Debug.WriteLine(vbCrLf & "Confidence intervals on factor score weights -- upper bound")  PrintMatrix(X, CNames, RNames)   Sem.Dispose()  End Sub   'Print a matrix in the debug window  Sub PrintMatrix(ByVal TheMatrix(,) As Double, ByVal CNames$(), ByVal RNames$())  Dim NRows1 As Integer, NColumns1 As Integer  Dim i As Integer, j As Integer  NRows1 = UBound(RNames)  NColumns1 = UBound(CNames)   Debug.Write(" ")  For j = 0 To NColumns1  Debug.Write(CNames(j).PadLeft(10))  Next   Debug.WriteLine("")  For i = 0 To NRows1  Debug.Write(RNames(i).PadRight(8))  For j = 0 To NColumns1  Debug.Write(TheMatrix(i, j).ToString(".00000").PadLeft(10))  Next  Debug.WriteLine("")  Next  End Sub End Module

<a id="t_getpclowerboundsexgetpcupperboundsexmethods"></a>
###### GetPCLowerBoundsEx, GetPCUpperBoundsEx Methods

*Help context ID: 5152*

Gets the lower and upper bounds of bootstrap confidence intervals for the elements of a matrix of estimates, using the percentile method.

Syntax

*object*.**GetPCLowerBoundsEx** (*matrixID*, *am*)

*object*.**GetPCLowerBoundsEx** (*matrixID*, *am*, *groupNumber*)

*object*.**GetPCUpperBoundsEx** (*matrixID*, *am*)

*object*.**GetPCUpperBoundsEx** (*matrixID*, *am*, *groupNumber*)

The **GetPCLowerBoundsEx** and **GetPCLowerBoundsEx** method syntaxes have the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *matrixID* | An integer that specifies a matrix of estimates, as described in Settings. |
| *am* | An object of type [AmosMatrix](#t_1853). On return from **GetPCLowerBoundsEx** *am* contains lower bounds on confidence intervals for the estimates specified by *matrixID*. On return from **GetPCUpperBoundsEx**, *am* contains upper bounds. |
| *groupNumber* | Optional. A group number. The first group is group number 1. If *groupNumber* is omitted, the first group is used. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [3].

**Settings**

The settings for *matrixID* are:


| Constant | Value | Description |
| --- | --- | --- |
| SampleCovariances | 13 | Sample covariances. |
| SampleCorrelations | 14 | Sample correlations. |
| SampleMeans | 15 | Sample means. |
| ImpliedCovariances | 10 | The implied covariances among the observed variables in the model. |
| ImpliedCorrelations | 11 | The implied correlations among the observed variables in the model. |
| ImpliedMeans | 12 | The implied means of the observed variables in the model. |
| AllImpliedCovariances | 7 | The implied covariances among all variables in the model, with the exception of residual variables. |
| AllImpliedCorrelations | 8 | The implied correlations among all variables in the model, with the exception of residual variables. |
| AllImpliedMeans | 9 | The implied means of all variables in the model, with the exception of residual variables. |
| DirectEffects | 19 | Direct effects. |
| IndirectEffects | 20 | Indirect effects. |
| TotalEffects | 5 | Total effects. |
| StandardizedDirectEffects | 22 | Standardized direct effects. |
| StandardizedIndirectEffects | 23 | Standardized indirect effects. |
| StandardizedTotalEffects | 21 | Standardized total effects. |
| FactorScoreWeights | 6 | Factor score weights. |

Remarks

In order to use **GetPCLowerBoundsEx** (*matrixID*), you must first use [NeedPCLowerBounds](#t_needpclowerboundsneedpcupperboundsmethods) (*matrixID*). For example, you have to use

*object*.[NeedPCLowerBounds](#t_needpclowerboundsneedpcupperboundsmethods) (FactorScoreWeights)

before using

*object*.**GetPCLowerBoundsEx** (FactorScoreWeights, …)

Similarly, in order to use **GetPCUpperBoundsEx** (*matrixID*), you must first use [NeedPCUpperBounds](#t_needpclowerboundsneedpcupperboundsmethods) (*matrixID*). For example, you have to use

*object*.[NeedPCUpperBounds](#t_needpclowerboundsneedpcupperboundsmethods) (FactorScoreWeights)

before using

*object*.**GetPCUpperBoundsEx** (FactorScoreWeights, …)

[Bootstrap](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_bootstrapmethod) can be used to specify the number of bootstrap samples. By default, 1000 bootstrap samples are generated.

[ConfidencePC](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_confidencepcmethod) can be used to specify the confidence level. By default, 90% confidence intervals are estimated.

**GetPCLowerBoundsEx** and **GetPCUpperBoundsEx** differ from [GetPCLowerBounds](#t_getpclowerboundsgetpcupperboundsmethods) and [GetPCUpperBounds](#t_getpclowerboundsgetpcupperboundsmethods) in the following way. **GetPCLowerBoundsEx** and **GetPCUpperBoundsEx** assign values to the members of an [AmosMatrix](#t_1853) object, which contains the matrix of lower bounds (or upper bounds) as well as the variable names and variable numbers associated with the matrix's rows and columns. [GetPCLowerBounds](#t_getpclowerboundsgetpcupperboundsmethods) and [GetPCUpperBounds](#t_getpclowerboundsgetpcupperboundsmethods) , by contrast, merely set a double array equal to the matrix of lower bounds (or upper bounds). Additional calls to [RowNames](#t_rownamesmethod), [RowNumbers](#t_rownumbersmethod), [ColumnNames](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_columnnamesmethod) and [ColumnNumbers](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_columnnumbersmethod) are necessary if there is a need for the variable names and variable numbers associated with the matrix's rows and columns.

**GetPCLowerBoundsEx** and **GetPCUpperBoundsEx** are often more convenient, but [GetPCLowerBounds](#t_getpclowerboundsgetpcupperboundsmethods) and [GetPCUpperBounds](#t_getpclowerboundsgetpcupperboundsmethods) are faster.

<a id="t_getpclowerboundsexgetpcupperboundsexmethodsexample"></a>
###### GetPCLowerBoundsEx, GetPCUpperBoundsEx Methods Example

This example demonstrates the **GetPCLowerBoundsEx** and **GetPCUpperBoundsEx** methods.

Imports AmosEngineLib.AmosEngine.TMatrixID Module MainModule  ' GetPCLowerBoundsEx, GetPCUpperBoundsEx Methods Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine   Sem.Bootstrap(2000)  Sem.ConfidencePC(90) '90% confidence intervals   Sem.NeedPCLowerBounds(FactorScoreWeights)  Sem.NeedPCUpperBounds(FactorScoreWeights)   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   Dim am As New AmosEngineLib.AmosMatrix  Dim ad As New AmosDebug.AmosDebug   Sem.GetPCLowerBoundsEx(FactorScoreWeights, am)  ad.PrintX(am, "Confidence intervals on factor score weights -- lower bounds")   Sem.GetPCUpperBoundsEx(FactorScoreWeights, am)  ad.PrintX(am, "Confidence intervals on factor score weights -- upper bounds" )  Sem.Dispose()  End Sub End Module

<a id="t_getstandarderrorsmethod"></a>
###### GetStandardErrors Method

*Help context ID: 5048*

Gets bootstrap standard errors for the elements of a matrix of estimates.

Syntax

*object*.**GetStandardErrors** (*matrixID*, *theMatrixBase0*)

*object*.**GetStandardErrors** (*matrixID*, *theMatrixBase0*, *groupNumber*)

The **GetStandardErrors** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *matrixID* | An integer that specifies a matrix of estimates, as described in Settings. |
| *theMatrixBase0* | A double precision array, dimensioned in the calling routine as **Dim theMatrixBase0() As Double** or as **Dim theMatrixBase0(,) As Double** On return from **GetStandardErrors** *theMatrixBase0* contains bootstrap standard errors for the elements of the matrix of estimates specified by *matrixID*. |
| *groupNumber* | Optional. A group number. The first group is group number 1. If *groupNumber* is omitted, the first group is used. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [3].

**Settings**

The settings for *matrixID* are:


| Constant | Value | Description |
| --- | --- | --- |
| SampleCovariances | 13 | Sample covariances. |
| SampleCorrelations | 14 | Sample correlations. |
| SampleMeans | 15 | Sample means. |
| ImpliedCovariances | 10 | The implied covariances among the observed variables in the model. |
| ImpliedCorrelations | 11 | The implied correlations among the observed variables in the model. |
| ImpliedMeans | 12 | The implied means of the observed variables in the model. |
| AllImpliedCovariances | 7 | The implied covariances among all variables in the model, with the exception of residual variables. |
| AllImpliedCorrelations | 8 | The implied correlations among all variables in the model, with the exception of residual variables. |
| AllImpliedMeans | 9 | The implied means of all variables in the model, with the exception of residual variables. |
| DirectEffects | 19 | Direct effects. |
| IndirectEffects | 20 | Indirect effects. |
| TotalEffects | 5 | Total effects. |
| StandardizedDirectEffects | 22 | Standardized direct effects. |
| StandardizedIndirectEffects | 23 | Standardized indirect effects. |
| StandardizedTotalEffects | 21 | Standardized total effects. |
| FactorScoreWeights | 6 | Factor score weights. |

Remarks

You have to use [NeedStandardErrors](#t_needstandarderrorsmethod) to declare that standard errors for a matrix will be needed before you can use **GetStandardErrors** to obtain the standard errors. For example, you have to use

*object*.[NeedStandardErrors](#t_needstandarderrorsmethod) (StandardizedTotalEffects)

before using

*object*.**GetStandardErrors** (StandardizedTotalEffects)

See Also

[Bootstrap Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_bootstrapmethod)

[GetEstimates Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_getestimatesmethod)

[GetStandardErrorsEx Method](#t_getstandarderrorsexmethod)

[NeedStandardErrors Method](#t_needstandarderrorsmethod)

<a id="t_getstandarderrorsmethodexample"></a>
###### GetStandardErrors Method Example

This example demonstrates the **GetStandardErrors** method.

Imports System.Diagnostics Imports AmosEngineLib.AmosEngine.TMatrixID Imports Microsoft.VisualBasic Module MainModule  ' GetStandardErrors Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine   Sem.NeedStandardErrors(FactorScoreWeights)   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   Dim X(,) As Double  Dim RNames() As String  Dim CNames() As String   'Get the row and column variable names  Sem.RowNames(FactorScoreWeights, RNames)  Sem.ColumnNames(FactorScoreWeights, CNames)   'Print the standard errors  Sem.GetStandardErrors(FactorScoreWeights, X)  Debug.WriteLine(vbCrLf & "Standard errors for factor score weights")  PrintMatrix(X, CNames, RNames)   Sem.Dispose()  End Sub   'Print a matrix in the debug window  Sub PrintMatrix(ByVal TheMatrix(,) As Double, ByVal CNames$(), ByVal RNames$())  Dim NRows1 As Integer, NColumns1 As Integer  Dim i As Integer, j As Integer  NRows1 = UBound(RNames)  NColumns1 = UBound(CNames)   Debug.Write(" ")  For j = 0 To NColumns1  Debug.Write(CNames(j).PadLeft(10))  Next   Debug.WriteLine("")  For i = 0 To NRows1  Debug.Write(RNames(i).PadRight(8))  For j = 0 To NColumns1  Debug.Write(TheMatrix(i, j).ToString(".00000").PadLeft(10))  Next  Debug.WriteLine("")  Next  End Sub End Module

<a id="t_getstandarderrorsexmethod"></a>
###### GetStandardErrorsEx Method

*Help context ID: 5153*

Gets bootstrap standard errors for the elements of a matrix of estimates.

Syntax

*object*.**GetStandardErrorsEx** (*matrixID*, *am*, *groupNumber*)

The **GetStandardErrorsEx** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *matrixID* | An integer that specifies a matrix of estimates, as described in Settings. |
| *am* | An object of type [AmosMatrix](#t_1853). On return from **GetStandardErrorsEx**, *am* contains bootstrap standard errors for the elements of the matrix of estimates specified by *matrixID*. |
| *groupNumber* | Optional. A group number. The first group is group number 1. If *groupNumber* is omitted, the first group is used. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [3].

**Settings**

The settings for *matrixID* are:


| Constant | Value | Description |
| --- | --- | --- |
| SampleCovariances | 13 | Sample covariances. |
| SampleCorrelations | 14 | Sample correlations. |
| SampleMeans | 15 | Sample means. |
| ImpliedCovariances | 10 | The implied covariances among the observed variables in the model. |
| ImpliedCorrelations | 11 | The implied correlations among the observed variables in the model. |
| ImpliedMeans | 12 | The implied means of the observed variables in the model. |
| AllImpliedCovariances | 7 | The implied covariances among all variables in the model, with the exception of residual variables. |
| AllImpliedCorrelations | 8 | The implied correlations among all variables in the model, with the exception of residual variables. |
| AllImpliedMeans | 9 | The implied means of all variables in the model, with the exception of residual variables. |
| DirectEffects | 19 | Direct effects. |
| IndirectEffects | 20 | Indirect effects. |
| TotalEffects | 5 | Total effects. |
| StandardizedDirectEffects | 22 | Standardized direct effects. |
| StandardizedIndirectEffects | 23 | Standardized indirect effects. |
| StandardizedTotalEffects | 21 | Standardized total effects. |
| FactorScoreWeights | 6 | Factor score weights. |

Remarks

You have to use [NeedStandardErrors](#t_needstandarderrorsmethod) to declare that standard errors for a matrix will be needed before you can use **GetStandardErrorsEx** to obtain the standard errors. For example, you have to use

*object*.[NeedStandardErrors](#t_needstandarderrorsmethod) (StandardizedTotalEffects)

before using

*object*.**GetStandardErrorsEx** (StandardizedTotalEffects, …)

GetStandardErrorsEx differs from [GetStandardErrors](#t_getstandarderrorsmethod) in the following way. GetStandardErrorsEx assigns values to the members of an [AmosMatrix](#t_1853) object, which contains the matrix of standard errors as well as the variable names and variable numbers associated with the matrix's rows and columns. [GetStandardErrors](#t_getstandarderrorsmethod) , by contrast, merely sets a double array equal to the matrix of standard errors. Additional calls to [RowNames](#t_rownamesmethod), [RowNumbers](#t_rownumbersmethod), [ColumnNames](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_columnnamesmethod) and [ColumnNumbers](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_columnnumbersmethod) are necessary if there is a need for the variable names and variable numbers associated with the matrix's rows and columns.

**GetStandardErrorsEx** is often more convenient, but [GetStandardErrors](#t_getstandarderrorsmethod) is faster.

See Also

[Bootstrap Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_bootstrapmethod)

[GetEstimates Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_getestimatesmethod)

[GetStandardErrors Method](#t_getstandarderrorsmethod)

[NeedStandardErrors Method](#t_needstandarderrorsmethod)

<a id="t_getstandarderrorsexmethodexample"></a>
###### GetStandardErrorsEx Method Example

This example demonstrates the **GetStandardErrorsEx** method.

Imports AmosEngineLib.AmosEngine.TMatrixID Module MainModule  ' GetStandardErrorsEx Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine   Sem.NeedStandardErrors(FactorScoreWeights)   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   Dim am As New AmosEngineLib.AmosMatrix  Dim ad As New AmosDebug.AmosDebug  ad.DecimalPlaces = 5  Sem.GetStandardErrorsEx(FactorScoreWeights, am)  ad.PrintX(am, "Standard errors for factor score weights")   Sem.Dispose()  End Sub End Module

<a id="t_glsmethod"></a>
###### Gls Method

*Help context ID: 5050*

Requests a generalized least squares solution, obtained by minimizing (D1) together with (D3) in [Appendix B](https://ai-docs.amosdevelopment.com/07-appendices.md#t_appendixbdiscrepancyfunctions1).

Syntax

*object*.**Gls** ()

The **Gls** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [1].

Default

When you do not specify an estimation criterion, the maximum likelihood criterion ([Ml](#t_mlmethod) method) is used.

See Also

[Adf Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_adfmethod)

[BootGls Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_bootglsmethod)

[Ml Method](#t_mlmethod)

[Sls Method](#t_slsmethod)

[Uls Method](#t_ulsmethod)

<a id="t_glsmethodexample"></a>
###### Gls Method Example

This example demonstrates the **Gls** method.

Module MainModule  *' Gls Method Example*  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine   Sem.Gls()   Sem.TextOutput()   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   Sem.Dispose()  End Sub End Module

<a id="t_groupnamemethod"></a>
###### GroupName Method

*Help context ID: 5052*

Assigns a name to a group.

Syntax

*object*.**GroupName** (*theGroupName*)

The **GroupName** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *theGroupName* | A name for the group whose data is specified by the most recent [BeginGroup](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_begingroupmethod) or [BeginGroupEx](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_begingroupexmethod) method. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [2].

Default

The groups are called 'Group number 1', 'Group number 2', and so on.

See Also

[BeginGroup Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_begingroupmethod)

[BeginGroupEx Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_begingroupexmethod)

<a id="t_groupnamemethodexample"></a>
###### GroupName Method Example

This example demonstrates the **GroupName** method.

Module MainModule  ' GroupName Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine  Sem.TextOutput()   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Fels_fem")  Sem.GroupName("girls")  Sem.AStructure("academic = GPA + attract + e1 (1)")  Sem.AStructure("attract = height + weight + rating + academic + e2 (1)")  Sem.AStructure("e2 <--> e1")   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Fels_mal")  Sem.GroupName("boys")  Sem.AStructure("academic = GPA + attract + e1 (1)")  Sem.AStructure("attract = height + weight + rating + academic + e2 (1)")  Sem.AStructure("e2 <--> e1")   Sem.Dispose()  End Sub End Module

<a id="t_impliedmomentsmethod"></a>
###### ImpliedMoments Method

*Help context ID: 5053*

Controls reporting of the implied covariance matrix for the observed variables. When means and intercepts are explicitly modeled, **ImpliedMoments** also controls the reporting of implied means.

Syntax

*object*.**ImpliedMoments** ()

*object*.**ImpliedMoments** (*tf*)

The **ImpliedMoments** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *tf* | Optional. A boolean value that controls the reporting of implied moments. True (default) requests the output. False suppresses it. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [1].

Default

Implied moments are not reported.

Remarks

The 'implied' variances, covariances and means are estimates of the corresponding population values under the assumption that the specified model is correct.

If you use both the [Standardized](#t_standardizedmethod) and the **ImpliedMoments** methods, the implied correlation matrix will be reported, in addition to the implied covariance matrix.

**ImpliedMoments** is identical to [AllImpliedMoments](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_allimpliedmomentsmethod), except that [AllImpliedMoments](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_allimpliedmomentsmethod) displays implied variances, covariances and means for all variables in the model, not just for the observed variables.

See Also

[Admissible Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_admissiblemethod)

[AllImpliedMoments Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_allimpliedmomentsmethod)

[ResidualMoments Method](#t_residualmomentsmethod)

[SampleMoments Method](#t_samplemomentsmethod)

<a id="t_impliedmomentsmethodexample"></a>
###### ImpliedMoments Method Example

This example demonstrates the **ImpliedMoments** method.

Module MainModule  ' ImpliedMoments Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine   Sem.ImpliedMoments()  Sem.TextOutput()   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   Sem.Dispose()  End Sub End Module

<a id="t_initializemethodamosengine"></a>
###### Initialize Method (AmosEngine)

*Help context ID: 5054*

Initializes the Amos engine and specifies file names and locations for default output.

Syntax

*object*.**Initialize** (*projectName*)

The **Initialize** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *projectName* | A fully qualified path without any file extension. The output generated by the [TextOutput](#t_textoutputmethod) method is written to the file *projectName*.AmosOutput. The output file used for displaying results on the path diagram in Amos Graphics is called *projectName*.amp. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): Before any other **AmosEngine** methods or properties.

Default

The use of **Initialize** is optional. By default, the output generated by [TextOutput](#t_textoutputmethod) is written to the file *temppath*\AmosScratch.AmosOutput, where *temppath* is the Windows system temporary directory. Results to be displayed on the path diagram in Amos Graphics are written to the file *temppath*\AmosScratch.amp.

Remarks

The [TextOutputFileName](#t_textoutputfilenamemethod) method returns the name of the file that contains the output from [TextOutput](#t_textoutputmethod).

See Also

[Shutdown Method](#t_shutdownmethod)

<a id="t_initializemethodexample3"></a>
###### Initialize Method Example

In the following program, the text output that is displayed by [TextOutput](#t_textoutputmethod) is written to the file **c:\AnAmosExample.AmosOutput**.

Module MainModule  ' Initialize Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine   Sem.Initialize("c:\AnAmosExample")  Sem.TextOutput()   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   Sem.Dispose()  End Sub End Module

<a id="t_inputmlmomentsmethod"></a>
###### InputMLMoments Method

*Help context ID: 5055*

Specifies that any sample covariances that are read from a data file are (biased) maximum likelihood estimates of the corresponding population covariances. In other words, the input covariance matrix is assumed to be made up of sums of squares and cross products, divided by **N** (rather than by **N - 1**).

Syntax

*object*.**InputMLMoments** ()

The **InputMLMoments** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [1].

Default

Sample covariances that are read from a data file are assumed to be (biased) maximum likelihood estimates.

Remarks

[FitMLMoments](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_fitmlmomentsmethod) and **InputMLMoments** have different effects. **InputMLMoments** specifies that any sample covariance matrix that is read from a data file is a maximum likelihood estimate. [FitMLMoments](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_fitmlmomentsmethod), on the other hand, tells Amos to *fit the model* to the sample covariance matrix ($\mathbf{S}^{(g)}$ in Appendices [A](https://ai-docs.amosdevelopment.com/07-appendices.md#t_appendixanotation1) and [B](https://ai-docs.amosdevelopment.com/07-appendices.md#t_appendixbdiscrepancyfunctions1)) that is the maximum likelihood estimate.

See Also

[FitMLMoments Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_fitmlmomentsmethod)

[FitUnbiasedMoments Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_fitunbiasedmomentsmethod)

[InputUnbiasedMoments Method](#t_inputunbiasedmomentsmethod)

<a id="t_inputmlmomentsmethodexample"></a>
###### InputMLMoments Method Example

This example demonstrates the **InputMLMoments** method.

Module MainModule  ' InputMLMoments Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine   Sem.InputMLMoments()  Sem.FitMLMoments()   Sem.TextOutput()   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Wheaton")  Sem.AStructure("anomia67 <--- 67_alienation (1)")  Sem.AStructure("anomia67 <--- eps1 (1)")  Sem.AStructure("powles67 <--- 67_alienation (path_p)")  Sem.AStructure("powles67 <--- eps2 (1)")  Sem.AStructure("anomia71 <--- 71_alienation (1)")  Sem.AStructure("anomia71 <--- eps3 (1)")  Sem.AStructure("powles71 <--- 71_alienation (path_p)")  Sem.AStructure("powles71 <--- eps4 (1)")  Sem.AStructure("67_alienation <--- ses")  Sem.AStructure("67_alienation <--- zeta1 (1)")  Sem.AStructure("71_alienation <--- 67_alienation")  Sem.AStructure("71_alienation <--- ses")  Sem.AStructure("71_alienation <--- zeta2 (1)")  Sem.AStructure("education <--- ses (1)")  Sem.AStructure("education <--- delta1 (1)")  Sem.AStructure("SEI <--- ses")  Sem.AStructure("SEI <--- delta2 (1)")  Sem.AStructure("eps3 <--> eps1")  Sem.AStructure("eps1 (var_a)")  Sem.AStructure("eps2 (var_p)")  Sem.AStructure("eps3 (var_a)")  Sem.AStructure("eps4 (var_p)")   Sem.Dispose()  End Sub End Module

<a id="t_inputunbiasedmomentsmethod"></a>
###### InputUnbiasedMoments Method

*Help context ID: 5056*

Specifies that any sample covariances that are read from a data file are unbiased estimates of the corresponding population covariances. In other words, the input covariance matrix is assumed to be made up of sums of squares and cross products, divided by **N - 1** (rather than by **N**).

Syntax

*object*.**InputUnbiasedMoments** ()

The **InputUnbiasedMoments** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [1].

Default

Sample covariances read from a data file are assumed to be (biased) maximum likelihood estimates.

Remarks

[FitUnbiasedMoments](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_fitunbiasedmomentsmethod) and InputUnbiasedMoments have different effects. InputUnbiasedMoments specifies that any sample covariance matrix that is read from a data file is an unbiased estimate. [FitUnbiasedMoments](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_fitunbiasedmomentsmethod), on the other hand, tells Amos to *fit the model* to the sample covariance matrix ($\mathbf{S}^{(g)}$ in Appendices [A](https://ai-docs.amosdevelopment.com/07-appendices.md#t_appendixanotation1) and [B](https://ai-docs.amosdevelopment.com/07-appendices.md#t_appendixbdiscrepancyfunctions1)) that is an unbiased estimate.

See Also

[FitMLMoments Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_fitmlmomentsmethod)

[FitUnbiasedMoments Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_fitunbiasedmomentsmethod)

[InputMLMoments Method](#t_inputmlmomentsmethod)

<a id="t_inputunbiasedmomentsmethodexample"></a>
###### InputUnbiasedMoments Method Example

This example demonstrates the **InputUnbiasedMoments** method.

Module MainModule  *' InputUnbiasedMoments Method Example*  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine   Sem.InputUnbiasedMoments()  Sem.FitUnbiasedMoments()   Sem.TextOutput()   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Wheaton")  Sem.AStructure("anomia67 <--- 67_alienation (1)")  Sem.AStructure("anomia67 <--- eps1 (1)")  Sem.AStructure("powles67 <--- 67_alienation (path_p)")  Sem.AStructure("powles67 <--- eps2 (1)")  Sem.AStructure("anomia71 <--- 71_alienation (1)")  Sem.AStructure("anomia71 <--- eps3 (1)")  Sem.AStructure("powles71 <--- 71_alienation (path_p)")  Sem.AStructure("powles71 <--- eps4 (1)")  Sem.AStructure("67_alienation <--- ses")  Sem.AStructure("67_alienation <--- zeta1 (1)")  Sem.AStructure("71_alienation <--- 67_alienation")  Sem.AStructure("71_alienation <--- ses")  Sem.AStructure("71_alienation <--- zeta2 (1)")  Sem.AStructure("education <--- ses (1)")  Sem.AStructure("education <--- delta1 (1)")  Sem.AStructure("SEI <--- ses")  Sem.AStructure("SEI <--- delta2 (1)")  Sem.AStructure("eps3 <--> eps1")  Sem.AStructure("eps1 (var_a)")  Sem.AStructure("eps2 (var_p)")  Sem.AStructure("eps3 (var_a)")  Sem.AStructure("eps4 (var_p)")   Sem.Dispose()  End Sub End Module

<a id="t_inputvariablehasmissingvaluesmethod"></a>
###### InputVariableHasMissingValues Method

*Help context ID: 5057*

Gets a boolean value that indicates whether an observed variable has missing observations.

Syntax

*object*.**InputVariableHasMissingValues** (*variableNumber*)

*object*.**InputVariableHasMissingValues** (*variableNumber, groupNumber*)

The **InputVariableHasMissingValues** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *variableNumber* | An integer specifying a variable in the data set for group number *groupNumber*. *variableNumber* is 1 for the first variable in the data set. |
| *groupNumber* | Optional. An integer specifying a group. *groupNumber* is 1 for the first group. If *groupNumber* is omitted, the first group is used. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [2].

See Also

[AnyMissingValues Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_anymissingvaluesmethod)

<a id="t_inputvariablehasmissingvaluesmethodexample"></a>
###### InputVariableHasMissingValues Method Example

The following program fits the model from Example 8 to the **Grant** data, and then displays in the debug window some characteristics of the variables in the dataset.

Imports System.Diagnostics Module MainModule  ' InputVariableHasMissingValues Method Example  Sub Main()  Dim i As Integer  Dim Sem As New AmosEngineLib.AmosEngine   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grant")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   Debug.WriteLine("Number of variables: " & Sem.DataFileNVariables)  For i = 1 To Sem.DataFileNVariables  Debug.WriteLine("")  Debug.WriteLine("Variable number " & i)  Debug.WriteLine("Name: " & Sem.InputVariableName(i))  Debug.WriteLine("Label: " & Sem.InputVariableLabel(i))   If Sem.InputVariableIsNumeric(i) Then  Debug.WriteLine("Numeric")  Else  Debug.WriteLine("Non-numeric")  End If   If Sem.InputVariableHasMissingValues(i) Then  Debug.WriteLine("Has missing values")  Else  Debug.WriteLine("Doesn't have missing values")  End If  Next   Sem.Dispose()  End Sub End Module

<a id="t_inputvariableisnumericmethod"></a>
###### InputVariableIsNumeric Method

*Help context ID: 5058*

Gets a boolean value that indicates whether an observed variable is numeric.

Syntax

*object*.**InputVariableIsNumeric**(*variableNumber*)

*object*.**InputVariableIsNumeric**(*variableNumber*, *groupNumber*)

The **InputVariableIsNumeric** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *variableNumber* | An integer specifying a variable in the data set for group number *groupNumber*. *variableNumber* is 1 for the first variable in the data set. |
| *groupNumber* | Optional. An integer specifying a group. *groupNumber* is 1 for the first group. If *groupNumber* is omitted, the first group is used. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [2].

<a id="t_inputvariableisnumericmethodexample"></a>
###### InputVariableIsNumeric Method Example

The following program fits the model from Example 8 to the **Grant** data, and then displays in the debug window some characteristics of the variables in the dataset.

Imports System.Diagnostics Module MainModule  *' InputVariableIsNumeric Method Example*  Sub Main()  Dim i As Integer  Dim Sem As New AmosEngineLib.AmosEngine   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grant")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   Debug.WriteLine("Number of variables: " & Sem.DataFileNVariables)  For i = 1 To Sem.DataFileNVariables  Debug.WriteLine("")  Debug.WriteLine("Variable number " & i)  Debug.WriteLine("Name: " & Sem.InputVariableName(i))  Debug.WriteLine("Label: " & Sem.InputVariableLabel(i))   If Sem.InputVariableIsNumeric(i) Then  Debug.WriteLine("Numeric")  Else  Debug.WriteLine("Non-numeric")  End If   If Sem.InputVariableHasMissingValues(i) Then  Debug.WriteLine("Has missing values")  Else  Debug.WriteLine("Doesn't have missing values")  End If  Next   Sem.Dispose()  End Sub End Module

<a id="t_inputvariablelabelmethod"></a>
###### InputVariableLabel Method

*Help context ID: 5059*

Gets the label (not the name) of an observed variable.

Syntax

*result* = *object*.**InputVariableLabel**(*variableNumber*)

*result* = *object*.**InputVariableLabel**(*variableNumber*, *groupNumber*)

The **InputVariableLabel** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | *A variable label.* |
| *object* | An object of type **AmosEngine**. |
| *variableNumber* | An integer specifying a variable in the data set for group number *groupNumber*. *variableNumber* is 1 for the first variable in the data set. |
| *groupNumber* | Optional. An integer specifying a group. *groupNumber* is 1 for the first group. If *groupNumber* is omitted, the first group is used. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [2].

Remarks

Variable labels are only available for SPSS Statistics data files. For other data formats, **InputVariableLabel** returns an empty string.

See Also

[InputVariableName Method](#t_inputvariablenamemethod)

<a id="t_inputvariablelabelmethodexample"></a>
###### InputVariableLabel Method Example

The following program fits the model from Example 8 to the **Grant** data, and then displays in the debug window some characteristics of the variables in the dataset.

Imports System.Diagnostics Module MainModule  ' InputVariableLabel Method Example  Sub Main()  Dim i As Integer  Dim Sem As New AmosEngineLib.AmosEngine   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\Grant.sav")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   Debug.WriteLine("Number of variables: " & Sem.DataFileNVariables)  For i = 1 To Sem.DataFileNVariables  Debug.WriteLine("")  Debug.WriteLine("Variable number " & i)  Debug.WriteLine("Name: " & Sem.InputVariableName(i))  Debug.WriteLine("Label: " & Sem.InputVariableLabel(i))   If Sem.InputVariableIsNumeric(i) Then  Debug.WriteLine("Numeric")  Else  Debug.WriteLine("Non-numeric")  End If   If Sem.InputVariableHasMissingValues(i) Then  Debug.WriteLine("Has missing values")  Else  Debug.WriteLine("Doesn't have missing values")  End If  Next   Sem.Dispose()  End Sub End Module

<a id="t_inputvariablenamemethod"></a>
###### InputVariableName Method

*Help context ID: 5060*

Gets the name of an observed variable.

Syntax

*result* = *object*.**InputVariableName**(*variableNumber*)

*result* = *object*.**InputVariableName**(*variableNumber*, *groupNumber*)

The **InputVariableName** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | A variable name. |
| *object* | An object of type **AmosEngine**. |
| *variableNumber* | An integer specifying a variable in the data set for group number *groupNumber*. *variableNumber* is 1 for the first variable in the data set. |
| *groupNumber* | Optional. An integer specifying a group. *groupNumber* is 1 for the first group. If *groupNumber* is omitted, the first group is used. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [2].

See Also

[InputVariableLabel Method](#t_inputvariablelabelmethod)

<a id="t_inputvariablenamemethodexample"></a>
###### InputVariableName Method Example

The following program fits the model from Example 8 to the **Grant** data, and then displays in the debug window some characteristics of the variables in the dataset.

Imports System.Diagnostics Module MainModule  ' InputVariableName Method Example  Sub Main()  Dim i As Integer  Dim Sem As New AmosEngineLib.AmosEngine   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grant")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   Debug.WriteLine("Number of variables: " & Sem.DataFileNVariables)  For i = 1 To Sem.DataFileNVariables  Debug.WriteLine("")  Debug.WriteLine("Variable number " & i)  Debug.WriteLine("Name: " & Sem.InputVariableName(i))  Debug.WriteLine("Label: " & Sem.InputVariableLabel(i))   If Sem.InputVariableIsNumeric(i) Then  Debug.WriteLine("Numeric")  Else  Debug.WriteLine("Non-numeric")  End If   If Sem.InputVariableHasMissingValues(i) Then  Debug.WriteLine("Has missing values")  Else  Debug.WriteLine("Doesn't have missing values")  End If  Next   Sem.Dispose()  End Sub End Module

<a id="t_interceptmethod"></a>
###### Intercept Method

*Help context ID: 5061*

Specifies an intercept as a model parameter.

Syntax

*object*.**Intercept** (*variableName*)

*object*.**Intercept** (*variableName*, *parameterValue*)

*object*.**Intercept** (*variableName*, *parameterName*)

The **Intercept** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *variableName* | The character string, *variableName*, is the name of an endogenous variable. The intercept in the regression equation for predicting *variableName* is a model parameter. |
| *parameterValue* | (Optional) Parameter value. If *parameterValue *= 3, say, then the intercept is fixed at 3. |
| *parameterName* | (Optional) Parameter name. If parameterName = "abc", say, then the intercept is named "abc". It is constrained to be equal to any other parameters named "abc". If parameterName = "3?", say then the intercept is given an initial value of 3, and is unconstrained. If parameterName = "abc:3", say, then the intercept is named "abc" and is given an initial value of 3. It is constrained to be equal to any other parameters named "abc". If parameterName is an empty string (""), the intercept is an unconstrained parameter. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [2].

Default

When the [ModelMeansAndIntercepts](#t_modelmeansandinterceptsmethod) method is not used, then all intercepts are unconstrained. However, they are not estimated.

When the [ModelMeansAndIntercepts](#t_modelmeansandinterceptsmethod) method is used, the following default assumptions are made about intercepts that are not constrained or fixed at constant values by use of the [AStructure](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_structuremethod) or [Intercept](#t_interceptmethod) methods.

Intercepts for the prediction of observed, endogenous variables are free parameters.

Intercepts for the prediction of unobserved, endogenous variables are fixed at zero.

Remarks

If neither parameterValue nor parameterName is present, the intercept is an unconstrained parameter.

See Also

[Mean Method](#t_meanmethod)

[ModelMeansAndIntercepts Method](#t_modelmeansandinterceptsmethod)

<a id="t_interceptmethodexample"></a>
###### Intercept Method Example

The following program uses the [Path](#t_pathmethod), **Intercept** and [Mean](#t_meanmethod) methods to specify the model in Example 14.

Module MainModule  ' Intercept Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine   Sem.TextOutput()  Sem.Standardized()  Sem.Smc()  Sem.ImpliedMoments()  Sem.SampleMoments()   Sem.ModelMeansAndIntercepts()   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Warren5v")  Sem.Path("performance", "knowledge")  Sem.Path("performance", "value")  Sem.Path("performance", "satisfaction")  Sem.Path("performance", "error", 1)  Sem.Intercept("performance")  Sem.Mean("knowledge")  Sem.Mean("value")  Sem.Mean("satisfaction")   Sem.Dispose()  End Sub End Module

<a id="t_interruptmethod"></a>
###### Interrupt Method

*Help context ID: 5166*

Stops any ongoing calculations. **Interrupt** is equivalent to selecting **Analyze **®** Stop Calculating Estimates** from the Amos Graphics menu.

Syntax

*object*.**Interrupt** ()

The **Interrupt** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [3].

<a id="t_ismodelingmeansandinterceptsmethod"></a>
###### IsModelingMeansAndIntercepts Method

*Help context ID: 5169*

True if means and intercepts are explicit model parameters.

Syntax

*result = object*.**IsModelingMeansAndIntercepts** ()

The **IsModelingMeansAndIntercepts** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | True if means and intercepts are explicit model parameters. |
| *object* | An object of type **AmosEngine**. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [3].

See Also

[Use the AmosEngine class to test for scale- and location-invariance](https://ai-docs.amosdevelopment.com/06-programming-with-amos-part-3.md#t_usetheamosengineclasstotestforscaleandlocationinvariance)

<a id="t_iterationsmethod"></a>
###### Iterations Method

*Help context ID: 5063*

Places a limit on the number of iterations Amos will perform. If this limit is reached, Amos will stop after reporting its current parameter estimates, even if the convergence criteria (see the [Crit1](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_crit1method) and [Crit2](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_crit2method) methods) have not been met.

Syntax

*object*.**Iterations** (*nIterations*)

The **Iterations** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *nIterations* | Upper bound on the number of iterations. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [1].

Default

There is no limit on the number of iterations.

See Also

[Crit1 Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_crit1method)

[Crit2 Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_crit2method)

[Fisher Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_fishermethod)

[Technical Method](#t_technicalmethod)

[Time Method](#t_timemethod)

<a id="t_iterationsmethodexample"></a>
###### Iterations Method Example

This example demonstrates the **Iterations** method.

Module MainModule  ' Iterations Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine   Sem.Iterations(20)   Sem.TextOutput()   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   Sem.Dispose()  End Sub End Module

<a id="t_linelengthmethod"></a>
###### LineLength Method

*Help context ID: 5064*

The **LineLength** method has no effect. It is provided for compatibility with earlier versions of Amos.

Syntax

*object*.**LineLength** (*nCharacters*)

The **LineLength** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *nCharacters* | Number of characters per line. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [1].

<a id="t_maxdecimalplacesmethod"></a>
###### MaxDecimalPlaces Method

*Help context ID: 5065*

The **MaxDecimalPlaces** method has no effect. It is provided for compatibility with earlier versions of Amos.

Syntax

*object*.**MaxDecimalPlaces** (*nDigits*)

The **MaxDecimalPlaces** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *nDigits* | Maximum number of decimal places. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [1].

<a id="t_meanmethod"></a>
###### Mean Method

*Help context ID: 5066*

Specifies a mean as a model parameter.

Syntax

*object*.**Mean** (*variableName*)

*object*.**Mean** (*variableName*, *parameterValue*)

*object*.**Mean** (*variableName*, *parameterName*)

The **Mean** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *variableName* | The character string, variableName, is the name of an exogenous variable. The **Mean** method makes that variable's mean a model parameter. |
| *parameterValue* | (Optional) Parameter value. If *parameterValue* = 3, say, then the mean is fixed at 3. |
| *parameterName* | (Optional) Parameter name. If parameterName = "abc", say, then the mean is named "abc". It is constrained to be equal to any other parameters named "abc". If parameterName = "3?", say then the mean is given an initial value of 3, and is unconstrained. If parameterName = "abc:3", say, then the mean is named "abc" and is given an initial value of 3. It is constrained to be equal to any other parameters named "abc". If parameterName is an empty string (""), the mean is an unconstrained parameter. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [2].

Default

When the [ModelMeansAndIntercepts](#t_modelmeansandinterceptsmethod) method is not used, then the means of all exogenous variables are unconstrained. However, the means are not estimated.

When the [ModelMeansAndIntercepts](#t_modelmeansandinterceptsmethod) method is used, the following default assumptions are made about means that are not constrained or fixed at constant values by use of the [MStructure](#t_mstructuremethod) or **Mean** methods.

The means of observed, exogenous variables are free parameters.

The means of unobserved, exogenous variables are fixed at zero.

Remarks

If *parameterValue *and *parameterName* are omitted, the mean is an unconstrained parameter.

See Also

[Intercept Method](#t_interceptmethod)

[ModelMeansAndIntercepts Method](#t_modelmeansandinterceptsmethod)

<a id="t_meanmethodexample"></a>
###### Mean Method Example

The following program uses the [Path](#t_pathmethod), [Intercept](#t_interceptmethod) and **Mean** methods to specify the model in Example 14.

Module MainModule  ' Mean Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine   Sem.TextOutput()  Sem.Standardized()  Sem.Smc()  Sem.ImpliedMoments()  Sem.SampleMoments()   Sem.ModelMeansAndIntercepts()   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Warren5v")  Sem.Path("performance", "knowledge")  Sem.Path("performance", "value")  Sem.Path("performance", "satisfaction")  Sem.Path("performance", "error", 1)  Sem.Intercept("performance")  Sem.Mean("knowledge")  Sem.Mean("value")  Sem.Mean("satisfaction")   Sem.Dispose()  End Sub End Module

<a id="t_mindecimalplacesmethod"></a>
###### MinDecimalPlaces Method

*Help context ID: 5067*

The **MinDecimalPlaces** method has no effect. It is provided for compatibility with earlier versions of Amos.

Syntax

*object*.**MinDecimalPlaces** (*nDigits*)

The **MinDecimalPlaces** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *nDigits* | Minimum number of decimal places. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [1].

<a id="t_mlmethod"></a>
###### Ml Method

*Help context ID: 5068*

Requests estimation by the method of maximum likelihood, minimizing (D1) together with (D2) in [Appendix B](https://ai-docs.amosdevelopment.com/07-appendices.md#t_appendixbdiscrepancyfunctions1).

Syntax

*object*.**Ml** ()

The **Ml** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [1].

Default

When you do not specify an estimation criterion, the maximum likelihood criterion ([Ml](#t_mlmethod) method) is used.

See Also

[Adf Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_adfmethod)

[BootMl Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_bootmlmethod)

[Gls Method](#t_glsmethod)

[Sls Method](#t_slsmethod)

[Uls Method](#t_ulsmethod)

<a id="t_mlmethodexample"></a>
###### Ml Method Example

This example demonstrates the **Ml** method.

Module MainModule  ' Ml Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine   Sem.Ml()   Sem.TextOutput()   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   Sem.Dispose()  End Sub End Module

<a id="t_modelmethod"></a>
###### Model Method

*Help context ID: 5069*

Places equality constraints on model parameters.

Syntax

*object*.**Model** (*modelName*, *constraint1*)

*object*.**Model** (*modelName*, *constraint1*, *constraint2*)

*object*.**Model** (*modelName*, *constraint1*, *constraint2*, *constraint3*)

...

The **Model** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *modelName* | A name for the complete set of constraints consisting of constraint1, constraint2, constraint3, etc. |
| *constraint1* | Either: A string of the form p1=p2=p3=..., where each pi is either a parameter name or a number. At most one of the pi can be a number. Or: The name of a model defined by another use of the **Model** method. |
| *constraint2* | Same as constraint1 |
| *constraint3* | Same as constraint1 |
| ... | ... |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [2].

Default

No additional parameter constraints are imposed beyond those specified by the assignment of names and values to parameters by use of the [Path](#t_pathmethod), [Cov](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_covmethod), [Var](#t_varmethod), [Mean](#t_meanmethod), [Intercept](#t_interceptmethod), [AStructure](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_structuremethod) and [MStructure](#t_mstructuremethod) methods.

Remarks

In order to use the **Model** method, you need to be able to refer to parameters by name. Parameters can be named by the [Path](#t_pathmethod), [Cov](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_covmethod), [Var](#t_varmethod), [Mean](#t_meanmethod), [Intercept](#t_interceptmethod), [AStructure](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_structuremethod) and [MStructure](#t_mstructuremethod) methods.

You can use the **Model** method as many times as you want.

<a id="t_modelmethodexample"></a>
###### Model Method Example

This example demonstrates the **Model** method.

Module MainModule  ' Model Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine   Sem.TextOutput()   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Wheaton")  Sem.Path("anomia67", "67_alienation", 1)  Sem.Path("anomia67", "eps1", 1)  Sem.Path("powles67", "67_alienation")  Sem.Path("powles67", "eps2", 1)  Sem.Path("anomia71", "71_alienation", 1)  Sem.Path("anomia71", "eps3", 1)  Sem.Path("powles71", "71_alienation")  Sem.Path("powles71", "eps4", 1)  Sem.Path("67_alienation", "ses")  Sem.Path("67_alienation", "zeta1", 1)  Sem.Path("71_alienation", "67_alienation")  Sem.Path("71_alienation", "ses")  Sem.Path("71_alienation", "zeta2", 1)  Sem.Path("education", "ses", 1)  Sem.Path("education", "delta1", 1)  Sem.Path("SEI", "ses")  Sem.Path("SEI", "delta2", 1)  Sem.Var("eps1", "var1")  Sem.Var("eps2", "var2")  Sem.Var("eps3", "var3")  Sem.Var("eps4", "var4")  Sem.Cov("eps1", "eps3", "cov1")  Sem.Cov("eps2", "eps4", "cov2")   Sem.Model("B", "cov1 = cov2 = 0")  Sem.Model("C", "cov2 = 0")  Sem.Model("D")  Sem.Model("E", "var1 = var3")  Sem.Model("F", "var2 = var4")  Sem.Model("G", "E", "F")   Sem.Dispose()  End Sub End Module

<a id="t_discussionoftheexample3"></a>
###### Discussion of the example

Many modeling efforts require fitting several alternative models to the same data. You can fit many models at once provided that each model can be obtained by placing equality constraints on the parameters of one special, 'most general', model. The example shows how to do this. First the [Path](#t_pathmethod), [Var](#t_varmethod) and [Cov](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_covmethod) methods are used to specify [Jöreskog and Sörbom's (1989](https://ai-docs.amosdevelopment.com/08-references.md#t_joereskog__soerbom_1989), p. 205) Model D for the data of [Wheaton et al. (1977)](https://ai-docs.amosdevelopment.com/08-references.md#t_wheaton__muthen__alwin__summer).

Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine   Sem.TextOutput()   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Wheaton")  Sem.Path("anomia67", "67_alienation", 1)  Sem.Path("anomia67", "eps1", 1)  Sem.Path("powles67", "67_alienation")  Sem.Path("powles67", "eps2", 1)  Sem.Path("anomia71", "71_alienation", 1)  Sem.Path("anomia71", "eps3", 1)  Sem.Path("powles71", "71_alienation")  Sem.Path("powles71", "eps4", 1)  Sem.Path("67_alienation", "ses")  Sem.Path("67_alienation", "zeta1", 1)  Sem.Path("71_alienation", "67_alienation")  Sem.Path("71_alienation", "ses")  Sem.Path("71_alienation", "zeta2", 1)  Sem.Path("education", "ses", 1)  Sem.Path("education", "delta1", 1)  Sem.Path("SEI", "ses")  Sem.Path("SEI", "delta2", 1)  Sem.Var("eps1", "var1")  Sem.Var("eps2", "var2")  Sem.Var("eps3", "var3")  Sem.Var("eps4", "var4")  Sem.Cov("eps1", "eps3", "cov1")  Sem.Cov("eps2", "eps4", "cov2")   Sem.Model("B", "cov1 = cov2 = 0")  Sem.Model("C", "cov2 = 0")  Sem.Model("D")  Sem.Model("E", "var1 = var3")  Sem.Model("F", "var2 = var4")  Sem.Model("G", "E", "F")   Sem.Dispose() End Sub

Six parameters are named - cov1, cov2, var1, var2, var3, var4. However, since no two parameters share the same name, the presence of the names does not place any constraints on the parameters. The purpose of the names is to allow the **Model** method to place constraints on the named parameters.

Jöreskog and Sörbom proposed other models besides Model D. All but one of them can be obtained by constraining Model D. For instance, their Model C is just like Model D, but with the parameter named cov2 (the covariance between eps2 and eps4) fixed at zero. Their Model B goes even further. It assumes that two parameters (cov1 and cov2) are zero. Amos analyzes Models B and C along with Model D if you add the following lines to the program.

Sem.Model("B", "cov1 = cov2 = 0") Sem.Model("C", "cov2 = 0") Sem.Model("D")

The first two lines are self-explanatory - they name and describe Models B and C. You may be surprised that the third line is necessary. It declares that there is a model called Model D that employs no additional constraints beyond those specified by the [Path](#t_pathmethod), [Var](#t_varmethod) and [Cov](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_covmethod) methods. This line is necessary if you want to analyze Model D. The rule is that, if you use the **Model** method at all, Amos will only analyze models explicitly defined through use of the **Model** method. This convention allows you to specify an unidentified model, and then to supply enough constraints with each use of the **Model** method to identify the model. If you don't use the **Model** method at all, however, Amos will perform a single analysis — of the model as specified by the [Path](#t_pathmethod), [Cov](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_covmethod), [Var](#t_varmethod), [Mean](#t_meanmethod), [Intercept](#t_interceptmethod), [AStructure](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_structuremethod) and [MStructure](#t_mstructuremethod) methods.

It may be possible to specify the same set of constraints in several equivalent ways. Model B, for instance, could have been specified in the following way.

Sem.Model("B", "cov1 = 0", "cov2 = 0")

Here is another, equivalent, variation.

Sem.Model("B", "cov1 = cov2", "cov2 = 0")

There is a shorthand for indicating that one model incorporates all of the constraints of another model. In the present example, Model B includes all of the constraints of Model C, as well as one additional constraint, so Model B could be specified this way:

Sem.Model("B", "C", "cov1 = 0")

The example specified three more models for the Wheaton data. Notice that var1 and var3 are unique variances associated with anomia measurements made in 1967 and 1971. It is a plausible hypothesis that the unique variance of anomia was the same in both years. This hypothesis was incorporated into a new model by adding this line to the program.

Sem.Model("E", "var1 = var3")

Similarly, since var2 and var4 are unique variances associated with powerlessness measurements made in 1967 and 1971, it is plausible to set up a model in which those two variances are required to be equal:

Sem.Model("F", "var2 = var4")

Finally, both of the models just described could be right. In other words, all of the 1971 parameter values could be the same as the corresponding 1967 values. The following model specification imposes both sets of constraints.

Sem.Model("G", "E", "F")

<a id="t_modelmeansandinterceptsmethod"></a>
###### ModelMeansAndIntercepts Method

*Help context ID: 5070*

Specifies that means (of exogenous variables) and intercepts (in the equations for predicting endogenous variables) are explicit model parameters. The **ModelMeansAndIntercepts** method must be used in order to allow the use of the [Intercept](#t_interceptmethod), [Mean](#t_meanmethod) or [MStructure](#t_mstructuremethod) methods or the specification of an intercept through use of the [AStructure](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_structuremethod) method.

Syntax

*object*.**ModelMeansAndIntercepts** ()

The **ModelMeansAndIntercepts** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [1].

Default

When the **ModelMeansAndIntercepts** method is not used, means and intercepts are not constrained and not estimated.

Remarks

When the **ModelMeansAndIntercepts** method is used, means and intercepts are fixed at zero by default. Constraints on means can be changed with the [Mean](#t_meanmethod) and [MStructure](#t_mstructuremethod) methods. Constraints on intercepts can be changed with the [Intercept](#t_interceptmethod) and [AStructure](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_structuremethod) methods.

See Also

[Intercept Method](#t_interceptmethod)

[Mean Method](#t_meanmethod)

[MStructure Method](#t_mstructuremethod)

<a id="t_modelmeansandinterceptsmethodexample"></a>
###### ModelMeansAndIntercepts Method Example

This example demonstrates the **ModelMeansAndIntercepts** method.

Module MainModule  ' ModelMeansAndIntercepts Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine   Sem.TextOutput()   Sem.ModelMeansAndIntercepts()   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Fels_fem")  Sem.MStructure("academic (4)")  Sem.MStructure("athletic")  Sem.MStructure("attract (abc)")  Sem.MStructure("gpa (abc)")  Sem.MStructure("height (20?)")  Sem.MStructure("weight (xyz : 10)")  Sem.MStructure("rating (xyz : 10)")   Sem.Dispose()  End Sub End Module

<a id="t_modsmethod"></a>
###### Mods Method

*Help context ID: 5071*

Displays the modification indices described by [Jöreskog and Sörbom (1984)](https://ai-docs.amosdevelopment.com/08-references.md#t_joereskog__soerbom_1984).

Syntax

*object*.**Mods** (*threshold*)

The **Mods** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *threshold* | Optional. Only modification indices that exceed *threshold* are displayed. The default value for *threshold* is 4. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [1].

Default

Modification indices are not reported.

Remarks

Amos computes a modification index for each parameter that is fixed at a constant value and for each parameter that is required to equal some other parameter. The modification index for a parameter is an estimate of the amount by which the discrepancy function would decrease if the analysis were repeated with the constraints on that parameter removed. The actual decrease that would occur may be much greater.

Amos computes modification indices not only for parameters that are explicitly constrained, but also for parameters that are implicitly assumed to be zero. For example, a modification index is computed for every covariance that is fixed at zero by default.

Amos also computes modification indices for paths that do not appear in a model, giving the approximate amount by which the discrepancy function would decrease if such a path were introduced. There are, however, two types of nonexistent paths for which Amos does not compute a modification index. First, Amos does not compute a modification index for a nonexistent path which, if introduced, would convert an exogenous variable into an endogenous variable. Second, Amos does not compute a modification index for a nonexistent path that, if introduced, would create an indirect path from a variable to itself where none already exists. In particular, Amos does not compute a modification index for a nonexistent path that, if introduced, would convert a recursive model to a nonrecursive one.

Each time Amos displays a modification index for a parameter, it also displays an estimate of the amount by which the parameter would change from its current, constrained value if the constraints on it were removed.

Specifying a small value for *threshold* can result in the output of a large number of modification indices.

<a id="t_modsmethodexample"></a>
###### Mods Method Example

This example demonstrates the **Mods** method.

Module MainModule  ' Mods Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine   Sem.Mods(4)   Sem.TextOutput()   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Wheaton")  Sem.AStructure("anomia67 <--- 67_alienation (1)")  Sem.AStructure("anomia67 <--- eps1 (1)")  Sem.AStructure("powles67 <--- 67_alienation")  Sem.AStructure("powles67 <--- eps2 (1)")  Sem.AStructure("anomia71 <--- 71_alienation (1)")  Sem.AStructure("anomia71 <--- eps3 (1)")  Sem.AStructure("powles71 <--- 71_alienation")  Sem.AStructure("powles71 <--- eps4 (1)")  Sem.AStructure("67_alienation <--- ses")  Sem.AStructure("67_alienation <--- zeta1 (1)")  Sem.AStructure("71_alienation <--- 67_alienation")  Sem.AStructure("71_alienation <--- ses")  Sem.AStructure("71_alienation <--- zeta2 (1)")  Sem.AStructure("education <--- ses (1)")  Sem.AStructure("education <--- delta1 (1)")  Sem.AStructure("SEI <--- ses")  Sem.AStructure("SEI <--- delta2 (1)")   Sem.Dispose()  End Sub End Module

<a id="t_discussionofexample"></a>
###### Discussion of Example

The example (which is the same as Model A in Example 6 of the *User's Guide*) yields the following modification indices.


| **Covariances: (Group number 1 - Default model)** M.I.Par Changeeps2<-->delta15.905-.424eps2<-->eps426.545.825eps2<-->eps332.071-.988eps1<-->delta14.609.421eps1<-->eps435.367-1.069eps1<-->eps340.9111.253 **Variances: (Group number 1 - Default model)** M.I.Par Change **Regression Weights: (Group number 1 - Default model)** M.I.Par Changepowles71<---powles675.457.057powles71<---anomia679.006-.065anomia71<---powles676.775-.069anomia71<---anomia6710.352.076powles67<---powles715.612.054powles67<---anomia717.278-.054anomia67<---powles717.706-.070anomia67<---anomia719.065.068 |
| --- |

The largest modification index is 40.911, indicating that the chi-square statistic will drop by at least 40.911 if the covariance between **eps1** and **eps3** is allowed to depart from zero (the value at which it is fixed in Model A). The number 1.254 in the **Par Change** column indicates that the covariance will increase by about 1.254 if it is free to take on any value. Of course if the covariance (now zero) increases by 1.254 it will then be equal to 1.254. Actually, in Model B of Example 6, where the covariance between **eps1** and **eps3** is unconstrained, its estimate is 1.888. [Kaplan (1989)](https://ai-docs.amosdevelopment.com/08-references.md#t_kaplan_1989) and [Saris, Satorra and Sörbom (1987)](https://ai-docs.amosdevelopment.com/08-references.md#t_saris__satorra__soerbom_1987) discuss the use of estimated parameter changes in exploratory analyses.

<a id="t_montecarlomethod"></a>
###### MonteCarlo Method

*Help context ID: 5072*

Controls whether a parametric bootstrap or a nonparametric bootstrap ([Efron & Tibshirani, 1993](https://ai-docs.amosdevelopment.com/08-references.md#t_efron__tibshirani_1993)) is performed.

When the **MonteCarlo** method is used, bootstrap samples are drawn from a multivariate normal population whose means, variances and covariances are the same as the sample means, variances and covariances.

Syntax

*object*.**MonteCarlo** ()

*object*.**MonteCarlo** (*tf*)

The **MonteCarlo** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *tf* | True (default) specifies a parametric bootstrap. False specifies a nonparametric bootstrap. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [1].

Default

A nonparametric bootstrap is performed. (Bootstrap samples are drawn with replacement from the original sample. Raw data input is required.)

Remarks

**MonteCarlo** allows bootstrapping to be carried out (with the assumption of normality) when raw data are not available. If you do not use the [Bootstrap](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_bootstrapmethod) method, the **MonteCarlo** method has no effect.

See Also

[Bootstrap Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_bootstrapmethod)

[Seed Method](#t_seedmethod)

<a id="t_montecarlomethodexample"></a>
###### MonteCarlo Method Example

This example demonstrates the **MonteCarlo** method.

Module MainModule  ' MonteCarlo Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine   Sem.MonteCarlo()  Sem.Bootstrap(2000)   Sem.TextOutput()   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   Sem.Dispose()  End Sub End Module

<a id="t_mstructuremethod"></a>
###### MStructure Method

*Help context ID: 5073*

Frees or constrains the mean of an exogenous variable.

The **Mean** method accomplishes the same thing, and is recommended for new Amos programs. The syntax of the [MStructure](#t_mstructuremethod) method resembles the syntax of the **$MStructure** command in previous versions of Amos, and is provided to assist in the translation of old Amos input files.

Syntax

*object*.**MStructure** (*s*)

The **MStructure** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *s* | A character string in one of the following forms In the first form, the mean of the variable named variablename is a free parameter. In the second form, the mean of the variable named variablename is fixed at number. In the third form, the mean of the variable named variablename is given the name parametername. In the fourth form, the mean of the variable named variablename is a free parameter, and is given an initial value of number. In the fifth form, the mean of the variable named variablename is given the name parametername and an initial value of number. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [2].

Default

When the [ModelMeansAndIntercepts](#t_modelmeansandinterceptsmethod) method is not used, then all means and intercepts are unconstrained. However, no means or intercepts are estimated.

When the [ModelMeansAndIntercepts](#t_modelmeansandinterceptsmethod) method is used, the following default assumptions are made about exogenous variables that are not constrained or fixed at constant values by use of the **MStructure** or [Mean](#t_meanmethod) methods.

The means of observed, exogenous variables are free parameters.

The means of unobserved, exogenous variables are fixed at zero.

Remarks

The [ModelMeansAndIntercepts](#t_modelmeansandinterceptsmethod) method must be used before using the **MStructure** method.

It is possible to name an endogenous variable as an argument to the **MStructure** method. Doing so has the effect of freeing or constraining the intercept in the regression equation for predicting that variable. However, the following methods for specifying constraints on intercepts are recommended.

- Include the intercept in a linear equation through use of the [AStructure](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_structuremethod) method.
- Use the [Intercept](#t_interceptmethod) method.

See Also

[Intercept Method](#t_interceptmethod)

[Mean Method](#t_meanmethod)

[ModelMeansAndIntercepts Method](#t_modelmeansandinterceptsmethod)

[AStructure Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_structuremethod)

<a id="t_mstructuremethodexample"></a>
###### MStructure Method Example

In the following program, the mean of academic is fixed at 4. The mean of athletic is not constrained in any way. attract and gpa are required to have the same mean because both means are named 'abc'. The mean of height is given an initial value of 20. The means of weight and rating are required to be equal and are given an initial value of 10.

Module MainModule  ' MStructure Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine  Sem.TextOutput()  Sem.ModelMeansAndIntercepts()   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Fels_fem")  Sem.MStructure("academic (4)")  Sem.MStructure("athletic")  Sem.MStructure("attract (abc)")  Sem.MStructure("gpa (abc)")  Sem.MStructure("height (20?)")  Sem.MStructure("weight (xyz : 10)")  Sem.MStructure("rating (xyz : 10)")   Sem.Dispose()  End Sub End Module

<a id="t_ncpncploncphimethods"></a>
###### Ncp, NcpLo, NcpHi Methods

*Help context ID: 5074*

**Ncp** gets a point estimate of the noncentrality parameter. **NcpLo** and **NcpHi** get the lower and upper boundaries of a 90% confidence interval for the noncentrality parameter.

Syntax

*object*.**Ncp** ()

*object*.**NcpLo** ()

*object*.**NcpHi** ()

The **Ncp**, **NcpLo** and **NcpHi** method syntaxes have the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [3].

Remarks

If you have used the [Model](#t_modelmethod) method to define more than one model, the **Ncp**, **NcpLo** and **NcpHi** methods return estimates for the most recently fitted model. The second example shows how to obtain estimates for multiple models.

<a id="t_ncpncploandncphimethodsexample1"></a>
###### Ncp, NcpLo and NcpHi Methods Example 1

The following program shows how to display various fit measures when only one model is defined (i.e., when the [Model](#t_modelmethod) method has been used only once or not at all).

Imports System.Diagnostics Module MainModule  ' Ncp, NcpLo and NcpHi Methods Example 1  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   Debug.WriteLine("Chi Square = " & Sem.Cmin)  Debug.WriteLine("Degrees of Freedom = " & Sem.df)  Debug.WriteLine("p = " & Sem.p)  Debug.WriteLine("Number of parameters = " & Sem.npar)  Debug.WriteLine("Noncentrality parameter = " & Sem.Ncp & " (" & _  Sem.NcpLo & ", " & Sem.NcpHi & ")")  Debug.WriteLine("Rmsea = " & Sem.Rmsea & " (" & Sem.RmseaLo & ", " & Sem.RmseaHi & ")")  Debug.WriteLine("Test of close fit, p = " & Sem.Pclose)   Sem.Dispose()  End Sub End Module

<a id="t_ncpncploandncphimethodsexample2"></a>
###### Ncp, NcpLo and NcpHi Methods Example 2

The following program shows how to display various fit measures for multiple models (i.e., when the [Model](#t_modelmethod) method has been used more than once).

Imports System.Diagnostics Module MainModule  ' Ncp, NcpLo and NcpHi Methods Example 2  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine  Dim i As Integer   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (a) spatial + (1) err_v")  Sem.AStructure("cubes = (b) spatial + (1) err_c")  Sem.AStructure("lozenges = (c) spatial + (1) err_l")  Sem.AStructure("paragraph = (d) verbal + (1) err_p")  Sem.AStructure("sentence = (e) verbal + (1) err_s")  Sem.AStructure("wordmean = (f) verbal + (1) err_w")  Sem.Var("spatial", 1)  Sem.Var("verbal", 1)   Sem.Model("Congeneric")  Sem.Model("tau-equivalent", "a = b = c", "d = e = f")   For i = 1 To 2  Debug.WriteLine("")  Debug.WriteLine("Model number " & i)  Sem.FitModel(i)  Debug.WriteLine("Chi Square = " & Sem.Cmin)  Debug.WriteLine("Degrees of Freedom = " & Sem.df)  Debug.WriteLine("p = " & Sem.p)  Debug.WriteLine("Number of parameters = " & Sem.npar)  Debug.WriteLine("Noncentrality parameter = " & Sem.Ncp & " (" & _  Sem.NcpLo & ", " & Sem.NcpHi & ")")  Debug.WriteLine("Rmsea = " & Sem.Rmsea & " (" & Sem.RmseaLo & ", " & Sem.RmseaHi & ")")  Debug.WriteLine("Test of close fit, p = " & Sem.Pclose)  Next   Sem.Dispose()  End Sub End Module

<a id="t_observedinfomethod"></a>
###### ObservedInfo Method

*Help context ID: 5091*

Controls whether the covariance matrix of estimates is estimated by inverting the expected second derivatives or the exact second derivatives.

Syntax

*object*.**ObservedInfo** ()

*object*.**ObservedInfo** (*tf*)

The **ObservedInfo** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *tf* | Optional. If *tf* is True (the default), the covariance matrix of estimates is estimated by inverting the matrix of exact second derivatives. If *tf* is False, the matrix of expected second derivatives is used. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [1].

Default

The matrix of expected second derivatives is used.

Remarks

See [Efron and Hinkley (1978)](https://ai-docs.amosdevelopment.com/08-references.md#t_efron__hinkley_1978) for a discussion of exact versus expected second derivatives in the estimation of the covariance matrix of estimates.

<a id="t_observedinfomethodexample"></a>
###### ObservedInfo Method Example

This example demonstrates the **ObservedInfo** method.

Module MainModule  ' ObservedInfo Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine   Sem.ObservedInfo()   Sem.TextOutput()   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   Sem.Dispose()  End Sub End Module

<a id="t_needbclowerboundsneedbcupperboundsmethods"></a>
###### NeedBCLowerBounds, NeedBCUpperBounds Methods

*Help context ID: 5077*

Declares that [GetBCLowerBounds](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_getbclowerboundsgetbcupperboundsmethods) or [GetBCUpperBounds](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_getbclowerboundsgetbcupperboundsmethods) will be used later in the program.

Syntax

*object*.**NeedBCLowerBounds** (*matrixID*)

*object*.**NeedBCUpperBounds** (*matrixID*)

The **NeedBCLowerBounds** and **NeedBCLowerBounds** method syntaxes have the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *matrixID* | An integer that specifies a matrix of estimates, as described in Settings. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [1].

**Settings**

The settings for *matrixID* are:


| Constant | Value | Description |
| --- | --- | --- |
| SampleCovariances | 13 | Sample covariances. |
| SampleCorrelations | 14 | Sample correlations. |
| SampleMeans | 15 | Sample means. |
| ImpliedCovariances | 10 | The implied covariances among the observed variables in the model. |
| ImpliedCorrelations | 11 | The implied correlations among the observed variables in the model. |
| ImpliedMeans | 12 | The implied means of the observed variables in the model. |
| AllImpliedCovariances | 7 | The implied covariances among all variables in the model, with the exception of residual variables. |
| AllImpliedCorrelations | 8 | The implied correlations among all variables in the model, with the exception of residual variables. |
| AllImpliedMeans | 9 | The implied means of all variables in the model, with the exception of residual variables. |
| DirectEffects | 19 | Direct effects. |
| IndirectEffects | 20 | Indirect effects. |
| TotalEffects | 5 | Total effects. |
| StandardizedDirectEffects | 22 | Standardized direct effects. |
| StandardizedIndirectEffects | 23 | Standardized indirect effects. |
| StandardizedTotalEffects | 21 | Standardized total effects. |
| FactorScoreWeights | 6 | Factor score weights. |

Remarks

In order to use [GetBCLowerBounds](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_getbclowerboundsgetbcupperboundsmethods) (*matrixID*), you must first use **NeedBCLowerBounds** (*matrixID*). For example, you have to use

*object*.**NeedBCLowerBounds** (FactorScoreWeights)

before using

*object*.[GetBCLowerBounds](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_getbclowerboundsgetbcupperboundsmethods) (FactorScoreWeights, …)

Similarly, in order to use [GetBCUpperBounds](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_getbclowerboundsgetbcupperboundsmethods) (*matrixID*), you must first use **NeedBCUpperBounds** (*matrixID*). For example, you have to use

*object*.**NeedBCUpperBounds** (FactorScoreWeights)

before using

*object.*[GetBCUpperBounds](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_getbclowerboundsgetbcupperboundsmethods) (FactorScoreWeights, …)

<a id="t_needbclowerboundsneedbcupperboundsmethodsexample"></a>
###### NeedBCLowerBounds, NeedBCUpperBounds Methods Example

This example demonstrates the **NeedBCLowerBounds** and **NeedBCUpperBounds** methods.

Imports System.Diagnostics Imports AmosEngineLib.AmosEngine.TMatrixID Imports Microsoft.VisualBasic Module MainModule  ' NeedBCLowerBounds, NeedBCUpperBounds Methods Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine  Sem.Bootstrap(2000)  Sem.ConfidenceBC(90) '90% confidence intervals   Sem.NeedBCLowerBounds(FactorScoreWeights)  Sem.NeedBCUpperBounds(FactorScoreWeights)   Sem.Standardized()   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   Dim X(,) As Double  Dim RNames() As String  Dim CNames() As String   'Get the row and column variable names  Sem.RowNames(FactorScoreWeights, RNames)  Sem.ColumnNames(FactorScoreWeights, CNames)   'Print the lower bounds  Sem.GetBCLowerBounds(FactorScoreWeights, X)  Debug.WriteLine(vbCrLf & "Confidence intervals on factor score weights -- lower bound")  PrintMatrix(X, CNames, RNames )  'Print the upper bounds  Sem.GetBCUpperBounds(FactorScoreWeights, X)  Debug.WriteLine(vbCrLf & "Confidence intervals on factor score weights -- upper bound")  PrintMatrix(X, CNames, RNames)   Sem.Dispose()  End Sub   'Print a matrix in the debug window  Sub PrintMatrix(ByVal TheMatrix(,) As Double, ByVal CNames$(), ByVal RNames$())  Dim NRows1 As Integer, NColumns1 As Integer  Dim i As Integer, j As Integer  NRows1 = UBound(RNames)  NColumns1 = UBound(CNames)   Debug.Write(" ")  For j = 0 To NColumns1  Debug.Write(CNames(j).PadLeft(10))  Next   Debug.WriteLine("")  For i = 0 To NRows1  Debug.Write(RNames(i).PadRight(8))  For j = 0 To NColumns1  Debug.Write(TheMatrix(i, j).ToString(".00000").PadLeft(10))  Next  Debug.WriteLine("")  Next  End Sub End Module

<a id="t_needbootsampleestimatesmethod"></a>
###### NeedBootSampleEstimates Method

*Help context ID: 5079*

Declares that [GetBootSampleEstimates](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_getbootsampleestimatesmethod) will be used to get a matrix of estimates from an individual bootstrap sample.

Syntax

*object*.**NeedBootSampleEstimates** (*matrixID*)

The **NeedBootSampleEstimates** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *matrixID* | An integer that specifies a matrix of estimates, as described in Settings. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [1].

**Settings**

The settings for *matrixID* are:


| Constant | Value | Description |
| --- | --- | --- |
| SampleCovariances | 13 | Sample covariances. |
| SampleCorrelations | 14 | Sample correlations. |
| SampleMeans | 15 | Sample means. |
| ImpliedCovariances | 10 | The implied covariances among the observed variables in the model. |
| ImpliedCorrelations | 11 | The implied correlations among the observed variables in the model. |
| ImpliedMeans | 12 | The implied means of the observed variables in the model. |
| AllImpliedCovariances | 7 | The implied covariances among all variables in the model, with the exception of residual variables. |
| AllImpliedCorrelations | 8 | The implied correlations among all variables in the model, with the exception of residual variables. |
| AllImpliedMeans | 9 | The implied means of all variables in the model, with the exception of residual variables. |
| DirectEffects | 19 | Direct effects. |
| IndirectEffects | 20 | Indirect effects. |
| TotalEffects | 5 | Total effects. |
| StandardizedDirectEffects | 22 | Standardized direct effects. |
| StandardizedIndirectEffects | 23 | Standardized indirect effects. |
| StandardizedTotalEffects | 21 | Standardized total effects. |
| FactorScoreWeights | 6 | Factor score weights. |

Remarks

You have to use **NeedBootSampleEstimates** to declare that estimates of a matrix will be needed before you can use [GetBootSampleEstimates](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_getbootsampleestimatesmethod) to obtain the estimates from a bootstrap sample. For example, you have to use

*object*.**NeedBootSampleEstimates** (StandardizedTotalEffects)

before using

*object*.[GetBootSampleEstimates](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_getbootsampleestimatesmethod) (StandardizedTotalEffects, …)

<a id="t_needbootsampleestimatesmethodexample"></a>
###### NeedBootSampleEstimates Method Example

This example demonstrates the **NeedBootSampleEstimates** method.

Imports System.Diagnostics Imports AmosEngineLib.AmosEngine.TMatrixID Imports Microsoft.VisualBasic Module MainModule  ' NeedBootSampleEstimates Method Example  Sub Main()  Const NBootSamples As Integer = 3  Dim i As Integer  Dim X(,) As Double  Dim RNames() As String  Dim CNames() As String  Dim Sem As New AmosEngineLib.AmosEngine   Sem.NeedBootSampleEstimates(FactorScoreWeights)   Sem.Bootstrap(NBootSamples)  Sem.TextOutput()   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   Sem.RowNames(FactorScoreWeights, RNames)  Sem.ColumnNames(FactorScoreWeights, CNames)  For i = 1 To NBootSamples  Sem.GetBootSampleEstimates(FactorScoreWeights, X, i)  Debug.WriteLine("")  Debug.WriteLine("Factor score weights from bootstrap sample #" & i)  Debug.WriteLine("")  PrintMatrix(X, CNames, RNames)  Next   Sem.Dispose()  End Sub   'Print a matrix in the debug window  Sub PrintMatrix(ByVal TheMatrix(,) As Double, ByVal CNames$(), ByVal RNames$())  Dim NRows1 As Integer, NColumns1 As Integer  Dim i As Integer, j As Integer  NRows1 = UBound(RNames)  NColumns1 = UBound(CNames)   Debug.Write(" ")  For j = 0 To NColumns1  Debug.Write(CNames(j).PadLeft(10))  Next   Debug.WriteLine("")  For i = 0 To NRows1  Debug.Write(RNames(i).PadRight(8))  For j = 0 To NColumns1  Debug.Write(TheMatrix(i, j).ToString(".00000").PadLeft(10))  Next  Debug.WriteLine("")  Next  End Sub End Module

<a id="t_needestimatesmethod"></a>
###### NeedEstimates Method

*Help context ID: 5080*

Declares that [GetEstimates](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_getestimatesmethod) will be used to get a matrix of estimates.

Syntax

*object*.**NeedEstimates** (*matrixID*)

The **NeedEstimates** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *matrixID* | An integer that specifies a matrix of estimates, as described in Settings. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [1].

**Settings**

The settings for *matrixID* are:


| Constant | Value | Description |
| --- | --- | --- |
| SampleCovariances | 13 | Sample covariances. |
| SampleCorrelations | 14 | Sample correlations. |
| SampleMeans | 15 | Sample means. |
| ImpliedCovariances | 10 | The implied covariances among the observed variables in the model. |
| ImpliedCorrelations | 11 | The implied correlations among the observed variables in the model. |
| ImpliedMeans | 12 | The implied means of the observed variables in the model. |
| AllImpliedCovariances | 7 | The implied covariances among all variables in the model, with the exception of residual variables. |
| AllImpliedCorrelations | 8 | The implied correlations among all variables in the model, with the exception of residual variables. |
| AllImpliedMeans | 9 | The implied means of all variables in the model, with the exception of residual variables. |
| DirectEffects | 19 | Direct effects. |
| IndirectEffects | 20 | Indirect effects. |
| TotalEffects | 5 | Total effects. |
| StandardizedDirectEffects | 22 | Standardized direct effects. |
| StandardizedIndirectEffects | 23 | Standardized indirect effects. |
| StandardizedTotalEffects | 21 | Standardized total effects. |
| FactorScoreWeights | 6 | Factor score weights. |

Remarks

You have to use **NeedEstimates** to declare that estimates of a matrix will be needed before you can use [GetEstimates](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_getestimatesmethod) to obtain the estimates. For example, you have to use

*object*.**NeedEstimates** (StandardizedTotalEffects)

before using

*object*.[GetEstimates](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_getestimatesmethod) (StandardizedTotalEffects, …)

<a id="t_needestimatesmethodexample"></a>
###### NeedEstimates Method Example

The following program fits Models A and B of Example 11. It displays the matrix of total effects for each group and model.

Imports System.Diagnostics Imports AmosEngineLib.AmosEngine.TMatrixID Imports Microsoft.VisualBasic Module MainModule  ' NeedEstimates Method Example  Sub Main()  Dim CNames() As String, RNames() As String, X(,) As Double  Dim Sem As New AmosEngineLib.AmosEngine   Sem.NeedEstimates(TotalEffects)   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Fels_fem")  Sem.GroupName("girls")  Sem.AStructure("academic = (g1) GPA + (g2) attract + (1) e1")  Sem.AStructure("attract = (g3) height + (g4) weight + (g5) rating + (g6) academic + (1) e2")  Sem.AStructure("e2 <--> e1")   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Fels_mal")  Sem.GroupName("boys")  Sem.AStructure("academic = (b1) GPA + (b2) attract + (1) e1")  Sem.AStructure("attract = (b3) height + (b4) weight + (b5) rating + (b6) academic + (1) e2")  Sem.AStructure("e2 <--> e1")   Sem.Model("Model_A")  Sem.Model("Model_B", "g1=b1", "g2=b2", "g3=b3", "g4=b4", "g5=b5", "g6=b6")   'Print implied covariances for each model and each group  Dim ModelNumber As Integer  Dim GroupNumber As Integer  For ModelNumber = 1 To 2  Sem.FitModel(ModelNumber)  For GroupNumber = 1 To 2  Sem.GetEstimates(TotalEffects, X, GroupNumber)  Sem.ColumnNames(TotalEffects, CNames, GroupNumber)  Sem.RowNames(TotalEffects, RNames, GroupNumber)  Debug.WriteLine(vbCrLf & "Group " & GroupNumber & ", Model " & ModelNumber)  PrintMatrix(X, CNames, RNames)  Next  Next   Sem.Dispose()  End Sub   'Print a matrix in the debug window  Sub PrintMatrix(ByVal TheMatrix(,) As Double, ByVal CNames$(), ByVal RNames$())  Dim NRows1 As Integer, NColumns1 As Integer  Dim i As Integer, j As Integer  NRows1 = UBound(RNames)  NColumns1 = UBound(CNames)   Debug.Write(" ")  For j = 0 To NColumns1  Debug.Write(CNames(j).PadLeft(10))  Next   Debug.WriteLine("")  For i = 0 To NRows1  Debug.Write(RNames(i).PadRight(8))  For j = 0 To NColumns1  Debug.Write(TheMatrix(i, j).ToString(".00000").PadLeft(10))  Next  Debug.WriteLine("")  Next  End Sub End Module

<a id="t_needpclowerboundsneedpcupperboundsmethods"></a>
###### NeedPCLowerBounds, NeedPCUpperBounds Methods

*Help context ID: 5081*

Declares that [GetPCLowerBounds](#t_getpclowerboundsgetpcupperboundsmethods) or [GetPCUpperBounds](#t_getpclowerboundsgetpcupperboundsmethods) will be used later in the program.

Syntax

*object*.**NeedPCLowerBounds** (*matrixID*)

*object*.**NeedPCUpperBounds** (*matrixID*)

The **NeedPCLowerBounds** and **NeedPCLowerBounds** method syntaxes have the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *matrixID* | An integer that specifies a matrix of estimates, as described in Settings. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [1].

**Settings**

The settings for *matrixID* are:


| Constant | Value | Description |
| --- | --- | --- |
| SampleCovariances | 13 | Sample covariances. |
| SampleCorrelations | 14 | Sample correlations. |
| SampleMeans | 15 | Sample means. |
| ImpliedCovariances | 10 | The implied covariances among the observed variables in the model. |
| ImpliedCorrelations | 11 | The implied correlations among the observed variables in the model. |
| ImpliedMeans | 12 | The implied means of the observed variables in the model. |
| AllImpliedCovariances | 7 | The implied covariances among all variables in the model, with the exception of residual variables. |
| AllImpliedCorrelations | 8 | The implied correlations among all variables in the model, with the exception of residual variables. |
| AllImpliedMeans | 9 | The implied means of all variables in the model, with the exception of residual variables. |
| DirectEffects | 19 | Direct effects. |
| IndirectEffects | 20 | Indirect effects. |
| TotalEffects | 5 | Total effects. |
| StandardizedDirectEffects | 22 | Standardized direct effects. |
| StandardizedIndirectEffects | 23 | Standardized indirect effects. |
| StandardizedTotalEffects | 21 | Standardized total effects. |
| FactorScoreWeights | 6 | Factor score weights. |

Remarks

In order to use [GetPCLowerBounds](#t_getpclowerboundsgetpcupperboundsmethods) (*matrixID*), you must first use **NeedPCLowerBounds** (*matrixID*). For example, you have to use

*object*.**NeedPCLowerBounds** (FactorScoreWeights)

before using

*object*.[GetPCLowerBounds](#t_getpclowerboundsgetpcupperboundsmethods) (FactorScoreWeights, …)

Similarly, in order to use [GetPCUpperBounds](#t_getpclowerboundsgetpcupperboundsmethods) (*matrixID*), you must first use **NeedPCUpperBounds** (*matrixID*). For example, you have to use

*object*.**NeedPCUpperBounds** (FactorScoreWeights)

before using

*object*.[GetPCUpperBounds](#t_getpclowerboundsgetpcupperboundsmethods) (FactorScoreWeights, …)

<a id="t_needpclowerboundsneedpcupperboundsmethodsexample"></a>
###### NeedPCLowerBounds, NeedPCUpperBounds Methods Example

This example demonstrates the **NeedPCLowerBounds** and **NeedPCUpperBounds** methods.

Imports System.Diagnostics Imports AmosEngineLib.AmosEngine.TMatrixID Imports Microsoft.VisualBasic Module MainModule  ' NeedPCLowerBounds, NeedPCUpperBounds Methods Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine  Sem.Bootstrap(2000)  Sem.ConfidencePC(90) '90% confidence intervals   Sem.NeedPCLowerBounds(FactorScoreWeights)  Sem.NeedPCUpperBounds(FactorScoreWeights)   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   Dim X(,) As Double  Dim RNames() As String  Dim CNames() As String   'Get the row and column variable names  Sem.RowNames(FactorScoreWeights, RNames)  Sem.ColumnNames(FactorScoreWeights, CNames)   'Print the lower bounds  Sem.GetPCLowerBounds(FactorScoreWeights, X)  Debug.WriteLine(vbCrLf & "Confidence intervals on factor score weights -- lower bound")  PrintMatrix(X, CNames, RNames)   'Print the upper bounds  Sem.GetPCUpperBounds(FactorScoreWeights, X)  Debug.WriteLine(vbCrLf & "Confidence intervals on factor score weights -- upper bound")  PrintMatrix(X, CNames, RNames)   Sem.Dispose()  End Sub   'Print a matrix in the debug window  Sub PrintMatrix(ByVal TheMatrix(,) As Double, ByVal CNames$(), ByVal RNames$())  Dim NRows1 As Integer, NColumns1 As Integer  Dim i As Integer, j As Integer  NRows1 = UBound(RNames)  NColumns1 = UBound(CNames)   Debug.Write(" ")  For j = 0 To NColumns1  Debug.Write(CNames(j).PadLeft(10))  Next   Debug.WriteLine("")  For i = 0 To NRows1  Debug.Write(RNames(i).PadRight(8))  For j = 0 To NColumns1  Debug.Write(TheMatrix(i, j).ToString(".00000").PadLeft(10))  Next  Debug.WriteLine("")  Next  End Sub End Module

<a id="t_needstandarderrorsmethod"></a>
###### NeedStandardErrors Method

*Help context ID: 5083*

Declares that the [GetStandardErrors](#t_getstandarderrorsmethod) method will be used to obtain bootstrap standard errors for the elements of a matrix of estimates.

Syntax

*object*.**NeedStandardErrors** (*matrixID*)

The **NeedStandardErrors** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *matrixID* | An integer that specifies a matrix of estimates, as described in Settings. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [1].

**Settings**

The settings for *matrixID* are:


| Constant | Value | Description |
| --- | --- | --- |
| SampleCovariances | 13 | Sample covariances. |
| SampleCorrelations | 14 | Sample correlations. |
| SampleMeans | 15 | Sample means. |
| ImpliedCovariances | 10 | The implied covariances among the observed variables in the model. |
| ImpliedCorrelations | 11 | The implied correlations among the observed variables in the model. |
| ImpliedMeans | 12 | The implied means of the observed variables in the model. |
| AllImpliedCovariances | 7 | The implied covariances among all variables in the model, with the exception of residual variables. |
| AllImpliedCorrelations | 8 | The implied correlations among all variables in the model, with the exception of residual variables. |
| AllImpliedMeans | 9 | The implied means of all variables in the model, with the exception of residual variables. |
| DirectEffects | 19 | Direct effects. |
| IndirectEffects | 20 | Indirect effects. |
| TotalEffects | 5 | Total effects. |
| StandardizedDirectEffects | 22 | Standardized direct effects. |
| StandardizedIndirectEffects | 23 | Standardized indirect effects. |
| StandardizedTotalEffects | 21 | Standardized total effects. |
| FactorScoreWeights | 6 | Factor score weights. |

Remarks

You have to use **NeedStandardErrors** to declare that standard errors for a matrix will be needed before you can use [GetStandardErrors](#t_getstandarderrorsmethod) to obtain the standard errors. For example, you have to use

*object*.**NeedStandardErrors** (StandardizedTotalEffects)

before using

object.[GetStandardErrors](#t_getstandarderrorsmethod) (StandardizedTotalEffects, …)

<a id="t_needstandarderrorsmethodexample"></a>
###### NeedStandardErrors Method Example

This example demonstrates the **NeedStandardErrors** method.

Imports System.Diagnostics Imports AmosEngineLib.AmosEngine.TMatrixID Imports Microsoft.VisualBasic Module MainModule  ' NeedStandardErrors Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine  Sem.NeedStandardErrors(FactorScoreWeights)   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   Dim X(,) As Double  Dim RNames() As String  Dim CNames() As String   'Get the row and column variable names  Sem.RowNames(FactorScoreWeights, RNames)  Sem.ColumnNames(FactorScoreWeights, CNames)   'Print the standard errors  Sem.GetStandardErrors(FactorScoreWeights, X)  Debug.WriteLine(vbCrLf & "Standard errors for factor score weights")  PrintMatrix(X, CNames, RNames)   Sem.Dispose()  End Sub   'Print a matrix in the debug window  Sub PrintMatrix(ByVal TheMatrix(,) As Double, ByVal CNames$(), ByVal RNames$())  Dim NRows1 As Integer, NColumns1 As Integer  Dim i As Integer, j As Integer  NRows1 = UBound(RNames)  NColumns1 = UBound(CNames)   Debug.Write(" ")  For j = 0 To NColumns1  Debug.Write(CNames(j).PadLeft(10))  Next   Debug.WriteLine("")  For i = 0 To NRows1  Debug.Write(RNames(i).PadRight(8))  For j = 0 To NColumns1  Debug.Write(TheMatrix(i, j).ToString(".00000").PadLeft(10))  Next  Debug.WriteLine("")  Next  End Sub End Module

<a id="t_nonpositivemethod"></a>
###### NonPositive Method

*Help context ID: 5084*

Controls whether Amos attempts to obtain maximum likelihood estimates when a sample covariance matrix is not positive definite.

Syntax

*object*.**NonPositive** ()

*object*.**NonPositive** (*tf*)

The **NonPositive** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *tf* | Optional. If *tf* is True (default), Amos attempts to obtain maximum likelihood estimates even when a sample covariance matrix is not positive definite. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [1].

Default

Amos reports an error if you attempt a maximum likelihood analysis when a sample covariance matrix fails to be positive definite.

Remarks

When you use the **NonPositive** method, Amos does not try to test the hypothesis that your model is correct against the usual alternative that the population moments are unconstrained.

[Wothke (1993)](https://ai-docs.amosdevelopment.com/08-references.md#t_wothke_1993) discusses the problem of covariance matrices that are not positive definite.

See Also

[AllowUnidentified Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_allowunidentifiedmethod)

<a id="t_nonpositivemethodexample"></a>
###### NonPositive Method Example

This example demonstrates the **NonPositive** method.

Module MainModule  ' NonPositive Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine   Sem.NonPositive()   Sem.TextOutput()   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   Sem.Dispose()  End Sub End Module

<a id="t_normalitycheckmethod"></a>
###### NormalityCheck Method

*Help context ID: 5085*

**Controls the reporting of** statistics for assessing multivariate normality of the observed variables.

Syntax

*object*.**NormalityCheck** ()

*object*.**NormalityCheck** (*tf*)

The **NormalityCheck** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *tf* | Optional. If *tf* is True (the default), statistics for assessing normality are reported. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [1].

Default

Statistics for assessing normality are not reported.

<a id="t_normalitycheckmethodexample"></a>
###### NormalityCheck Method Example

This example demonstrates the **NormalityCheck** method.

Module MainModule  ' NormalityCheck Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine   Sem.NormalityCheck()   Sem.TextOutput()   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   Sem.Dispose()  End Sub End Module

<a id="t_discussionofexample1"></a>
###### Discussion of Example

In the [example](#t_normalitycheckmethodexample), **NormalityCheck** produces the following output.

**Assessment of normality (Group number 1)**


| Variable | min | max | skew | c.r. | kurtosis | c.r. |
| --- | --- | --- | --- | --- | --- | --- |
| wordmean | 2.000 | 41.000 | .575 | 2.004 | -.212 | -.370 |
| sentence | 4.000 | 28.000 | -.836 | -2.915 | .537 | .936 |
| paragraph | 2.000 | 19.000 | .374 | 1.305 | -.239 | -.416 |
| lozenges | 3.000 | 36.000 | .833 | 2.906 | .127 | .221 |
| cubes | 9.000 | 37.000 | -.131 | -.457 | 1.439 | 2.510 |
| visperc | 11.000 | 45.000 | -.406 | -1.418 | -.281 | -.490 |
| Multivariate |   |   |   |   | 3.102 | 1.353 |

The first row of the table shows that the lowest **wordmean** score was 2 and the highest was 41. **wordmean** had a *sample skewness* of

$\frac{\sum_{i=1}^{N}\left(x_{i}-\bar{x}\right)^{3}}{N \hat{s}^{3}}=.575$,

where $\hat{s}^{2}$ is the unbiased variance estimate $\hat{s}^{2}=\sum\left(x_{i}-\bar{x}\right)^{2} /(N-1)$. Assuming normality, skewness has a mean of zero and a standard error of $\sqrt{6 / N}=.287$. The critical ratio 2.004 in the **c.r.** column is the sample skewness divided by its standard error.

**wordmean** has a *sample kurtosis* of

$\frac{\sum_{i=1}^{N}\left(x_{i}-\bar{x}\right)^{4}}{N \hat{s}^{4}}-3=-212$.

Assuming normality, kurtosis has a mean of zero and a standard error of $\sqrt{24 / N}=.573$. The critical ratio, –.370, is the sample kurtosis divided by its standard error.

The table has a separate row for each observed variable. A final row, labeled 'multivariate', contains Mardia's ([Mardia, 1970](https://ai-docs.amosdevelopment.com/08-references.md#t_mardia_1970); [Mardia, 1974](https://ai-docs.amosdevelopment.com/08-references.md#t_mardia_1974)) coefficient of *multivariate kurtosis*

$\frac{1}{N} \sum_{i=1}^{N}\left[\left(\mathbf{x}_{i}-\overline{\mathbf{x}}\right)^{\prime} \hat{\mathbf{S}}^{-1}\left(\mathbf{x}_{i}-\overline{\mathbf{x}}\right)\right]^{2}-\frac{p(p+2)(N-1)}{N+1}=3.102$,

where $\mathbf{x}_{i}$is the *i*-th observation on the *p* observed variables, $\overline{\mathbf{x}}$ is the vector of their means and $\hat{\mathbf{S}}^{-1}$ is the unbiased estimate of their population covariance matrix. Assuming normality, this coefficient has a mean of zero and a standard error of $\sqrt{8 p(p+2) / N}=2.294$. The critical ratio obtained by dividing the sample coefficient by its standard error is 1.353, as shown in the **c.r.** column.

Assuming normality in very large samples, each of the critical values shown in the table above is an observation on a standard normally distributed random variable. Even with a very large sample, however, the table is of limited use. All it does is to quantify the departure from normality in the sample and provide a rough test of whether the departure is statistically significant. Unfortunately, this is not enough. In order to make use of this information you also need to know how robust your chosen estimation method is against the departure from normality that you have discovered. A departure from normality that is big enough to be significant could still be small enough to be harmless.

The following table, also produced by **NormalityCheck** from the Grnt_fem data, provides additional evidence on the question of normality.

**Observations farthest from the centroid (Mahalanobis distance) (Group number 1)**


| Observation number | Mahalanobis d-squared | p1 | p2 |
| --- | --- | --- | --- |
| 42 | 18.747 | .005 | .286 |
| 20 | 17.201 | .009 | .130 |
| 3 | 13.264 | .039 | .546 |
| 35 | 12.954 | .044 | .397 |
| 28 | 12.730 | .048 | .266 |

Only the first five rows of the table are shown here. Specifically, the table focuses on the occurrence of outliers, individual observations that differ markedly from the general run of observations. The table lists the observations that are furthest from the centroid of all observations, using as the distance measure for the *i*-th observation the squared Mahalanobis distance, $d_{i}^{2}=\left(\mathbf{x}_{i}-\overline{\mathbf{x}}\right)^{\prime} \hat{\mathbf{S}}^{-1}\left(\mathbf{x}_{i}-\overline{\mathbf{x}}\right)$. Mardia's coefficient of multivariate kurtosis can be written $\sum d_{i}^{4} / N-p(p+2)(N-1) /(N+1)$. The first row of the table shows that observation number 42 is furthest from the centroid with $d_{42}^{2}=18.747$. The **p1** column shows that, assuming normality, the probability of $d_{42}^{2}$ (or any individual $d_{i}^{2}$) exceeding 18.747 is .005. The **p2** column shows, still assuming normality, that the probability is .268 that the largest $d_{i}^{2}$ would exceed 18.747. The second row of the table shows that: Observation number 20 is the second furthest observation from the centroid with $d_{20}^{2}=17.201$. The probability of any arbitrary $d_{i}^{2}$ exceeding 17.201 is .009. The probability of the second largest $d_{i}^{2}$ exceeding 17.201 is .130. Small numbers in the **p1** column are to be expected. Small numbers in the **p2** column, on the other hand, indicate observations that are improbably far from the centroid under the hypothesis of normality. For the Grnt_fem data, none of the probabilities in the **p2** column is very small, so there is no evidence that any of the five most unusual observations should be treated as outliers under the assumption of normality. See [Bollen (1987)](https://ai-docs.amosdevelopment.com/08-references.md#t_bollen_1987) for a discussion of the importance of checking for outliers.

<a id="t_nparmethod"></a>
###### Npar Method

*Help context ID: 5087*

Gets the number of model parameters.

Syntax

*object*.**Npar** ()

The **Npar** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [3].

Remarks

If you have used the [Model](#t_modelmethod) method to define more than one model, the **Npar** method returns the number of parameters for the most recently fitted model. The second example shows how to obtain the number of parameters for multiple models.

See Also

[Df Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_dfmethod)

<a id="t_nparmethodexample1"></a>
###### Npar Method Example 1

The following program shows how to display various fit measures when only one model is defined (i.e., when the [Model](#t_modelmethod) method has been used only once or not at all).

Imports System.Diagnostics Module MainModule  ' Npar Method Example 1  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   Debug.WriteLine("Chi Square = " & Sem.Cmin)  Debug.WriteLine("Degrees of Freedom = " & Sem.df)  Debug.WriteLine("p = " & Sem.p)  Debug.WriteLine("Number of parameters = " & Sem.npar)  Debug.WriteLine("Noncentrality parameter = " & Sem.Ncp & " (" & _  Sem.NcpLo & ", " & Sem.NcpHi & ")")  Debug.WriteLine("Rmsea = " & Sem.Rmsea & " (" & Sem.RmseaLo & ", " & Sem.RmseaHi & ")")  Debug.WriteLine("Test of close fit, p = " & Sem.Pclose)   Sem.Dispose()  End Sub End Module

<a id="t_nparmethodexample2"></a>
###### Npar Method Example 2

The following program shows how to display various fit measures for multiple models (i.e., when the [Model](#t_modelmethod) method has been used more than once).

Imports System.Diagnostics Module MainModule  ' Npar Method Example 2  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine  Dim i As Integer   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (a) spatial + (1) err_v")  Sem.AStructure("cubes = (b) spatial + (1) err_c")  Sem.AStructure("lozenges = (c) spatial + (1) err_l")  Sem.AStructure("paragraph = (d) verbal + (1) err_p")  Sem.AStructure("sentence = (e) verbal + (1) err_s")  Sem.AStructure("wordmean = (f) verbal + (1) err_w")  Sem.Var("spatial", 1)  Sem.Var("verbal", 1)   Sem.Model("Congeneric")  Sem.Model("tau-equivalent", "a = b = c", "d = e = f")   For i = 1 To 2  Debug.WriteLine("")  Debug.WriteLine("Model number " & i)  Sem.FitModel(i)  Debug.WriteLine("Chi Square = " & Sem.Cmin)  Debug.WriteLine("Degrees of Freedom = " & Sem.df)  Debug.WriteLine("p = " & Sem.p)  Debug.WriteLine("Number of parameters = " & Sem.npar)  Debug.WriteLine("Noncentrality parameter = " & Sem.Ncp & " (" & Sem.NcpLo & _  ", " & Sem.NcpHi & ")")  Debug.WriteLine("Rmsea = " & Sem.Rmsea & " (" & Sem.RmseaLo & ", " & Sem.RmseaHi & ")")  Debug.WriteLine("Test of close fit, p = " & Sem.Pclose)  Next   Sem.Dispose()  End Sub End Module

<a id="t_7773"></a>
###### NumberOfColumns Method

Gets the number of columns in a matrix of estimates.

Syntax

*object*.**NumberOfColumns** (*matrixID*)

*object*.**NumberOfColumns** (*matrixID, groupNumber*)

The **NumberOfColumns** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *matrixID* | An integer that specifies a matrix of estimates, as described in Settings. |
| *groupNumber* | Optional. A group number. The first group is group number 1. If *groupNumber* is omitted, the first group is used. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [3].

**Settings**

The settings for *matrixID* are:


| Constant | Value | Description |
| --- | --- | --- |
| SampleCovariances | 13 | Sample covariances. |
| SampleCorrelations | 14 | Sample correlations. |
| SampleMeans | 15 | Sample means. |
| ImpliedCovariances | 10 | The implied covariances among the observed variables in the model. |
| ImpliedCorrelations | 11 | The implied correlations among the observed variables in the model. |
| ImpliedMeans | 12 | The implied means of the observed variables in the model. |
| AllImpliedCovariances | 7 | The implied covariances among all variables in the model, with the exception of residual variables. |
| AllImpliedCorrelations | 8 | The implied correlations among all variables in the model, with the exception of residual variables. |
| AllImpliedMeans | 9 | The implied means of all variables in the model, with the exception of residual variables. |
| DirectEffects | 19 | Direct effects. |
| IndirectEffects | 20 | Indirect effects. |
| TotalEffects | 5 | Total effects. |
| StandardizedDirectEffects | 22 | Standardized direct effects. |
| StandardizedIndirectEffects | 23 | Standardized indirect effects. |
| StandardizedTotalEffects | 21 | Standardized total effects. |
| FactorScoreWeights | 6 | Factor score weights. |

Remarks

In order to use **NumberOfColumns** (*matrixID*), you must first use [NeedEstimates](#t_needestimatesmethod) (*matrixID*). For example, you have to use

*object*.[NeedEstimates](#t_needestimatesmethod) (FactorScoreWeights)

before using

*object*.**NumberOfColumns** (FactorScoreWeights, …)

<a id="t_numberofgroupsmethod"></a>
###### NumberOfGroups Method

*Help context ID: 5088*

Gets the number of groups.

Syntax

*object*.**NumberOfGroups** ()

The **NumberOfGroups** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [3].

<a id="t_numberofgroupsmethodexample"></a>
###### NumberOfGroups Method Example

This example demonstrates the **NumberOfGroups** method.

Imports System.Diagnostics Imports AmosEngineLib.AmosEngine.TMatrixID Module MainModule  ' NumberOfGroups Method Example  Sub Main()  Dim CNumbers() As Long, RNumbers() As Long, X() As Double  Dim Sem As New AmosEngineLib.AmosEngine  Sem.NeedEstimates(TotalEffects)   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Fels_fem")  Sem.GroupName("girls")  Sem.AStructure("academic = (g1) GPA + (g2) attract + (1) e1")  Sem.AStructure("attract = (g3) height + (g4) weight + (g5) rating + (g6) academic + (1) e2")  Sem.AStructure("e2 <--> e1")   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Fels_mal")  Sem.GroupName("boys")  Sem.AStructure("academic = (b1) GPA + (b2) attract + (1) e1")  Sem.AStructure("attract = (b3) height + (b4) weight + (b5) rating + (b6) academic + (1) e2")  Sem.AStructure("e2 <--> e1")   Debug.WriteLine("Number of groups = " & Sem.NumberOfGroups)   Sem.Dispose()  End Sub End Module

<a id="t_numberofparametersmethod"></a>
###### NumberOfParameters Method

*Help context ID: 5089*

Gets the number of model parameters, not taking into account any parameter constraints specified with the [Model](#t_modelmethod) method.

Syntax

*object*.**NumberOfParameters** ()

The **NumberOfVariables** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [3].

<a id="t_numberofparametersmethodexample"></a>
###### NumberOfParameters Method Example

This example demonstrates the **NumberOfParameters** method.

Imports System.Diagnostics Module MainModule  ' NumberOfParameters Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine  Dim i As Integer   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = (a) spatial + (1) err_c")  Sem.AStructure("lozenges = (b) spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = (c) verbal + (1) err_s")  Sem.AStructure("wordmean = (d) verbal + (1) err_w")   Debug.WriteLine("There are " & Sem.NumberOfParameters & " parameters")  Debug.WriteLine("The 3rd parameter is called " & Sem.ParameterName(3))  Debug.WriteLine("'a' is parameter number " & Sem.ParameterNumber("a"))  Debug.WriteLine("The value of 'a' is " & Sem.ParameterValue("a"))  Debug.WriteLine("The value of the 3rd parameter is " & Sem.ParameterValue(3))   Sem.Dispose()  End Sub End Module

<a id="t_7774"></a>
###### NumberOfRows Method

Gets the number of rows in a matrix of estimates.

Syntax

*object*.**NumberOfRows** (*matrixID*)

*object*.**NumberOfRows** (*matrixID, groupNumber*)

The **NumberOfRows** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *matrixID* | An integer that specifies a matrix of estimates, as described in Settings. |
| *groupNumber* | Optional. A group number. The first group is group number 1. If *groupNumber* is omitted, the first group is used. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [3].

**Settings**

The settings for *matrixID* are:


| Constant | Value | Description |
| --- | --- | --- |
| SampleCovariances | 13 | Sample covariances. |
| SampleCorrelations | 14 | Sample correlations. |
| SampleMeans | 15 | Sample means. |
| ImpliedCovariances | 10 | The implied covariances among the observed variables in the model. |
| ImpliedCorrelations | 11 | The implied correlations among the observed variables in the model. |
| ImpliedMeans | 12 | The implied means of the observed variables in the model. |
| AllImpliedCovariances | 7 | The implied covariances among all variables in the model, with the exception of residual variables. |
| AllImpliedCorrelations | 8 | The implied correlations among all variables in the model, with the exception of residual variables. |
| AllImpliedMeans | 9 | The implied means of all variables in the model, with the exception of residual variables. |
| DirectEffects | 19 | Direct effects. |
| IndirectEffects | 20 | Indirect effects. |
| TotalEffects | 5 | Total effects. |
| StandardizedDirectEffects | 22 | Standardized direct effects. |
| StandardizedIndirectEffects | 23 | Standardized indirect effects. |
| StandardizedTotalEffects | 21 | Standardized total effects. |
| FactorScoreWeights | 6 | Factor score weights. |

Remarks

In order to use **NumberOfRows** (*matrixID*), you must first use [NeedEstimates](#t_needestimatesmethod) (*matrixID*). For example, you have to use

*object*.[NeedEstimates](#t_needestimatesmethod) (FactorScoreWeights)

before using

*object*.**NumberOfRows** (FactorScoreWeights, …)

<a id="t_numberofvariablesmethod"></a>
###### NumberOfVariables Method

*Help context ID: 5145*

Gets the number of variables in the model for one group.

Syntax

*object*.**NumberOfVariables** ()

*object*.**NumberOfVariables** (*groupNumber*)

The **NumberOfVariables** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *groupNumber* | Optional group number. The first group is group number 1. If *groupNumber* is omitted, the first group is used. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [3].

<a id="t_numberofvariablesmethodexample"></a>
###### NumberOfVariables Method Example

This example demonstrates the **NumberOfVariables** method.

Imports System.Diagnostics Module MainModule  ' NumberOfVariables Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   'List all of the variables in the model  Dim i As Integer  For i = 1 To Sem.NumberOfVariables  Debug.WriteLine(i.ToString.PadLeft(3) & " " & Sem.Variablename(i))  Next   'What is the variable number of "cubes"?  Debug.WriteLine("")  Debug.WriteLine("""cubes"" is variable number " & Sem.VariableNumber("cubes"))   Sem.Dispose()  End Sub End Module

<a id="t_ovariablecountmethod"></a>
###### OVariableCount Method

*Help context ID: 5092*

Specifies the number of observed variables in the model.

Syntax

*object*.**OVariableCount** (*nVariables*)

The **OVariableCount** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *nVariables* | The number of observed variables in the model. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [2].

Default

When the **OVariableCount** method is not used, no error checking is done based on the number of observed variables.

Remarks

Amos checks *nVariables *for consistency with the model and the data file. If a discrepancy is found, Amos reports the discrepancy and quits. Spelling or typing errors are frequently detected by this check, since two variant spellings of a variable name will be treated as references to two distinct variables.

In a multiple-group analysis, the **OvariableCount** method can be used once per group.

See Also

[UVariableCount Method](#t_uvariablecountmethod)

[VariableCount Method](#t_variablecountmethod)

<a id="t_ovariablecountmethodexample"></a>
###### OVariableCount Method Example

This example demonstrates the **OVariableCount** method.

Module MainModule  ' OVariableCount Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine  Sem.TextOutput()   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   Sem.OVariableCount(6)  Sem.UVariableCount(8)  Sem.VariableCount(14)   Sem.Dispose()  End Sub End Module

<a id="t_pmethod"></a>
###### P Method

*Help context ID: 5093*

Gets the "*p* value" for testing the null hypothesis that the specified model is correct.

Syntax

*object*.**P** ()

The **P** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [3].

Remarks

If you have used the [Model](#t_modelmethod) method to define more than one model, the **P** method gets the *p* value for the most recently fitted model. The second example shows how to obtain the *p* value for multiple models.

<a id="t_pmethodexample1"></a>
###### P Method Example 1

The following program shows how to obtain various fit measures when only one model is defined (i.e., when the [Model](#t_modelmethod) method has been used only once or not at all).

Imports System.Diagnostics Module MainModule  ' P Method Example 1  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   Debug.WriteLine("Chi Square = " & Sem.Cmin)  Debug.WriteLine("Degrees of Freedom = " & Sem.df)  Debug.WriteLine("p = " & Sem.p)  Debug.WriteLine("Number of parameters = " & Sem.npar)  Debug.WriteLine("Noncentrality parameter = " & Sem.Ncp & " (" & _  Sem.NcpLo & ", " & Sem.NcpHi & ")")  Debug.WriteLine("Rmsea = " & Sem.Rmsea & " (" & Sem.RmseaLo & ", " & Sem.RmseaHi & ")")  Debug.WriteLine("Test of close fit, p = " & Sem.Pclose)   Sem.Dispose()  End Sub End Module

<a id="t_pmethodexample2"></a>
###### P Method Example 2

The following program shows how to obtain various fit measures for multiple models (i.e., when the [Model](#t_modelmethod) method has been used more than once).

Imports System.Diagnostics Module MainModule  ' P Method Example 2  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine  Dim i As Integer   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (a) spatial + (1) err_v")  Sem.AStructure("cubes = (b) spatial + (1) err_c")  Sem.AStructure("lozenges = (c) spatial + (1) err_l")  Sem.AStructure("paragraph = (d) verbal + (1) err_p")  Sem.AStructure("sentence = (e) verbal + (1) err_s")  Sem.AStructure("wordmean = (f) verbal + (1) err_w")  Sem.Var("spatial", 1)  Sem.Var("verbal", 1)   Sem.Model("Congeneric")  Sem.Model("tau-equivalent", "a = b = c", "d = e = f")   For i = 1 To 2  Debug.WriteLine("")  Debug.WriteLine("Model number " & i)  Sem.FitModel(i)  Debug.WriteLine("Chi Square = " & Sem.Cmin)  Debug.WriteLine("Degrees of Freedom = " & Sem.df)  Debug.WriteLine("p = " & Sem.p)  Debug.WriteLine("Number of parameters = " & Sem.npar)  Debug.WriteLine("Noncentrality parameter = " & Sem.Ncp & " (" & _  Sem.NcpLo & ", " & Sem.NcpHi & ")")  Debug.WriteLine("Rmsea = " & Sem.Rmsea & " (" & Sem.RmseaLo & ", " & Sem.RmseaHi & ")")  Debug.WriteLine("Test of close fit, p = " & Sem.Pclose)  Next   Sem.Dispose()  End Sub End Module

<a id="t_packsymmetricestimatesmethod"></a>
###### PackSymmetricEstimates Method

*Help context ID: 5170*

Controls whether the [GetEstimates](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_getestimatesmethod) returns symmetric matrices as square two-dimensional arrays or as one-dimensional arrays that contain only the lower triangle.

Syntax

*object*.**PackSymmetricEstimates** (*tf*)

The **PackSymmetricEstimates** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *tf* | If *tf* is False, symmetric matrices are returned as square two-dimensional arrays. If *tf* is True, symmetric matrices are returned as one-dimensional arrays, with the elements in the lower triangle stored in the order x(0,0), x(1,0), x(1,1),.... |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [1].

Default

If the **PackSymmetricEstimates** method is not used, symmetric matrices are returned as square two-dimensional arrays.

Remarks

**PackSymmetricEstimates** does not affect [GetEstimatesEx](#t_getestimatesexmethod).

<a id="t_pagelengthmethod"></a>
###### PageLength Method

*Help context ID: 5094*

The **PageLength** method has no effect. It is provided for compatibility with earlier versions of Amos.

Syntax

*object*.**PageLength** (*nLines*)

The **PageLength** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *nLines* | The number of lines per page. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [1].

<a id="t_paginatemethod"></a>
###### Paginate Method

*Help context ID: 5095*

The **Paginate** method has no effect. It is provided for compatibility with earlier versions of Amos.

Syntax

*object*.**Paginate** (*tf*)

The **Paginate** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *tf* | If *tf* is True (default), the text output file is paginated. Otherwise, not. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [1].

<a id="t_parametercovariancemethod"></a>
###### ParameterCovariance Method

*Help context ID: 5149*

Gets the covariance between two parameter estimates.

Syntax 1

*result* = *object*.**ParameterCovariance** (*parameterIndex*)

*result* = *object*.**ParameterCovariance** (*parameterIndex1, parameterIndex2*)

*result* = *object*.**ParameterCovariance** (*parameterName*)

*result* = *object*.**ParameterCovariance** (*parameterName1, parameterName2*)

The **ParameterCovariance** method syntax 1 has the following parts:


| Part | Description |
| --- | --- |
| *result* | The covariance between two parameters or the variance of a single parameter. |
| *object* | An object of type **AmosEngine**. |
| *parameterIndex* *parameterIndex1* *parameterIndex2* | Parameter indices. Parameters are numbered starting with 1. |
| *parameterName* *parameterName1* *parameterName2* | Parameter names. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [3].

See Also

[ParameterName Method](#t_parameternamemethod)

[ParameterNumber Method](#t_parameternumbermethod)

[ParameterValue Method](#t_parametervaluemethod)

<a id="t_parametercovariancemethodexample"></a>
###### ParameterCovariance Method Example

The following program, based on Example 8, displays the error variances and their standard errors. Then it displays the correlation between two of the error variances.

Imports System Imports System.Diagnostics Module MainModule  ' ParameterCovariance Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine  Sem.Standardized()  Sem.Smc()   Sem.BeginGroup(AmosEngine.AmosDir & "\Examples\English\userguide.xls", "grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")  'Give parameter names to the error variances.  Sem.Var("err_v", "verr_v")  Sem.Var("err_c", "verr_c")  Sem.Var("err_l", "verr_l")  Sem.Var("err_p", "verr_p")  Sem.Var("err_s", "verr_s")  Sem.Var("err_w", "verr_w")   Debug.WriteLine("Error variances, and their standard deviations:")  Debug.Write("verr_v: " & Sem.ParameterValue("verr_v"))  Debug.WriteLine(Math.Sqrt(Sem.ParameterCovariance("verr_v")))  Debug.Write("verr_c: " & Sem.ParameterValue("verr_c"))  Debug.WriteLine(Math.Sqrt(Sem.ParameterCovariance("verr_c")))  Debug.Write("verr_l: " & Sem.ParameterValue("verr_l"))  Debug.WriteLine(Math.Sqrt(Sem.ParameterCovariance("verr_l")))  Debug.Write("verr_p: " & Sem.ParameterValue("verr_p"))  Debug.WriteLine(Math.Sqrt(Sem.ParameterCovariance("verr_p")))  Debug.Write("verr_s: " & Sem.ParameterValue("verr_s"))  Debug.WriteLine(Math.Sqrt(Sem.ParameterCovariance("verr_s")))  Debug.Write("verr_w: " & Sem.ParameterValue("verr_w"))  Debug.WriteLine(Math.Sqrt(Sem.ParameterCovariance("verr_w")))  Debug.WriteLine("")   Debug.Write("The correlation between ""verr_v"" and ""verr_c"" is ")  Dim Numerator As Double, Denominator As Double  Numerator = sem.ParameterCovariance("verr_v", "verr_c")  Denominator = Math.Sqrt(Sem.ParameterCovariance("verr_v") \* _  Sem.ParameterCovariance("verr_c"))  Debug.WriteLine(Numerator / Denominator)   Sem.Dispose()  End Sub End Module

<a id="t_parameterinfomethod"></a>
###### ParameterInfo Method

*Help context ID: 5167*

Get information about the parameter that is specified by an index number, based on an arbitrary ordering of model parameters. The first parameter is parameter number 1.

Syntax

*object*.**ParameterInfo** (*parameterNumber, groupNumber, parameterType, leftVariable, rightVariable*)

The **ParameterInfo** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *parameterNumber* | Input: A whole number between 1 and n, where n is the number of parameters. |
| *groupNumber* | Output: When the parameter specified by *parameterNumber* is associated with one group only, then *groupNumber* is that group's number. The first group is group number 1. |
| *parameterType* | Output: An integer that tells what kind of parameter is specified by *parameterNumber*. The possible values are 1 (regression weight), 2 (mean), 3 (intercept), 4 (covariance) and 5 (variance). |
| *leftVariable, rightVariable* | Integers that specify two variables. (Use the [VariableName](#t_variablenamemethod) method to get their names.) If the parameter specified by *parameterNumber* is a regression weight, *leftVariable* refers to the dependent variable, *rightVariable* to the independent variable. If the parameter specified by *parameterNumber* is a covariance, it is the covariance between *leftVariable* and *rightVariable*. If the parameter specified by *parameterNumber* is a variance, it is the variance of *leftVariable*. (*rightVariable* is the same as *leftVariable*.) If the parameter specified by *parameterNumber* is a mean, it is the mean of *leftVariable*. (The value returned for *rightVariable* is undefined.) |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [3].

See Also

[ParameterName Method](#t_parameternamemethod)

[ParameterNumber Method](#t_parameternumbermethod)

[ParameterValue Method](#t_parametervaluemethod)

<a id="t_parameterinfomethodexample"></a>
###### ParameterInfo Method Example

The following program fits the model of Example 8. Then it displays a list of the model parameters.

Imports System.Diagnostics Module MainModule  ' ParameterInfo Method Example  Dim Sem As New AmosEngineLib.AmosEngine  Sub Main()  Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\Grnt_fem.sav")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragrap = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   Dim i As Integer  For i = 1 To Sem.NumberOfParameters  Debug.WriteLine(i & " " & ParameterPicture(i))  Next   Sem.Dispose()  End Sub   Function ParameterPicture(ByVal ParameterNumber As Integer) As String  Dim GroupNumber As Integer  Dim ParameterType As Integer  Dim LeftVariable As Integer  Dim RightVariable As Integer  Dim S As String  Dim vname1 As String  Dim vname2 As String   Sem.ParameterInfo(ParameterNumber, _  GroupNumber, ParameterType, _  LeftVariable, RightVariable)   vname1 = Sem.Variablename(LeftVariable)  vname2 = Sem.Variablename(RightVariable)  Select Case ParameterType  Case 1  S = vname1 & "<--" & vname2  Case 2  S = vname1 & " mean"  Case 3  S = vname1 & " intercept"  Case 4  S = vname1 & "<->" & vname2  Case 5  S = vname1 & " variance"  End Select  If Sem.NumberOfGroups > 1 Then  S = "Group " & GroupNumber & " " & S  End If  S = "[" & S & "]"  ParameterPicture = S  End Function End Module

<a id="t_parameternamemethod"></a>
###### ParameterName Method

*Help context ID: 5096*

Gets the name of a parameter, given its parameter number.

Syntax

*object*.**ParameterName** (*parameterNumber*)

The **ParameterName** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *parameterNumber* | A parameter number. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [3].

See Also

[ParameterNumber Method](#t_parameternumbermethod)

<a id="t_parameternamemethodexample"></a>
###### ParameterName Method Example

This example demonstrates the **ParameterName** method.

Imports System.Diagnostics Module MainModule  ' ParameterName Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine  Dim i As Integer   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = (a) spatial + (1) err_c")  Sem.AStructure("lozenges = (b) spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = (c) verbal + (1) err_s")  Sem.AStructure("wordmean = (d) verbal + (1) err_w")   Debug.WriteLine("There are " & Sem.NumberOfParameters & " parameters")  Debug.WriteLine("The 3rd parameter is called " & Sem.ParameterName(3))  Debug.WriteLine("'a' is parameter number " & Sem.ParameterNumber("a"))  Debug.WriteLine("The value of 'a' is " & Sem.ParameterValue("a"))  Debug.WriteLine("The value of the 3rd parameter is " & Sem.ParameterValue(3))   Sem.Dispose()  End Sub End Module

<a id="t_parameternumbermethod"></a>
###### ParameterNumber Method

*Help context ID: 5097*

Gets a parameter number, given its name.

A "parameter number" is a parameter's position on Amos's internal parameter list. The first parameter on the list is parameter number 1. Some methods refer to model parameters by number (*i.e.*, by list position).

Syntax

*object*.**ParameterNumber** (*ParameterName*)

The **ParameterNumber** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *ParameterName* | A parameter name. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [3].

<a id="t_parameternumbermethodexample"></a>
###### ParameterNumber Method Example

This example demonstrates the **ParameterNumber** method.

Imports System.Diagnostics Module MainModule  ' ParameterNumber Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine  Dim i As Integer   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = (a) spatial + (1) err_c")  Sem.AStructure("lozenges = (b) spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = (c) verbal + (1) err_s")  Sem.AStructure("wordmean = (d) verbal + (1) err_w")   Debug.WriteLine("There are " & Sem.NumberOfParameters & " parameters")  Debug.WriteLine("The 3rd parameter is called " & Sem.ParameterName(3))  Debug.WriteLine("'a' is parameter number " & Sem.ParameterNumber("a"))  Debug.WriteLine("The value of 'a' is " & Sem.ParameterValue("a"))  Debug.WriteLine("The value of the 3rd parameter is " & Sem.ParameterValue(3))   Sem.Dispose()  End Sub End Module

<a id="t_parametervaluemethod"></a>
###### ParameterValue Method

*Help context ID: 5098*

Gets a parameter value, given either a parameter name or a parameter number.

Syntax

*object*.**ParameterValue** (*parameterIndex*)

*object*.**ParameterValue** (*parameterName*)

The **ParameterValue** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *parameterIndex* | (Integer) A parameter index. Parameters are numbered starting with 1. |
| *parameterName* | (String) A parameter name. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [3].

See Also

[ParameterName Method](#t_parameternamemethod)

[ParameterNumber Method](#t_parameternumbermethod)

<a id="t_parametervaluemethodexample"></a>
###### ParameterValue Method Example

This example demonstrates the **ParameterValue** method.

Imports System.Diagnostics Module MainModule  ' ParameterValue Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine  Dim i As Integer   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = (a) spatial + (1) err_c")  Sem.AStructure("lozenges = (b) spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = (c) verbal + (1) err_s")  Sem.AStructure("wordmean = (d) verbal + (1) err_w")   Debug.WriteLine("There are " & Sem.NumberOfParameters & " parameters")  Debug.WriteLine("The 3rd parameter is called " & Sem.ParameterName(3))  Debug.WriteLine("'a' is parameter number " & Sem.ParameterNumber("a"))  Debug.WriteLine("The value of 'a' is " & Sem.ParameterValue("a"))  Debug.WriteLine("The value of the 3rd parameter is " & Sem.ParameterValue(3))   Sem.Dispose()  End Sub End Module

<a id="t_parametervectormethod"></a>
###### ParameterVector Method

*Help context ID: 5157*

Gets the values of all free parameters.

Syntax

*object*.**ParameterVector** (*x*)

The **ParameterVector** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *x* | An array of type double dimensioned in the calling program as **Dim x() as Double** On return from **ParameterVector**, *x* is a 1-dimensional array containing the vector of free parameters. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [3].

See Also

[Use the AmosEngine class to evaluate derivatives numerically and display the results with the Amos Debug class](https://ai-docs.amosdevelopment.com/06-programming-with-amos-part-3.md#t_usetheamosengineclasstoevaluatederivativesnumericallyanddisplaytheresultswiththeamosdebugclass)

<a id="t_pathmethod"></a>
###### Path Method

*Help context ID: 5100*

Specifies a regression weight as a model parameter.

Syntax

*object*.**Path** (*leftVariableName*, *rightVariableName*)

*object*.**Path** (*leftVariableName*, *rightVariableName*, *parameterValue*)

*object*.**Path** (*leftVariableName*, *rightVariableName*, *parameterName*)

The **Path** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *leftVariableName* *rightVariableName* | The character strings, *leftVariableName* and *rightVariableName*, are the names of two variables. *leftVariableName* depends linearly on *rightVariableName*. That is, *leftVariableName* is on the left-hand side of a regression equation and *rightVariableName* appears on the right-hand side with a regression weight that is a model parameter. |
| *parameterValue* | (Optional) Parameter value. If *parameterValue* = 3, say, then the regression weight is fixed at 3. |
| *parameterName* | (Optional) Parameter name. If parameterName = "abc", say, then the regression weight is named "abc". It is constrained to be equal to any other parameters named "abc". If parameterName = "3?", say then the regression weight is given an initial value of 3, and is unconstrained. If parameterName = "abc:3", say, then the regression weight is named "abc" and is given an initial value of 3. It is constrained to be equal to any other parameters named "abc". If parameterName is an empty string (""), the regression weight is an unconstrained parameter. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [2].

Default

A variable is assumed not to depend directly on another variable unless a linearly dependency is specified by use of the **Path** or [AStructure](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_structuremethod) method.

Remarks

If *parameterValue *and *parameterName* are omitted, the regression weight is an unconstrained parameter.

<a id="t_pathmethodexample"></a>
###### Path Method Example

The following program uses the **Path**, [Cov](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_covmethod) and [Var](#t_varmethod) methods to specify Model C of Example 6.

Module MainModule  ' Path Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine  Sem.TextOutput()  Sem.Standardized()  Sem.Smc()  Sem.AllImpliedMoments()  Sem.FactorScoreWeights()  Sem.TotalEffects()   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Wheaton")  Sem.Path("anomia67", "67_alienation", 1)  Sem.Path("anomia67", "eps1", 1)  Sem.Path("powles67", "67_alienation", "path_p")  Sem.Path("powles67", "eps2", 1)  Sem.Path("anomia71", "71_alienation", 1)  Sem.Path("anomia71", "eps3", 1)  Sem.Path("powles71", "71_alienation", "path_p")  Sem.Path("powles71", "eps4", 1)  Sem.Path("67_alienation", "ses")  Sem.Path("67_alienation", "zeta1", 1)  Sem.Path("71_alienation", "67_alienation")  Sem.Path("71_alienation", "ses")  Sem.Path("71_alienation", "zeta2", 1)  Sem.Path("education", "ses", 1)  Sem.Path("education", "delta1", 1)  Sem.Path("SEI", "ses")  Sem.Path("SEI", "delta2", 1)  Sem.Cov("eps3", "eps1")  Sem.Var("eps1", "var_a")  Sem.Var("eps2", "var_p")  Sem.Var("eps3", "var_a")  Sem.Var("eps4", "var_p")   Sem.Dispose()  End Sub End Module

<a id="t_pclosemethod"></a>
###### Pclose Method

*Help context ID: 5101*

Gets the "*p* value" for testing the null hypothesis that RMSEA is less than .05 in the population. ([Browne & Cudeck, 1993](https://ai-docs.amosdevelopment.com/08-references.md#t_browne__cudeck_1993))

Syntax

*object*.**Pclose** ()

The **Pclose** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [3].

Remarks

If you have used the [Model](#t_modelmethod) method to define more than one model, the **Pclose** method gets the *p* value for the most recently fitted model. The second example shows how to obtain the *p* value for multiple models.

<a id="t_pclosemethodexample1"></a>
###### Pclose Method Example 1

The following program shows how to display various fit measures when only one model is defined (i.e., when the [Model](#t_modelmethod) method has been used only once or not at all).

Imports System.Diagnostics Module MainModule  *' Pclose Method Example 1*  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   Debug.WriteLine("Chi Square = " & Sem.Cmin)  Debug.WriteLine("Degrees of Freedom = " & Sem.df)  Debug.WriteLine("p = " & Sem.p)  Debug.WriteLine("Number of parameters = " & Sem.npar)  Debug.WriteLine("Noncentrality parameter = " & Sem.Ncp & " (" & _  Sem.NcpLo & ", " & Sem.NcpHi & ")")  Debug.WriteLine("Rmsea = " & Sem.Rmsea & " (" & Sem.RmseaLo & ", " & Sem.RmseaHi & ")")  Debug.WriteLine("Test of close fit, p = " & Sem.Pclose)   Sem.Dispose()  End Sub End Module

<a id="t_pclosemethodexample2"></a>
###### Pclose Method Example 2

The following program shows how to display various fit measures for multiple models (i.e., when the [Model](#t_modelmethod) method has been used more than once).

Imports System.Diagnostics Module MainModule  ' Pclose Method Example 2  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine  Dim i As Integer   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (a) spatial + (1) err_v")  Sem.AStructure("cubes = (b) spatial + (1) err_c")  Sem.AStructure("lozenges = (c) spatial + (1) err_l")  Sem.AStructure("paragraph = (d) verbal + (1) err_p")  Sem.AStructure("sentence = (e) verbal + (1) err_s")  Sem.AStructure("wordmean = (f) verbal + (1) err_w")  Sem.Var("spatial", 1)  Sem.Var("verbal", 1)   Sem.Model("Congeneric")  Sem.Model("tau-equivalent", "a = b = c", "d = e = f")   For i = 1 To 2  Debug.WriteLine("")  Debug.WriteLine("Model number " & i)  Sem.FitModel(i)  Debug.WriteLine("Chi Square = " & Sem.Cmin)  Debug.WriteLine("Degrees of Freedom = " & Sem.df)  Debug.WriteLine("p = " & Sem.p)  Debug.WriteLine("Number of parameters = " & Sem.npar)  Debug.WriteLine("Noncentrality parameter = " & Sem.Ncp & " (" & _  Sem.NcpLo & ", " & Sem.NcpHi & ")")  Debug.WriteLine("Rmsea = " & Sem.Rmsea & " (" & Sem.RmseaLo & ", " & Sem.RmseaHi & ")")  Debug.WriteLine("Test of close fit, p = " & Sem.Pclose)  Next   Sem.Dispose()  End Sub End Module

<a id="t_permutemethod"></a>
###### Permute Method

*Help context ID: 5102*

Performs a permutation test ([Arbuckle, 1994b](https://ai-docs.amosdevelopment.com/08-references.md#t_arbuckle_1994b)) of the specified model.

Syntax

*object*.**Permute** (*x*)

The **Permute** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *x* | An integer. If *x* = 0, the permutation test is based on all permutations of the observed variables. If *x* is positive, the permutation test is based on *x* random permutations. If *x* is negative, no permutation test is performed. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [1].

Default

No permutation test is performed.

Remarks

Bootstrapping cannot be performed at the same time as the permutation test. That is, you can't execute both the **Permute** and the [Bootstrap](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_bootstrapmethod) methods in the same program.

See Also

[PermuteDetail Method](#t_permutedetailmethod)

<a id="t_permutemethodexample"></a>
###### Permute Method Example

The following program performs a permutation test of [Jöreskog and Sörbom's (1989, p. 205)](https://ai-docs.amosdevelopment.com/08-references.md#t_joereskog__soerbom_1989) Model D for the data of [Wheaton et al. (1977)](https://ai-docs.amosdevelopment.com/08-references.md#t_wheaton__muthen__alwin__summer).

Module MainModule  ' Permute Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine  Sem.TextOutput()  Sem.Iterations(100)  Sem.Permute(0) 'All permutations  Sem.PermuteDetail()   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Wheaton")  Sem.Path("anomia67", "67_alienation", 1)  Sem.Path("anomia67", "eps1", 1)  Sem.Path("powles67", "67_alienation")  Sem.Path("powles67", "eps2", 1)  Sem.Path("anomia71", "71_alienation", 1)  Sem.Path("anomia71", "eps3", 1)  Sem.Path("powles71", "71_alienation")  Sem.Path("powles71", "eps4", 1)  Sem.Path("67_alienation", "ses")  Sem.Path("67_alienation", "zeta1", 1)  Sem.Path("71_alienation", "67_alienation")  Sem.Path("71_alienation", "ses")  Sem.Path("71_alienation", "zeta2", 1)  Sem.Path("education", "ses", 1)  Sem.Path("education", "delta1", 1)  Sem.Path("SEI", "ses")  Sem.Path("SEI", "delta2", 1)  Sem.Var("eps1", "var1")  Sem.Var("eps2", "var2")  Sem.Var("eps3", "var3")  Sem.Var("eps4", "var4")  Sem.Cov("eps1", "eps3", "cov1")  Sem.Cov("eps2", "eps4", "cov2")   Sem.Dispose()  End Sub End Module

<a id="t_discussionofexample2"></a>
###### Discussion of Example

Here is a portion of the output from the example.


| Matrix Permutations Test (Model 1) Summary (Model 1) Of 719 permutations: 15 permutations improved the model fit or left it unchanged. 86 permutations resulted in a model that could not be fitted. 618 permutations resulted in a higher discrepancy function. Of the remaining permutations: 0 resulted in inadmissible estimates and unstable systems. 0 resulted in inadmissible estimates. 0 resulted in unstable systems. p = 16 / 720 = .022 |
| --- |

With six observed variables, there are 720 possible permutations -- 719, if you don't count the permutation that leaves each observed variable in its original position. Of the 719 non-identity permutations, 15 made the discrepancy function smaller or left it unchanged. 617 of the permutations made the discrepancy function larger. 86 permutations resulted in a model for which Amos could not find a solution. As noted above, failures are to be expected in fitting a series of generally bad models. The question is, how do you classify the models for which no solution was found? Can it be assumed that each one of those models is worse than the original model? In other words, can you assume that, whenever Amos fails, it's the model's fault rather than Amos's?

Experience shows that Amos's failures to find solutions are *almost* always due to bad models (or samples that are too small). But not always. Therefore, there may be an objection to lumping the 86 permutations that produced an unfittable model together with the 617 permutations that produced a worse fitting model, on the grounds that doing so could result in an overcount of the number of permutations that make the model worse.

With these considerations in mind, Amos follows the convention that unfittable models are "worse than" the model being evaluated. Then out of 720 permutations (including the identity permutation), there are 16 permutations that produce a model that fits as well as or better than the original model. (The original model itself is one of those 16.). In other words, if you picked a model at random out of those generated by permuting the observed variables, there is a probability of 16/720 = .022 of getting a model as good as the one that Jöreskog and Sörbom proposed.

It is possible for an Amos solution to be inadmissible or to consist of an unstable linear system, although neither of these problems arose in the present example. There needs to be a policy on permutations that produce a model with a lower discrepancy function than was obtained for the original model, but for which an inadmissible solution or an unstable system occurs. Amos adheres to the following policy. First of all, if the original model results in an inadmissible solution, Amos disregards the admissibility status of estimates for models that are generated by permutations. Also, if the original model results in an unstable system, Amos ignores any instability that occurs in linear systems that result from permutations. If the original model yields an admissible solution with a stable system of linear equations, Amos reports the number of permutations that lower the discrepancy function while producing an inadmissible solution or an unstable system, and follows the convention that such permutations are harmful (*i.e.*, that they make a model worse).

The frequency of inadmissible solutions and unstable systems is summarized as follows for the present example.


| Of the remaining permutations: 0 resulted in inadmissible estimates and unstable systems. 0 resulted in inadmissible estimates. 0 resulted in unstable systems. |
| --- |

Of the 15 permutations that resulted in a discrepancy function that was as good as or better than that of the original model, all were in fact exactly as good - none were better. Examination of the output from the [PermuteDetail](#t_permutedetailmethod) method reveals that these 15 models are equivalent to the original model in the sense of [Stelzl (1986)](https://ai-docs.amosdevelopment.com/08-references.md#t_stelzl_1986), [Lee and Hershberger (1990)](https://ai-docs.amosdevelopment.com/08-references.md#t_lee__hershberger_1990) and [MacCallum, et al. (1993)](https://ai-docs.amosdevelopment.com/08-references.md#t_maccallum__et_al__1993).

In principal, it would be possible to reduce the computational requirements of the permutation test by fitting one representative model from each set of equivalent models. Amos does not do this, however. More importantly, the fact that the "permuted" models come in clusters of equivalent models has a bearing on the interpretation of the permutation test. In the current example, for instance, the proportion of permuted models that fit as well as or better than the original model cannot take on just any of the values 1/720, 2/720, 3/720,.... Instead, the proportion is restricted to the values 16/720, 32/720, 48/720,.... The number of possible *p* values is still 720/16 = 45, and so it remains an interesting question what the value of *p* is. However, a serious problem arises when the number of permutations that leave the fit of the model invariant is very large, so that the number of distinct discrepancy function values that can occur is very small. To take an extreme case, consider the common factor model with one common factor, and no parameter constraints other than those required to make the model identified. No permutation of the observed variables will affect the fit of the model, and it will not be possible to apply the permutation test in a meaningful way.

<a id="t_permutedetailmethod"></a>
###### PermuteDetail Method

*Help context ID: 5103*

Gives detailed information about the solution obtained for each permutation when the [Permute](#t_permutemethod) method is used. First the permutation itself is reported. (That is, the new location of each observed variable in the model is shown after the permutation is carried out.) Then, if a solution is found, the value of the discrepancy function is reported along with a notation of whether the solution was admissible and whether the resulting linear system was stable.

Syntax

*object*.**PermuteDetail** ()

*object*.**PermuteDetail** (*tf*)

The **PermuteDetail** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *tf* | Optional. A boolean value that controls the reporting of information about each permutation. True (default) requests the output. False suppresses it |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [1].

Default

Detailed information about each permutation is not reported.

<a id="t_permutedetailmethodexample"></a>
###### PermuteDetail Method Example

The following program performs a permutation test of [Jöreskog and Sörbom's (1989](https://ai-docs.amosdevelopment.com/08-references.md#t_joereskog__soerbom_1989), p. 205) Model D for the data of [Wheaton et al. (1977)](https://ai-docs.amosdevelopment.com/08-references.md#t_wheaton__muthen__alwin__summer).

Module MainModule  ' PermuteDetail Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine  Sem.TextOutput()  Sem.Iterations(100)   Sem.Permute(0) 'All permutations  Sem.PermuteDetail()   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Wheaton")  Sem.Path("anomia67", "67_alienation", 1)  Sem.Path("anomia67", "eps1", 1)  Sem.Path("powles67", "67_alienation")  Sem.Path("powles67", "eps2", 1)  Sem.Path("anomia71", "71_alienation", 1)  Sem.Path("anomia71", "eps3", 1)  Sem.Path("powles71", "71_alienation")  Sem.Path("powles71", "eps4", 1)  Sem.Path("67_alienation", "ses")  Sem.Path("67_alienation", "zeta1", 1)  Sem.Path("71_alienation", "67_alienation")  Sem.Path("71_alienation", "ses")  Sem.Path("71_alienation", "zeta2", 1)  Sem.Path("education", "ses", 1)  Sem.Path("education", "delta1", 1)  Sem.Path("SEI", "ses")  Sem.Path("SEI", "delta2", 1)  Sem.Var("eps1", "var1")  Sem.Var("eps2", "var2")  Sem.Var("eps3", "var3")  Sem.Var("eps4", "var4")  Sem.Cov("eps1", "eps3", "cov1")  Sem.Cov("eps2", "eps4", "cov2")   Sem.Dispose()  End Sub End Module

<a id="t_putparametervaluemethod"></a>
###### PutParameterValue Method

*Help context ID: 5154*

Assigns a value to a parameter.

Syntax

*object*.**PutParameterValue** (*parameterIndex, parameterValue*)

*object*.**PutParameterValue** (*parameterName, parameterValue*)

The **PutParameterValue** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *parameterIndex* | (Integer) A parameter index. Parameters are numbered starting with 1. |
| *parameterName* | (String) A parameter name. |
| *parameterValue* | (Double) New parameter value. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [3].

See Also

[Use the AmosEngine class to evaluate derivatives numerically and display the results with the Amos Debug class](https://ai-docs.amosdevelopment.com/06-programming-with-amos-part-3.md#t_usetheamosengineclasstoevaluatederivativesnumericallyanddisplaytheresultswiththeamosdebugclass)

<a id="t_putparametervectormethod"></a>
###### PutParameterVector Method

*Help context ID: 5158*

Assigns values to the vector of free parameters.

Syntax

*object*.**PutParameterVector** (*x*)

The **PutParameterVector** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *x* | A 1-dimensional array of type double. *x* must be dimensioned to have exactly one element for each parameter. The first parameter is in *x*(0). (The number of parameters can be obtained with the [NumberOfParameters](#t_numberofparametersmethod) method.) |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [3].

See Also

[Use the AmosEngine class to evaluate derivatives numerically and display the results with the Amos Debug class](https://ai-docs.amosdevelopment.com/06-programming-with-amos-part-3.md#t_usetheamosengineclasstoevaluatederivativesnumericallyanddisplaytheresultswiththeamosdebugclass)

<a id="t_putsamplecovariancesmethod"></a>
###### PutSampleCovariances Method

*Help context ID: 5155*

Assigns values to the matrix of sample covariances. This method should not be used if means/intercepts are explicit model parameters, because it sets the vector of sample means to zero. (Use [PutSampleMoments](#t_putsamplemomentsmethod) instead.)

Syntax

*object*.**PutSampleCovariances** (*covarianceMatrix*)

*object*.**PutSampleCovariances** (*covarianceMatrix, groupNumber*)

The **PutSampleCovariances** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *covarianceMatrix* | A two-dimensional array of type double. The dimensions of *covarianceMatrix* must exactly match the dimensions of the sample covariance matrix. |
| *groupNumber* | Optional. A group number. The first group is group number 1. If *groupNumber* is omitted, the first group is used. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [3].

Remarks

One technique for performing sampling studies consists of the repeated use of **PutSampleCovariances** and [FitModel](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_fitmodelmethod).

See Also

[Use the AmosEngine class to test for scale- and location-invariance](https://ai-docs.amosdevelopment.com/06-programming-with-amos-part-3.md#t_usetheamosengineclasstotestforscaleandlocationinvariance)

<a id="t_putsamplecovariancespackedmethod"></a>
###### PutSampleCovariancesPacked Method

*Help context ID: 5171*

Assigns values to the matrix of sample covariances, where sample covariances are stored as a one-dimensional array. This method should not be used if means/intercepts are explicit model parameters, because it sets the vector of sample means to zero. (Use [PutSampleMomentsPacked](#t_putsamplemomentspackedmethod) instead.) If your sample covariances are stored in a two-dimensional array, use [PutSampleCovariances](#t_putsamplecovariancesmethod).

Syntax

*object*.**PutSampleCovariancesPacked** (*covarianceMatrix*)

*object*.**PutSampleCovariancesPacked** (*covarianceMatrix*, *groupNumber*)

The **PutSampleCovariancesPacked** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *covarianceMatrix* | A one-dimensional array of type double. The lower triangular elements of *covarianceMatrix* should be stored in the order x(0,0), x(1,0), x(1,1),..... |
| *groupNumber* | Optional. A group number. The first group is group number 1. If *groupNumber* is omitted, the first group is used. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [3].

Remarks

One efficient technique for performing a sampling study is to loop through the following sequence.

1. Generate a new sample covariance matrix.
2. Use **PutSampleCovariancesPacked**.
3. Use [FitModel](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_fitmodelmethod).

<a id="t_putsamplemomentsmethod"></a>
###### PutSampleMoments Method

*Help context ID: 5156*

Assigns values to the sample covariances and the sample means.

Syntax

*object*.**PutSampleMoments** (*covariancesBase0, meansBase0*)

*object*.**PutSampleMoments** (*covariancesBase0, meansBase0, groupNumber*)

The **PutSampleMoments** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *covariancesBase0* | A two-dimensional array of type double. The dimensions of *covariancesBase0* must exactly match the dimensions of the sample covariance matrix. |
| *meansBase0* | A one-dimensional array of type double. The number of elements in *meansBase0* must equal the number of observed variables in the model. |
| *groupNumber* | Optional. A group number. The first group is group number 1. If *groupNumber* is omitted, the first group is used. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [3].

Remarks

One technique for performing sampling studies consists of the repeated use of **PutSampleMoments** and [FitModel](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_fitmodelmethod).

See Also

[Use the AmosEngine class to test for scale- and location-invariance](https://ai-docs.amosdevelopment.com/06-programming-with-amos-part-3.md#t_usetheamosengineclasstotestforscaleandlocationinvariance)

<a id="t_putsamplemomentspackedmethod"></a>
###### PutSampleMomentsPacked Method

*Help context ID: 5172*

Assigns values to the sample covariances and the sample means when sample covariances are stored as a one-dimensional array.

Syntax

*object*.**PutSampleMomentsPacked** (*covariances*, *means*)

*object*.**PutSampleMomentsPacked** (*covariances*, *means*, *groupNumber*)

The **PutSampleMomentsPacked** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *covariances* | A one-dimensional array of type double. The lower triangular elements of *covariances* should be stored in the order x(0,0), x(1,0), x(1,1),..... |
| *means* | A one-dimensional array of type double. The number of elements in *means* must equal the number of observed variables in the model. |
| *groupNumber* | Optional. A group number. The first group is group number 1. If *groupNumber* is omitted, the first group is used. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [3].

Remarks

One efficient technique for performing a sampling study is to loop through the following sequence.

1. Generate a new sample covariance matrix.
2. Use **PutSampleMomentsPacked**.
3. Use [FitModel](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_fitmodelmethod).

<a id="t_residualmomentsmethod"></a>
###### ResidualMoments Method

*Help context ID: 5105*

Controls reporting of the difference between the sample covariance matrix and the implied covariance matrix. If means and intercepts are explicitly modeled, the **ResidualMoments** method also controls reporting of differences between sample means and implied means.

Syntax

*object*.**ResidualMoments** ()

*object*.**ResidualMoments** (*tf*)

The **ResidualMoments** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *tf* | Optional. A boolean value that controls the reporting of residual moments. True (default) requests the output. False suppresses it. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [1].

Default

Residual moments are not reported.

See Also

[Admissible Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_admissiblemethod)

[ImpliedMoments Method](#t_impliedmomentsmethod)

[SampleMoments Method](#t_samplemomentsmethod)

<a id="t_residualmomentsmethodexample"></a>
###### ResidualMoments Method Example

This example demonstrates the **ResidualMoments** method.

Module MainModule  ' ResidualMoments Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine  Sem.ResidualMoments()  Sem.TextOutput()   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   Sem.Dispose()  End Sub End Module

<a id="t_revisemodelmethod"></a>
###### ReviseModel Method

*Help context ID: 5159*

Changes the constraints on a model that was previously defined by the [Model](#t_modelmethod) method. There are some limitations on the extent to which a model can be changed.

Syntax

*object*.**ReviseModel** (*modelName*, *constraint1*)

*object*.**ReviseModel** (*modelName*, *constraint1*, *constraint2*)

*object*.**ReviseModel** (*modelName*, *constraint1*, *constraint2*, *constraint3*)

...

The **ReviseModel** method syntax is identical to the [Model](#t_modelmethod) method syntax. The **ReviseModel** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *modelName* | The name of a model previously defined by the [Model](#t_modelmethod) method. |
| *constraint1* | Either: A string of the form p1=p2=p3=..., where each pi is either a parameter name or a number. At most one of the pi can be a number. Or: The name of another model. |
| *constraint2* | Same as constraint1 |
| *constraint3* | Same as constraint1 |
| ... | ... |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [3].

Remarks

The constraints expressed by *constraint1*, *constraint2*,… replace the constraints of the original model. There are the following limitations on the changes model changes that can be made by **ReviseModel**.

The number of equality constraints in the revised model cannot exceed the number of constraints in the original model. For example, the **ReviseModel** method in following program fragment raises an error because it attempts to create four constraints on a model that originally had only three.

…

Dim Sem As New AmosEngine

…

Sem.Model "Model 1", "a=0", "b=0", "c=0"

…

Sem.**ReviseModel** "Model 1", "u=v=w=x=0"

…

The constraints in the revised model may only employ constants of 0, 1, or constants that have been previously been assigned to parameter values with the [Model](#t_modelmethod), [AStructure](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_structuremethod), [MStructure](#t_mstructuremethod), [Path](#t_pathmethod), [Cov](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_covmethod), [Var](#t_varmethod), [Mean](#t_meanmethod), or [Intercept](#t_interceptmethod) methods.

<a id="t_revisemodelmethodexample"></a>
###### ReviseModel Method Example

The following program performs an all-possible-subsets regression analysis with the model of Example 4.

Imports System.Diagnostics Module MainModule  ' ReviseModel Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Warren5v")  Sem.AStructure("performance = (b1) knowledge + (b2) value + (b3) satisfaction + (1) error")   'Define a model with three constraints.  'Subsequently, no revised model can have more than three constraints.  Sem.Model("Model 1", "b1 = b2 = b3 = 0")  Subset(Sem, "b1 = b2 = b3 = 0", "no predictors")  Debug.WriteLine("-------------------------------")  Subset(Sem, "b1 = b2 = 0", "satisfaction")  Subset(Sem, "b2 = b3 = 0", "knowledge")  Subset(Sem, "b1 = b3 = 0", "value")  Debug.WriteLine("-------------------------------")  Subset(Sem, "b1 = 0", "value, satisfaction")  Subset(Sem, "b2 = 0", "knowledge, satisfaction")  Subset(Sem, "b3 = 0", "knowledge, value")  Debug.WriteLine("-------------------------------")  Subset(Sem, "", "knowledge, value, satisfaction")   Sem.Dispose()  End Sub   Sub Subset(ByVal Sem As AmosEngineLib.AmosEngine, ByVal Constraints As String, ByVal Predictors As String)  Sem.ReviseModel("Model 1", Constraints)  If Sem.FitModel = 0 Then  Debug.Write(Sem.Cmin)  Else  Debug.Write("Failed")  End If  Debug.WriteLine(" " & Predictors)  End Sub End Module

<a id="t_rmsearmsealormseahimethods"></a>
###### Rmsea, RmseaLo, RmseaHi Methods

*Help context ID: 5106*

Gets a point estimate of the root mean square error of approximation (RMSEA). **RmseaLo** and **RmseaHi** get the lower and upper boundaries of a 90% confidence interval for the RMSEA.

Syntax

*object*.**Rmsea** ()

*object*.**RmseaLo** ()

*object*.**RmseaHi** ()

The **Rmsea**, **RmseaLo** and **RmseaHi** method syntaxes have the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [3].

Remarks

If you have used the [Model](#t_modelmethod) method to define more than one model, the **Rmsea**, **RmseaLo** and **RmseaHi** methods return estimates for the most recently fitted model. The second example shows how to obtain estimates for multiple models.

<a id="t_rmsearmsealoandrmseahimethodsexample1"></a>
###### Rmsea, RmseaLo and RmseaHi Methods Example 1

The following program shows how to display various fit measures when only one model is defined (i.e., when the [Model](#t_modelmethod) method has been used only once or not at all).

Imports System.Diagnostics Module MainModule  ' Rmsea, RmseaLo and RmseaHi Methods Example 1  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   Debug.WriteLine("Chi Square = " & Sem.Cmin)  Debug.WriteLine("Degrees of Freedom = " & Sem.df)  Debug.WriteLine("p = " & Sem.p)  Debug.WriteLine("Number of parameters = " & Sem.npar)  Debug.WriteLine("Noncentrality parameter = " & Sem.Ncp & " (" & _  Sem.NcpLo & ", " & Sem.NcpHi & ")")  Debug.WriteLine("Rmsea = " & Sem.Rmsea & " (" & Sem.RmseaLo & ", " & Sem.RmseaHi & ")")  Debug.WriteLine("Test of close fit, p = " & Sem.Pclose)   Sem.Dispose()  End Sub End Module

<a id="t_rmsearmsealoandrmseahimethodsexample2"></a>
###### Rmsea, RmseaLo and RmseaHi Methods Example 2

The following program shows how to obtain various fit measures for multiple models (i.e., when the [Model](#t_modelmethod) method has been used more than once).

Imports System.Diagnostics Module MainModule  ' Rmsea, RmseaLo and RmseaHi Methods Example 2  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine  Dim i As Integer   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (a) spatial + (1) err_v")  Sem.AStructure("cubes = (b) spatial + (1) err_c")  Sem.AStructure("lozenges = (c) spatial + (1) err_l")  Sem.AStructure("paragraph = (d) verbal + (1) err_p")  Sem.AStructure("sentence = (e) verbal + (1) err_s")  Sem.AStructure("wordmean = (f) verbal + (1) err_w")  Sem.Var("spatial", 1)  Sem.Var("verbal", 1)   Sem.Model("Congeneric")  Sem.Model("tau-equivalent", "a = b = c", "d = e = f")   For i = 1 To 2  Debug.WriteLine("")  Debug.WriteLine("Model number " & i)  Sem.FitModel(i)  Debug.WriteLine("Chi Square = " & Sem.Cmin)  Debug.WriteLine("Degrees of Freedom = " & Sem.df)  Debug.WriteLine("p = " & Sem.p)  Debug.WriteLine("Number of parameters = " & Sem.npar)  Debug.WriteLine("Noncentrality parameter = " & Sem.Ncp & " (" & Sem.NcpLo & ", " & Sem.NcpHi & ")")  Debug.WriteLine("Rmsea = " & Sem.Rmsea & " (" & Sem.RmseaLo & ", " & Sem.RmseaHi & ")")  Debug.WriteLine("Test of close fit, p = " & Sem.Pclose)  Next   Sem.Dispose()  End Sub End Module

<a id="t_rownamesmethod"></a>
###### RowNames Method

*Help context ID: 5109*

Obtains the variable names associated with the rows of a matrix of estimates.

Syntax

*object*.**RowNames** (*matrixID*, *theRowNames*)

*object*.**RowNames** (*matrixID*, *theRowNames*, *groupNumber*)

The **RowNames** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *matrixID* | An integer that specifies a matrix of estimates, as described in Settings |
| *theRowNames* | A string array declared in the calling program as **Dim theRowNames() as String** The Amos Engine will redimension the array. |
| *groupNumber* | Optional. A group number. The first group is group number 1. If *groupNumber* is omitted, the first group is used. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [3].

**Settings**

The settings for *matrixID* are:


| Constant | Value | Description |
| --- | --- | --- |
| SampleCovariances | 13 | Sample covariances. |
| SampleCorrelations | 14 | Sample correlations. |
| SampleMeans | 15 | Sample means. |
| ImpliedCovariances | 10 | The implied covariances among the observed variables in the model. |
| ImpliedCorrelations | 11 | The implied correlations among the observed variables in the model. |
| ImpliedMeans | 12 | The implied means of the observed variables in the model. |
| AllImpliedCovariances | 7 | The implied covariances among all variables in the model, with the exception of residual variables. |
| AllImpliedCorrelations | 8 | The implied correlations among all variables in the model, with the exception of residual variables. |
| AllImpliedMeans | 9 | The implied means of all variables in the model, with the exception of residual variables. |
| DirectEffects | 19 | Direct effects. |
| IndirectEffects | 20 | Indirect effects. |
| TotalEffects | 5 | Total effects. |
| StandardizedDirectEffects | 22 | Standardized direct effects. |
| StandardizedIndirectEffects | 23 | Standardized indirect effects. |
| StandardizedTotalEffects | 21 | Standardized total effects. |
| FactorScoreWeights | 6 | Factor score weights. |

Remarks

The [NeedEstimates](#t_needestimatesmethod) method must be used to give notice that a particular matrix of estimates will be needed before the **RowNames** method can be used to obtain the row names for that matrix. For example, you have to use

*object*.[NeedEstimates](#t_needestimatesmethod) (ImpliedMeans)

before using

*object*.**RowNames** (ImpliedMeans, …)

<a id="t_rownamesmethodexample"></a>
###### RowNames Method Example

The following program fits Models A and B of Example 11. It displays the matrix of total effects for each group and model.

Imports System.Diagnostics Imports AmosEngineLib.AmosEngine.TMatrixID Imports Microsoft.VisualBasic Module MainModule  ' RowNames Method Example  Sub Main()  Dim CNames() As String, RNames() As String, X(,) As Double  Dim Sem As New AmosEngineLib.AmosEngine  Sem.NeedEstimates(TotalEffects)   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Fels_fem")  Sem.GroupName("girls")  Sem.AStructure("academic = (g1) GPA + (g2) attract + (1) e1")  Sem.AStructure( _  "attract = (g3) height + (g4) weight + (g5) rating + (g6) academic + (1) e2")  Sem.AStructure("e2 <--> e1")  Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Fels_mal")  Sem.GroupName("boys")  Sem.AStructure("academic = (b1) GPA + (b2) attract + (1) e1")  Sem.AStructure( _  "attract = (b3) height + (b4) weight + (b5) rating + (b6) academic + (1) e2")  Sem.AStructure("e2 <--> e1")   Sem.Model("Model_A")  Sem.Model("Model_B", "g1=b1", "g2=b2", "g3=b3", "g4=b4", "g5=b5", "g6=b6")   'Print total effects for each model and each group  Dim ModelNumber As Integer  Dim GroupNumber As Integer   For ModelNumber = 1 To 2  Sem.FitModel(ModelNumber)  For GroupNumber = 1 To 2  Sem.GetEstimates(TotalEffects, X, GroupNumber)  Sem.ColumnNames(TotalEffects, CNames, GroupNumber)  Sem.RowNames(TotalEffects, RNames, GroupNumber)  Debug.WriteLine(vbCrLf & "Group " & GroupNumber & ", Model " & ModelNumber)  PrintMatrix(X, CNames, RNames)  Next  Next   Sem.Dispose()  End Sub   'Print a matrix in the debug window  Sub PrintMatrix(ByVal TheMatrix(,) As Double, ByVal CNames$(), ByVal RNames$())  Dim NRows1 As Integer, NColumns1 As Integer  Dim i As Integer, j As Integer  NRows1 = UBound(RNames)  NColumns1 = UBound(CNames)   Debug.Write(" ")  For j = 0 To NColumns1  Debug.Write(CNames(j).PadLeft(10))  Next   Debug.WriteLine("")  For i = 0 To NRows1  Debug.Write(RNames(i).PadRight(8))  For j = 0 To NColumns1  Debug.Write(TheMatrix(i, j).ToString(".00000").PadLeft(10))  Next  Debug.WriteLine("")  Next  End Sub End Module

<a id="t_rownumbersmethod"></a>
###### RowNumbers Method

*Help context ID: 5110*

Obtains the variable numbers associated with the rows of a matrix.

Syntax

*object*.**RowNumbers** *matrixID*, *theVariableNumbers*, *groupNumber*

The **RowNumbers** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *matrixID* | An integer that specifies a matrix of estimates, as described in Settings |
| *theVariableNumbers* | An integer array declared in the calling program as **Dim theVariableNumbers() as Integer** The Amos Engine will redimension the array. |
| *groupNumber* | Optional. A group number. The first group is group number 1. If *groupNumber* is omitted, the first group is used. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [3].

**Settings**

The settings for *matrixID* are:


| Constant | Value | Description |
| --- | --- | --- |
| SampleCovariances | 13 | Sample covariances. |
| SampleCorrelations | 14 | Sample correlations. |
| SampleMeans | 15 | Sample means. |
| ImpliedCovariances | 10 | The implied covariances among the observed variables in the model. |
| ImpliedCorrelations | 11 | The implied correlations among the observed variables in the model. |
| ImpliedMeans | 12 | The implied means of the observed variables in the model. |
| AllImpliedCovariances | 7 | The implied covariances among all variables in the model, with the exception of residual variables. |
| AllImpliedCorrelations | 8 | The implied correlations among all variables in the model, with the exception of residual variables. |
| AllImpliedMeans | 9 | The implied means of all variables in the model, with the exception of residual variables. |
| DirectEffects | 19 | Direct effects. |
| IndirectEffects | 20 | Indirect effects. |
| TotalEffects | 5 | Total effects. |
| StandardizedDirectEffects | 22 | Standardized direct effects. |
| StandardizedIndirectEffects | 23 | Standardized indirect effects. |
| StandardizedTotalEffects | 21 | Standardized total effects. |
| FactorScoreWeights | 6 | Factor score weights. |

Remarks

The [NeedEstimates](#t_needestimatesmethod) method must be used to give notice that a particular matrix of estimates will be needed before the **RowNumbers** method can be used to obtain the row numbers for that matrix. For example, you have to use

*object*.[NeedEstimates](#t_needestimatesmethod) (ImpliedMeans)

before using

*object*.**RowNumbers** (ImpliedMeans, …)

<a id="t_rownumbersmethodexample"></a>
###### RowNumbers Method Example

The following program fits Models A and B of Example 11. It displays the matrix of total effects for each group and model. Rows and columns of the matrix are labeled with Amos's internal variable numbers.

Imports System.Diagnostics Imports AmosEngineLib.AmosEngine.TMatrixID Imports Microsoft.VisualBasic Module MainModule  ' RowNumbers Method Example  Sub Main()  Dim CNumbers() As Integer, RNumbers() As Integer, X(,) As Double  Dim Sem As New AmosEngineLib.AmosEngine  Sem.NeedEstimates(TotalEffects)  Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Fels_fem")  Sem.GroupName("girls")  Sem.AStructure("academic = (g1) GPA + (g2) attract + (1) e1")  Sem.AStructure("attract = (g3) height + (g4) weight + (g5) rating + (g6) academic + (1) e2")  Sem.AStructure("e2 <--> e1")   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Fels_mal")  Sem.GroupName("boys")  Sem.AStructure("academic = (b1) GPA + (b2) attract + (1) e1")  Sem.AStructure("attract = (b3) height + (b4) weight + (b5) rating + (b6) academic + (1) e2")  Sem.AStructure("e2 <--> e1")   Sem.Model("Model_A")  Sem.Model("Model_B", "g1=b1", "g2=b2", "g3=b3", "g4=b4", "g5=b5", "g6=b6")   'Print total effects for each model and each group  Dim ModelNumber As Integer  Dim GroupNumber As Integer   For ModelNumber = 1 To 2  Sem.FitModel(ModelNumber)  For GroupNumber = 1 To 2  Sem.GetEstimates(TotalEffects, X, GroupNumber)  Sem.ColumnNumbers(TotalEffects, CNumbers, GroupNumber)  Sem.RowNumbers(TotalEffects, RNumbers, GroupNumber)  Debug.WriteLine(vbCrLf & "Group " & GroupNumber & ", Model " & ModelNumber)  PrintMatrix1(X, CNumbers, RNumbers)  Next  Next   Sem.Dispose()  End Sub   'Print a matrix in the debug window  Sub PrintMatrix1(ByVal TheMatrix(,) As Double, ByVal CNumbers() As Integer, ByVal RNumbers() As Integer)  Dim NRows1 As Integer, NColumns1 As Integer  Dim i As Integer, j As Integer  NRows1 = UBound(RNumbers)  NColumns1 = UBound(CNumbers)  Debug.Write(" ")  For j = 0 To NColumns1  Debug.Write(CNumbers(j).ToString.PadLeft(10))  Next  Debug.WriteLine("")  For i = 0 To NRows1  Debug.Write(RNumbers(i).ToString.PadLeft(8))  For j = 0 To NColumns1  Debug.Write(TheMatrix(i, j).ToString("#.00000").PadLeft(10))  Next  Debug.WriteLine("")  Next  End Sub End Module

<a id="t_samplemomentsmethod"></a>
###### SampleMoments Method

*Help context ID: 5111*

Controls the reporting of the sample covariance matrix and (if means and intercepts are explicitly modeled) the sample means.

Syntax

*object*.**SampleMoments** ()

*object*.**SampleMoments** (*tf*)

The **SampleMoments** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *tf* | Optional. A boolean value that controls the reporting of sample moments. True (default) requests the output. False suppresses it. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [1].

Default

Sample moments are not reported.

See Also

[Admissible Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_admissiblemethod)

[ImpliedMoments Method](#t_impliedmomentsmethod)

[ResidualMoments Method](#t_residualmomentsmethod)

[InputUnbiasedMoments Method](#t_inputunbiasedmomentsmethod)

[FitUnbiasedMoments Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_fitunbiasedmomentsmethod)

<a id="t_samplemomentsmethodexample"></a>
###### SampleMoments Method Example

This example demonstrates the **SampleMoments** method.

Module MainModule  ' SampleMoments Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine   Sem.SampleMoments()   Sem.TextOutput()   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   Sem.Dispose()  End Sub End Module

<a id="t_seedmethod"></a>
###### Seed Method

*Help context ID: 5112*

Specifies a seed for the random number generator used for bootstrapping and for the permutation test. Using Amos twice with the same seed guarantees getting the same sequence of random numbers both times.

Syntax

*object*.**Seed** (*theSeed*)

The Seed method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *theSeed* | An integer between 1 and 29999 |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [1].

Default

A seed of 1 is used.

See Also

[BootAdf Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_bootadfmethod)

[BootBS Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_bootbsmethod)

[BootGls Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_bootglsmethod)

[BootMl Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_bootmlmethod)

[BootSls Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_bootslsmethod)

[Bootstrap Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_bootstrapmethod)

[BootSls Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_bootslsmethod)

[BootVerify Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_bootverifymethod)

[Permute Method](#t_permutemethod)

<a id="t_seedmethodexample"></a>
###### Seed Method Example

This example demonstrates the **Seed** method.

Module MainModule  ' Seed Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine  Sem.Bootstrap(200)  Sem.Seed(1)  Sem.TextOutput()   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   Sem.Dispose()  End Sub End Module

<a id="t_shutdownmethod"></a>
###### Shutdown Method

*Help context ID: 5148*

The **Shutdown** method has no effect. It is provided for compatibility with earlier versions of Amos.

Syntax

*object*.**Shutdown**

The **Shutdown** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [3].

<a id="t_significantfiguresmethod"></a>
###### SignificantFigures Method

*Help context ID: 5113*

The **SignificantFigures** method has no effect. It is provided for compatibility with earlier versions of Amos.

Syntax

*object*.**SignificantFigures** *Ndigits*

The **SignificantFigures** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *Ndigits* | Number of significant figures to be used in displaying matrices, within the bounds specified by [MinDecimalPlaces](#t_mindecimalplacesmethod) and [MaxDecimalPlaces](#t_maxdecimalplacesmethod). |

<a id="t_slsmethod"></a>
###### Sls Method

*Help context ID: 5114*

Requests the 'scale free' least squares solution obtained by minimizing (D1) together with (D5) in [Appendix B](https://ai-docs.amosdevelopment.com/07-appendices.md#t_appendixbdiscrepancyfunctions1).

Syntax

*object*.**Sls** ()

The **Sls** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [1].

Default

When you do not specify an estimation criterion, the maximum likelihood criterion ([Ml](#t_mlmethod) method) is used.

See Also

[Adf Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_adfmethod)

[BootSls Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_bootslsmethod)

[Gls Method](#t_glsmethod)

[Ml Method](#t_mlmethod)

[Uls Method](#t_ulsmethod)

<a id="t_slsmethodexample"></a>
###### Sls Method Example

This example demonstrates the **Sls** method.

Module MainModule  ' Sls Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine  Sem.Sls()  Sem.TextOutput()   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   Sem.Dispose()  End Sub End Module

<a id="t_smcmethod"></a>
###### Smc Method

*Help context ID: 5115*

Controls reporting of the squared multiple correlation between each endogenous variable and the variables (other than residual variables) that directly affect it.

Syntax

*object*.**Smc** ()

*object*.**Smc** (*tf*)

The **Smc** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *tf* | Optional. If *tf* is True, squared multiple correlations are reported. Otherwise, not. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [1].

Default

Squared multiple correlations are not reported.

<a id="t_smcmethodexample"></a>
###### Smc Method Example

This example demonstrates the **Smc** method.

Module MainModule  ' Smc Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine  Sem.Smc()  Sem.TextOutput()   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   Sem.Dispose()  End Sub End Module

<a id="t_specranmethod"></a>
###### Specran Method

*Help context ID: 5116*

Controls whether Amos uses a special random number generator that is common to all versions of Amos (since the beginning of time).

Syntax

*object*.**Specran** ()

*object*.**Specran** (*tf*)

The **Specran** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *tf* | Optional. If *tf* is True (default), the special random number generator is used. If *tf* is False, the random number generator of [Wichman and Hill (1982)](https://ai-docs.amosdevelopment.com/08-references.md#t_wichman__hill_1982) is used. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [1].

Default

The random number generator of [Wichman and Hill (1982)](https://ai-docs.amosdevelopment.com/08-references.md#t_wichman__hill_1982) is used.

Remarks

The random number generator that the **Specran** method invokes is not very good. It should not be used except to replicate an example in which the **Specran** method (or the **$specran** command of Amos 3.61 or earlier) was used.

<a id="t_specranmethodexample"></a>
###### Specran Method Example

This example demonstrates the **Specran** method.

Module MainModule  ' Specran Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine  Sem.Bootstrap(500)  Sem.Specran()  Sem.Standardized()  Sem.Smc()  Sem.TextOutput()   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   Sem.FitModel(1)   Sem.Dispose()  End Sub End Module

<a id="t_stablemethod"></a>
###### Stable Method

*Help context ID: 5146*

Returns True if the solution is a stable linear system for every group.

Syntax

*object*.**Stable****()**

The **Stable** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [3].

See Also

[Admissible Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_admissiblemethod)

<a id="t_stablemethodexample"></a>
###### Stable Method Example

This example demonstrates the **Stable** method.

Imports System.Diagnostics Module MainModule  ' Stable Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine  Sem.TextOutput()   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Fels_fem")  Sem.GroupName("girls")  Sem.AStructure("academic = GPA + attract + e1 (1)")  Sem.AStructure("attract = height + weight + rating + academic + e2 (1)")  Sem.AStructure("e2 <--> e1")  Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Fels_mal")  Sem.GroupName("boys")  Sem.AStructure("academic = GPA + attract + e1 (1)")  Sem.AStructure("attract = height + weight + rating + academic + e2 (1)")  Sem.AStructure("e2 <--> e1")   If Sem.Admissible Then  Debug.WriteLine("Admissible")  Else  Debug.WriteLine("Inadmissible")  End If   If Sem.Stable Then  Debug.WriteLine("Stable")  Else  Debug.WriteLine("Unstable")  End If   Sem.Dispose()  End Sub End Module

<a id="t_standardizedmethod"></a>
###### Standardized Method

*Help context ID: 5118*

Controls reporting of standardized parameter estimates (correlations among exogenous variables, and standardized regression weights). When used with the [SampleMoments](#t_samplemomentsmethod) method, it controls reporting of sample correlations. When used with the [ImpliedMoments](#t_impliedmomentsmethod) or [AllImpliedMoments](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_allimpliedmomentsmethod) methods, it controls reporting of implied correlations. When used with [TotalEffects](#t_totaleffectsmethod), it controls reporting of standardized direct effects, indirect effects and total effects.

Syntax

*object*.**Standardized** ()

*object*.**Standardized** (*tf*)

The **Standardized** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *tf* | Optional. If *tf* is True (default), standardized estimates are reported. Otherwise, not. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [1].

Default

Standardized estimates are not reported.

<a id="t_standardizedmethodexample"></a>
###### Standardized Method Example

This example demonstrates the **Standardized** method.

Module MainModule  ' Standardized Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine  Sem.Standardized()  Sem.Smc()  Sem.TextOutput()   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   Sem.Dispose()  End Sub End Module

<a id="t_tableoutputmethod"></a>
###### TableOutput Method

*Help context ID: 5120*

The **TableOutput** method is obsolete. Use the [TextOutput](#t_textoutputmethod) method instead.

<a id="t_technicalmethod"></a>
###### Technical Method

*Help context ID: 5123*

Controls the reporting of information about the progress of minimization of the discrepancy function.

Syntax

*object*.**Technical** ()

*object*.**Technical** (*tf*)

The **Technical** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *tf* | Optional. If *tf* is True, the minimization history is reported. Otherwise, not. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [1].

Default

The minimization history is reported.

See Also

[Crit1 Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_crit1method)

[Crit2 Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_crit2method)

[Fisher Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_fishermethod)

[Iterations Method](#t_iterationsmethod)

[Time Method](#t_timemethod)

<a id="t_technicalmethodexample"></a>
###### Technical Method Example

This example demonstrates the **Technical** method.

Module MainModule  ' Technical Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine  Sem.Technical()  Sem.TextOutput()   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   Sem.Dispose()  End Sub End Module

<a id="t_textoutputmethod"></a>
###### TextOutput Method

*Help context ID: 5124*

Controls whether results are displayed at the end of the analysis.

Syntax

*object*.**TextOutput** ()

*object*.**TextOutput** (*tf*)

The **TextOutput** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *tf* | Optional. If *tf* is True (default), results are written to a html file that is displayed at the conclusion of the analysis. If *tf* is False, results are written to a html file, but the file is not automatically displayed at the conclusion of the analysis. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [1], [2] or [3].

Default

Results are written to a html file, but the file is not automatically displayed at the conclusion of the analysis.

Remarks

By default, the html output file is created in the Windows temporary directory with the name AmosScratch.AmosOutput. Use [Initialize](#t_initializemethodamosengine) to change the name and location of the output file.

<a id="t_textoutputmethodexample"></a>
###### TextOutput Method Example

This example demonstrates the **TextOutput** method.

Module MainModule  ' TextOutput Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine  Sem.SampleMoments()  Sem.TextOutput()   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   Sem.Dispose()  End Sub End Module

<a id="t_textoutputfilenamemethod"></a>
###### TextOutputFileName Method

*Help context ID: 5125*

Gets the fully qualified path to the file that contains output displayed by the [TextOutput](#t_textoutputmethod) method.

Syntax

*object*.**TextOutputFileName** ()

The **TextOutputFileName** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [1].

<a id="t_textoutputfilenamemethodexample"></a>
###### TextOutputFileName Method Example

This example demonstrates the **TextOutputFileName** method.

Imports System.Diagnostics Module MainModule  ' TextOutputFileName Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine  Sem.TextOutput()   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   Debug.WriteLine("Text output will be written to: " & Sem.TextOutputFileName)   Sem.Dispose()  End Sub End Module

<a id="t_timemethod"></a>
###### Time Method

*Help context ID: 5126*

Sets an execution time limit.

Syntax

*object*.**Time** (*seconds*)

The **Time** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *seconds* | Time limit in seconds. If the time limit is reached, Amos displays the most recent estimates of the parameters and quits, even if the convergence criteria (see the [Crit1](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_crit1method) and [Crit2](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_crit2method) methods) have not been met. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [1].

Default

There is no time limit.

Remarks

If the time limit specified by the **Time** method is reached, it will take additional time to complete the output of results. You should allow for this by specifying a value with the **Time** method that is smaller than any time limit placed on your analysis by the operating system.

Permitted values for the time limit range from one to 2,147,483 seconds.

See Also

[Crit1 Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_crit1method)

[Crit2 Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_crit2method)

[Fisher Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_fishermethod)

[Iterations Method](#t_iterationsmethod)

[Technical Method](#t_technicalmethod)

<a id="t_timemethodexample"></a>
###### Time Method Example

This example demonstrates the **Time** method.

Module MainModule  ' Time Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine  Sem.Time(20)  Sem.TextOutput()   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   Sem.Dispose()  End Sub End Module

<a id="t_titlemethod"></a>
###### Title Method

*Help context ID: 5127*

Specifies a title for the analysis.

Syntax

*object*.**Title** (*theTitle*)

The **Title** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *theTitle* | A title. The title is displayed in the output generated by [TextOutput](#t_textoutputmethod). |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [1].

Default

The title is an empty string.

<a id="t_titlemethodexample"></a>
###### Title Method Example

This example demonstrates the **Title** method.

Imports Microsoft.VisualBasic Module MainModule  ' Title Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine   Sem.title("Example 8:" _  & vbLf & "factor analysis" _  & vbLf _  & vbLf & "Holzinger and Swineford (1939) Grant-White sample." _  & vbLf & "Intelligence factor study. Raw data of 73 female" _  & vbLf & "students from the Grant-White high school, Chicago.")   Sem.TextOutput()  Sem.SampleMoments()   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   Sem.Dispose()  End Sub End Module

<a id="t_totaleffectsmethod"></a>
###### TotalEffects Method

*Help context ID: 5128*

Controls reporting of direct, indirect and total effects ([Fox, 1980](https://ai-docs.amosdevelopment.com/08-references.md#t_fox_1980)).

Syntax

*object*.**TotalEffects** ()

*object*.**TotalEffects** (*tf*)

The **TotalEffects** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *tf* | Optional. If *tf* is True (the default), then direct, indirect and total effects are reported. Otherwise, not. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [1].

Default

Direct, indirect and total effects are not reported.

Remarks

When you use the [Standardized](#t_standardizedmethod) method, standardized direct, indirect and total effects are reported along with direct, indirect and total effects.

<a id="t_totaleffectsmethodexample"></a>
###### TotalEffects Method Example

This example demonstrates the TotalEffects method. Module MainModule  ' TotalEffects Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine  Sem.TotalEffects()  Sem.TextOutput()   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   Sem.Dispose()  End Sub End Module

<a id="t_ulsmethod"></a>
###### Uls Method

*Help context ID: 5129*

Requests an unweighted least squares solution, obtained by minimizing (D1) together with (D6) in the *User's Guide, *[Appendix B](https://ai-docs.amosdevelopment.com/07-appendices.md#t_appendixbdiscrepancyfunctions1).

Syntax

*object*.**Uls** ()

The **Uls** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [1].

Default

When you do not specify an estimation criterion, the maximum likelihood criterion ([Ml](#t_mlmethod) method) is used.

See Also

[BootUls Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_bootulsmethod)

[Adf Method](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_adfmethod)

[Gls Method](#t_glsmethod)

[Ml Method](#t_mlmethod)

[Sls Method](#t_slsmethod)

<a id="t_ulsmethodexample"></a>
###### Uls Method Example

This example demonstrates the **Uls** method.

Module MainModule  ' Uls Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine  Sem.Uls()  Sem.TextOutput()   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   Sem.Dispose()  End Sub End Module

<a id="t_uvariablecountmethod"></a>
###### UVariableCount Method

*Help context ID: 5132*

Specifies the number of unobserved variables in the model.

Syntax

*object*.**UVariableCount** (*nVariables*)

The **UVariableCount** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *nVariables* | The number of unobserved variables in the model. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [2].

Default

When the **UVariableCount** method is not used, no error checking is done based on the number of unobserved variables.

Remarks

Amos checks *nVariables *for consistency with the model and the data file. If a discrepancy is found, Amos reports the discrepancy and quits. Spelling or typing errors are frequently detected by this check, since two variant spellings of a variable name will be treated as references to two distinct variables.

In a multiple-group analysis, the **UvariableCount** method can be used once per group.

See Also

[OVariableCount Method](#t_ovariablecountmethod)

[VariableCount Method](#t_variablecountmethod)

<a id="t_uvariablecountmethodexample"></a>
###### UVariableCount Method Example

This example demonstrates the **UVariableCount** method.

Module MainModule  ' UVariableCount Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine  Sem.TextOutput()   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   Sem.OVariableCount(6)  Sem.UVariableCount(8)  Sem.VariableCount(14)   Sem.Dispose()  End Sub End Module

<a id="t_varmethod"></a>
###### Var Method

*Help context ID: 5133*

Specifies a variance as a model parameter.

Syntax

*object*.**Var** (*variableName*)

*object*.**Var** (*variableName, parameterValue*)

*object*.**Var** (*variableName, parameterName*)

The **Var** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *variableName* | The character string, *variableName*, is the name of an exogenous variable. The **Var** method makes its variance a model parameter. |
| *parameterValue* | (Optional) Parameter value. If *parameterValue* = 3, say, then the variance is fixed at 3. |
| *parameterName* | (Optional) Parameter name. If parameterName = "abc", say, then the variance is named "abc". It is constrained to be equal to any other parameters named "abc". If parameterName = "3?", say then the variance is given an initial value of 3, and is unconstrained. If parameterName = "abc:3", say, then the variance is named "abc" and is given an initial value of 3. It is constrained to be equal to any other parameters named "abc". If parameterName is an empty string (""), the variance is an unconstrained parameter. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [2].

Default

The variance of an exogenous variable is an unconstrained parameter unless it has been constrained or fixed at a constant by use of the **Var** or [AStructure](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_structuremethod) method.

Remarks

If *parameterValue *and *parameterName* are omitted, the variance is an unconstrained parameter.

<a id="t_varmethodexample"></a>
###### Var Method Example

The following program uses the [Path](#t_pathmethod), [Cov](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_covmethod) and **Var** methods to specify Model C of Example 6.

Module MainModule  ' Var Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine  Sem.TextOutput()  Sem.Standardized()  Sem.Smc()  Sem.AllImpliedMoments()  Sem.FactorScoreWeights()  Sem.TotalEffects()   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Wheaton")  Sem.Path("anomia67", "67_alienation", 1)  Sem.Path("anomia67", "eps1", 1)  Sem.Path("powles67", "67_alienation", "path_p")  Sem.Path("powles67", "eps2", 1)  Sem.Path("anomia71", "71_alienation", 1)  Sem.Path("anomia71", "eps3", 1)  Sem.Path("powles71", "71_alienation", "path_p")  Sem.Path("powles71", "eps4", 1)  Sem.Path("67_alienation", "ses")  Sem.Path("67_alienation", "zeta1", 1)  Sem.Path("71_alienation", "67_alienation")  Sem.Path("71_alienation", "ses")  Sem.Path("71_alienation", "zeta2", 1)  Sem.Path("education", "ses", 1)  Sem.Path("education", "delta1", 1)  Sem.Path("SEI", "ses")  Sem.Path("SEI", "delta2", 1)  Sem.Cov("eps3", "eps1")  Sem.Var("eps1", "var_a")  Sem.Var("eps2", "var_p")  Sem.Var("eps3", "var_a")  Sem.Var("eps4", "var_p")   Sem.Dispose()  End Sub End Module

<a id="t_variablecountmethod"></a>
###### VariableCount Method

*Help context ID: 5134*

Specifies the number of variables in the model.

Syntax

*object*.**VariableCount** (*nVariables*)

The **VariableCount** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *nVariables* | The number of variables in the model. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [2].

Default

When the **VariableCount** method is not used, no error checking is done based on the number of variables.

Remarks

Amos checks *nVariables *for consistency with the model and the data file. If a discrepancy is found, Amos reports the discrepancy and quits. Spelling or typing errors are frequently detected by this check, since two variant spellings of a variable name will be treated as references to two distinct variables.

In a multiple-group analysis, the **VariableCount** method can be used once per group.

See Also

[OVariableCount Method](#t_ovariablecountmethod)

[UVariableCount Method](#t_uvariablecountmethod)

<a id="t_variablecountmethodexample"></a>
###### VariableCount Method Example

This example demonstrates the **VariableCount** method.

Module MainModule  ' VariableCount Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine  Sem.TextOutput()   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   Sem.OVariableCount(6)  Sem.UVariableCount(8)  Sem.VariableCount(14)   Sem.Dispose()  End Sub End Module

<a id="t_variablenamemethod"></a>
###### VariableName Method

*Help context ID: 5135*

Gets the name of a variable.

Syntax

*object*.**VariableName** (*variableNumber*)

*object*.**VariableName** (*variableNumber*, *groupNumber*)

The **VariableName** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *variableNumber* | A variable number. Variable numbers start at 1 in each group. |
| *groupNumber* | Optional group number. The first group is group number 1. If *groupNumber* is omitted, the first group is used. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [3].

<a id="t_variablenamemethodexample"></a>
###### VariableName Method Example

This example demonstrates the **VariableName** method.

Imports System.Diagnostics Module MainModule  ' VariableName Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   'List all of the variables in the model  Dim i As Integer  For i = 1 To Sem.NumberOfVariables  Debug.WriteLine(i.ToString.PadLeft(5) & " " & Sem.Variablename(i))  Next   'What is the variable number of "cubes"?  Debug.WriteLine("")  Debug.WriteLine("""cubes"" is variable number " & Sem.VariableNumber("cubes"))   Sem.Dispose()  End Sub End Module

<a id="t_variablenumbermethod"></a>
###### VariableNumber Method

*Help context ID: 5136*

Gets a variable number.

A "variable number" is a variable's position on Amos's internal variable list. The first variable on the list is variable number 1. Some methods refer to model variables by number (*i.e.*, by list position).

Syntax

*object*.**VariableNumber** (*variableName*)

*object*.**VariableNumber** (*variableName*, *groupNumber*)

The **VariableNumber** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosEngine**. |
| *variableName* | A variable name. |
| *groupNumber* | Optional group number. The first group is group number 1. If *groupNumber* is omitted, the first group is used. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [3].

<a id="t_variablenumbermethodexample"></a>
###### VariableNumber Method Example

This example demonstrates the **VariableNumber** method.

Imports System.Diagnostics Module MainModule  ' VariableNumber Method Example  Sub Main()  Dim Sem As New AmosEngineLib.AmosEngine   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Grnt_fem")  Sem.AStructure("visperc = (1) spatial + (1) err_v")  Sem.AStructure("cubes = spatial + (1) err_c")  Sem.AStructure("lozenges = spatial + (1) err_l")  Sem.AStructure("paragraph = (1) verbal + (1) err_p")  Sem.AStructure("sentence = verbal + (1) err_s")  Sem.AStructure("wordmean = verbal + (1) err_w")   'List all of the variables in the model  Dim i As Integer  For i = 1 To Sem.NumberOfVariables  Debug.WriteLine(i.ToString.PadLeft(5) & " " & Sem.Variablename(i))  Next   'What is the variable number of "cubes"?  Debug.WriteLine("")  Debug.WriteLine("""cubes"" is variable number " & Sem.VariableNumber("cubes"))   Sem.Dispose()  End Sub End Module

<a id="t_wasinvertedmethod"></a>
###### WasInverted Method

*Help context ID: 5160*

True if the matrix of (approximate or exact) second derivatives was successfully inverted by the most recent use of [EvaluateEx2a](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_evaluate2aandevaluateex2amethods) or [EvaluateEx2e](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_evaluate2eandevaluateex2emethods).

Syntax

*result = object*.**WasInverted** ()

The **WasInverted** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | True if the matrix of (approximate or exact) second derivatives was successfully inverted. False otherwise. |
| *object* | An object of type **AmosEngine**. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [3].

See Also

[Evaluate2a and EvaluateEx2a methods example](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_evaluate2aandevaluateex2amethodsexample)

<a id="t_1853"></a>
### AmosMatrix Class Reference

An **AmosMatrix** object contains a matrix (such as a sample covariance or direct effects matrix) along with other properties, including row and column names. Several Amos Matrix object properties are provided for retrieving matrix-type output of Amos Engine results.

If you are not using Amos's built-in program editor, you need to provide a reference to **AmosEngineLib.dll** in order to use the **AmosMatrix** class. In Visual Studio 2003:

- Click **Project -> Add Reference**.
- In the **Add Reference** dialog, click **Browse**.
- When the **Select Component** dialog opens, select AmosEngineLib.dll from the Amos program directory and click **Open**.
- In the **Add Reference** dialog, click **OK**.

<a id="t_amosmatrixclassmembers"></a>
#### Properties

This section documents the properties of the AmosMatrix class.

<a id="t_columnnameproperty"></a>
##### ColumnName Property

*Help context ID: 6445*

Name of the variable associated with a matrix column. Read-only.

Syntax

*result = object*.**ColumnName**(*i*)

The **ColumnName** property syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The name of the variable associated with column i. |
| *object* | An object of type **AmosMatrix**. |
| *i* | An integer specifying a column number. Column 0 is the first column. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [3].

<a id="t_columnnamepropertyexample"></a>
###### ColumnName Property Example

The following program displays the names of the observed variables in the model of Example 4.

Imports System.Diagnostics Imports AmosEngineLib Imports AmosEngineLib.AmosEngine.TMatrixID Module MainModule  Sub Main()  Dim Sem As New AmosEngine  Dim AM As New AmosMatrix  Dim i As Integer  Sem.NeedEstimates(SampleCovariances)   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Warren5v")  Sem.AStructure("performance = knowledge + value + satisfaction + error (1)")   Sem.GetEstimatesEx(SampleCovariances, AM)  For i = 0 To AM.NColumns - 1  Debug.WriteLine(AM.ColumnName(i))  Next   Sem.Dispose()  End Sub End Module

<a id="t_columnnumberproperty"></a>
##### ColumnNumber Property

*Help context ID: 6447*

Variable number (maintained internally by the Amos engine) of the variable associated with a matrix column. Read-only.

Syntax

*result = object*.**ColumnNumber**(*i*)

The **ColumnNumber** property syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The Amos engine's internal variable number for the variable associated with column i. |
| *object* | An object of type **AmosMatrix**. |
| *i* | An integer specifying a column number. Column 0 is the first column. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [3].

<a id="t_columnnumberpropertyexample"></a>
###### ColumnNumber Property Example

The following program displays the Amos engine's internal variable numbers for the observed variables in the model of Example 4.

Imports System.Diagnostics Imports AmosEngineLib Imports AmosEngineLib.AmosEngine.TMatrixID Module MainModule  Sub Main()  Dim Sem As New AmosEngine  Dim AM As New AmosMatrix  Dim i As Integer  Sem.NeedEstimates(SampleCovariances)   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Warren5v")  Sem.AStructure("performance = knowledge + value + satisfaction + error (1)")   Sem.GetEstimatesEx(SampleCovariances, AM)  For i = 0 To AM.NColumns - 1  Debug.WriteLine(AM.ColumnNumber(i))  Next   Sem.Dispose()  End Sub End Module

<a id="t_ncolumnsproperty"></a>
##### NColumns Property

*Help context ID: 6442*

The number of columns in a matrix. Read-only.

Syntax

*result = object*.**NColumns**

The **NColumns** property syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The number of columns in object's matrix. |
| *object* | An object of type **AmosMatrix**. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [3].

<a id="t_ncolumnspropertyexample"></a>
###### NColumns Property Example

The following program displays the names of the observed variables in the model of Example 4.

Imports System.Diagnostics Imports AmosEngineLib Imports AmosEngineLib.AmosEngine.TMatrixID Module MainModule  Sub Main()  Dim Sem As New AmosEngine  Dim AM As New AmosMatrix  Dim i As Integer  Sem.NeedEstimates(SampleCovariances)   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Warren5v")  Sem.AStructure("performance = knowledge + value + satisfaction + error (1)")   Sem.GetEstimatesEx(SampleCovariances, AM)  For i = 0 To AM.NColumns - 1  Debug.WriteLine(AM.ColumnName(i))  Next   Sem.Dispose()  End Sub End Module

<a id="t_nrowsproperty"></a>
##### NRows Property

*Help context ID: 6441*

The number of rows in a matrix. Read-only.

Syntax

*result = object*.**nRows**

The **nRows** property syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The number of rows in object's matrix. |
| *object* | An object of type **AmosMatrix**. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [3].

<a id="t_nrowspropertyexample"></a>
###### NRows Property Example

The following program displays the names of the observed variables in the model of Example 4.

Imports System.Diagnostics Imports AmosEngineLib Imports AmosEngineLib.AmosEngine.TMatrixID Module MainModule  Sub Main()  Dim Sem As New AmosEngine  Dim AM As New AmosMatrix  Dim i As Integer  Sem.NeedEstimates(SampleCovariances)   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Warren5v")  Sem.AStructure("performance = knowledge + value + satisfaction + error (1)")   Sem.GetEstimatesEx(SampleCovariances, AM)  For i = 0 To AM.NRows - 1  Debug.WriteLine(AM.RowName(i))  Next   Sem.Dispose()  End Sub End Module

<a id="t_rownameproperty"></a>
##### RowName Property

*Help context ID: 6444*

Name of the variable associated with a matrix row. Read-only.

Syntax

*result = object*.**RowName**(*i*)

The **RowName** property syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The name of the variable associated with row i. |
| *object* | An object of type **AmosMatrix**. |
| *i* | An integer specifying a row number. Row 0 is the first row. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [3].

<a id="t_rownamepropertyexample"></a>
###### RowName Property Example

The following program displays the names of the observed variables in the model of Example 4.

Imports System.Diagnostics Imports AmosEngineLib Imports AmosEngineLib.AmosEngine.TMatrixID Module MainModule  Sub Main()  Dim Sem As New AmosEngine  Dim AM As New AmosMatrix  Dim i As Integer  Sem.NeedEstimates(SampleCovariances)   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Warren5v")  Sem.AStructure("performance = knowledge + value + satisfaction + error (1)")   Sem.GetEstimatesEx(SampleCovariances, AM)  For i = 0 To AM.NRows - 1  Debug.WriteLine(AM.RowName(i))  Next   Sem.Dispose()  End Sub End Module

<a id="t_rownumberproperty"></a>
##### RowNumber Property

*Help context ID: 6446*

Variable number (maintained internally by the Amos engine) of the variable associated with a matrix row. Read-only.

Syntax

*result = object*.**RowNumber**(*i*)

The **RowNumber** property syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The Amos engine's internal variable number for the variable associated with row i. |
| *object* | An object of type **AmosMatrix**. |
| *i* | An integer specifying a row number. Row 0 is the first row. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [3].

<a id="t_rownumberpropertyexample"></a>
###### RowNumber Property Example

The following program displays the Amos engine's internal variable numbers for the observed variables in the model of Example 4.

Imports System.Diagnostics Imports AmosEngineLib Imports AmosEngineLib.AmosEngine.TMatrixID Module MainModule  Sub Main()  Dim Sem As New AmosEngine  Dim AM As New AmosMatrix  Dim i As Integer  Sem.NeedEstimates(SampleCovariances)   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Warren5v")  Sem.AStructure("performance = knowledge + value + satisfaction + error (1)")   Sem.GetEstimatesEx(SampleCovariances, AM)  For i = 0 To AM.NRows - 1  Debug.WriteLine(AM.RowNumber(i))  Next   Sem.Dispose()  End Sub End Module

<a id="t_xproperty"></a>
##### X Property

*Help context ID: 6443*

A matrix element. Read-only.

Syntax

*result = object*.**X**(*i*, *j*)

The **X** property syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The (i, j) element of object's matrix. |
| *object* | An object of type **AmosMatrix**. |
| *i* | An integer specifying a row number. Row 0 is the first row. |
| *j* | An integer specifying a column number. Column 0 is the first row. |

[Placement](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_timingiseverything): [3].

<a id="t_xpropertyexample"></a>
###### X Property Example

The following program fits the model of Example 4 and displays the sample covariance matrix.

Imports System.Diagnostics Imports AmosEngineLib Imports AmosEngineLib.AmosEngine.TMatrixID Module MainModule  Sub Main()  Dim Sem As New AmosEngine  Dim AM As New AmosMatrix  Dim i As Integer, j As Integer  Sem.NeedEstimates(SampleCovariances)   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Warren5v")  Sem.AStructure("performance = knowledge + value + satisfaction + error (1)")   Sem.GetEstimatesEx(SampleCovariances, AM)  For i = 0 To AM.NRows - 1  For j = 0 To AM.NColumns - 1  Debug.Write(AM.X(i, j).ToString("#.0000").PadLeft(10))  Next  Debug.WriteLine("")  Next   Sem.Dispose()  End Sub End Module

<a id="t_1870"></a>
### AmosDebug Class Reference

This class displays output in a debug window. There are several methods and properties for manipulating the debug window and formatting its contents.

If you are not using Amos's built-in program editor, you need to provide a reference to **AmosDebug.dll** in order to use the **AmosDebug** class. In Visual Studio 2003:

- Click **Project -> Add Reference**.
- In the **Add Reference** dialog, click **Browse**.
- When the **Select Component** dialog opens, select AmosDebug.dll from the Amos program directory and click **Open**.
- In the **Add Reference** dialog, click **OK**.

<a id="t_7812"></a>
#### Properties

This section documents the properties of the AmosDebug class.

<a id="t_decimalplacesproperty"></a>
##### DecimalPlaces Property

*Help context ID: 6405*

Gets or sets the number of decimal places used to display numbers.

Syntax

*object*.**DecimalPlaces*** [=value]*

The **DecimalPlaces** property syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosDebug**. |
| *value* | The number of decimal places used to display numbers. |

<a id="t_decimalplacespropertyexample"></a>
###### DecimalPlaces Property Example

The following program fits the model of Example 4 and displays the sample covariance matrix with 5 decimal places of precision. Each matrix element is displayed in a field that is 12 characters wide.

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  Dim i As Long, j As Long  Sem.NeedEstimates(SampleCovariances)   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Warren5v")  Sem.AStructure("performance = knowledge + value + satisfaction + error (1)")   Sem.GetEstimatesEx(SampleCovariances, AM)   AD.FieldWidth = 12  AD.DecimalPlaces = 5  AD.PrintX(AM, "Sample Covariances")   Sem.Dispose()  End Sub End Module

<a id="t_fieldwidthproperty"></a>
##### FieldWidth Property

*Help context ID: 6404*

Sets or gets the number of characters used to display each matrix element.

Syntax

*object*.**FieldWidth*** [=value]*

The **FieldWidth** property syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosDebug**. |
| *value* | The number of characters used to display each matrix element. |

<a id="t_fieldwidthpropertyexample"></a>
###### FieldWidth Property Example

The following program fits the model of Example 4 and displays the sample covariance matrix with 5 decimal places of precision. Each matrix element is displayed in a field that is 12 characters wide.

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  Dim i As Long, j As Long  Sem.NeedEstimates(SampleCovariances)   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Warren5v")  Sem.AStructure("performance = knowledge + value + satisfaction + error (1)")   Sem.GetEstimatesEx(SampleCovariances, AM)   AD.FieldWidth = 12  AD.DecimalPlaces = 5  AD.PrintX(AM, "Sample Covariances")   Sem.Dispose()  End Sub End Module

<a id="t_7813"></a>
#### Methods

This section documents the methods of the AmosDebug class.

<a id="t_clearmethod"></a>
##### Clear Method

*Help context ID: 6409*

The **Clear** method is no longer supported because output from the **AmosDebug** class is now written to the trace listeners in the Listeners collection, not to a separate **AmosDebug** window.

In earlier versions, the **Clear** method cleared (erased) the contents of the **AmosDebug** window.

Syntax

*object*.**Clear** ()

The **Clear** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosDebug**. |

<a id="t_fixedmethod"></a>
##### Fixed Method

*Help context ID: 6411*

Displays elements of numeric matrices in fixed point format.

Syntax

*object*.**Fixed** ()

The **Fixed** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosDebug**. |

Default

Elements of numeric matrices are displayed in fixed point format with 3 decimal places and a field width of 10.

<a id="t_fixedmethodexample"></a>
###### Fixed Method Example

The following program fits the model of Example 4 and displays the sample covariance matrix with 5 decimal places of precision in fixed point format. Each matrix element is displayed in a field that is 12 characters wide.

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  Dim i As Long, j As Long  Sem.NeedEstimates(SampleCovariances)   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Warren5v")  Sem.AStructure("performance = knowledge + value + satisfaction + error (1)")   Sem.GetEstimatesEx(SampleCovariances, AM)   AD.Fixed()  AD.FieldWidth = 12  AD.DecimalPlaces = 5  AD.PrintX(AM, "Sample Covariances")   Sem.Dispose()  End Sub End Module

<a id="t_hidemethod"></a>
##### Hide Method

*Help context ID: 6402*

The **Hide** method is no longer supported because output from the **AmosDebug** class is now written to the trace listeners in the Listeners collection, not to a separate **AmosDebug** window.

In earlier versions, the **Hide** method made the **AmosDebug** window invisible.

Syntax

*object*.**Hide** ()

The **Hide** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosDebug**. |

Default

The **AmosDebug** window is visible.

<a id="t_keepontopmethod"></a>
##### KeepOnTop Method

*Help context ID: 6406*

The **KeepOnTop** method is no longer supported because output from the **AmosDebug** class is now written to the trace listeners in the Listeners collection, not to a separate **AmosDebug** window.

In earlier versions, the **KeepOnTop** method kept the **AmosDebug** window on top of other windows (if called with an argument of True) or allowed other windows to be on top (if called with an argument of False).

Syntax

*object*.**KeepOnTop** ()

The **KeepOnTop** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosDebug**. |

<a id="t_7776"></a>
##### PrintTranspose Method

Displays the transpose of a 1- or 2-dimensional array.

Syntax

*object*.**PrintTranspose** (*item*)

*object*.**PrintTranspose** (*item, title*)

The **PrintTranspose** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosDebug**. |
| *item* | A 1- or 2-dimensional array of Double or String, or an [AmosMatrix](#t_1853) object. |
| *title* | (Optional) A string that describes *item*. |

Remarks

**PrintTranspose** transposes 2-dimensional arrays and [AmosMatrix](#t_1853) objects.

**PrintTranspose** displays a 1-dimensional array as a single row.

See Also

[PrintX, PrintTranspose, PrintTriangle Methods Example](#t_printxprinttransposeprinttrianglemethodsexample)

<a id="t_7777"></a>
##### PrintTriangle Method

Displays a 1-dimensional array as a lower triangular matrix.

Syntax

*object*.**PrintTriangle** (*theMatrix*)

*object*.**PrintTriangle** (*theMatrix, title*)

The **PrintTriangle** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosDebug**. |
| *theMatrix* | A 1-dimensional array of Double or String. |
| *title* | (Optional) A string that describes *theMatrix*. |

Remarks

**PrintTriangle** displays a vector *x* as

x(0)

x(1) x(2)

x(3) x(4) x(5)

...

Thus, the **PrintTriangle** method may be used when the vector contains the lower triangular portion of a symmetric matrix (see [Evaluate2a and EvaluateEx2a methods example](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_evaluate2aandevaluateex2amethodsexample)), and also when the vector contains the lower triangular portion of a lower triangular matrix.

See Also

[PrintX, PrintTranspose, PrintTriangle Methods Example](#t_printxprinttransposeprinttrianglemethodsexample)

<a id="t_7775"></a>
##### PrintX Method

Displays a number, a string, a 1- or 2-dimensional array of numbers or strings, or [AmosMatrix](#t_1853) object.

Syntax

*object*.**PrintX** (*item*)

*object*.**PrintX** (*item, title*)

The **PrintX** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosDebug**. |
| *item* | A Double, a String, a 1- or 2-dimensional array of Double or String, or [AmosMatrix](#t_1853) object. |
| *title* | (Optional) A string that describes *item*. |

Remarks

**PrintX** displays a 1-dimensional array as a single column.

<a id="t_printxprinttransposeprinttrianglemethodsexample"></a>
###### PrintX, PrintTranspose, PrintTriangle Methods Example

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

<a id="t_scientificmethod"></a>
##### Scientific Method

*Help context ID: 6410*

Displays elements of numeric matrices in scientific format.

Syntax

*object*.**Scientific**

The **Scientific** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosDebug**. |

Default

Elements of numeric matrices are displayed in fixed point format with 3 decimal places and a field width of 10.

<a id="t_scientificmethodexample"></a>
###### Scientific Method Example

The following program fits the model of Example 4 and displays the sample covariance matrix with 5 decimal places of precision in scientific format. Each matrix element is displayed in a field that is 12 characters wide.

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  Sem.NeedEstimates(SampleCovariances)   Sem.BeginGroup(AmosEngine.AmosDir & "Examples\English\UserGuide.xls", "Warren5v")  Sem.AStructure("performance = knowledge + value + satisfaction + error (1)")   Sem.GetEstimatesEx(SampleCovariances, AM)   AD.Scientific()  AD.FieldWidth = 12  AD.DecimalPlaces = 5  AD.PrintX(AM, "Sample Covariances")   Sem.Dispose()  End Sub End Module

<a id="t_showmethod"></a>
##### Show Method

*Help context ID: 6403*

The **Show** method is no longer supported because output from the **AmosDebug** class is now written to the trace listeners in the Listeners collection, not to a separate **AmosDebug** window.

In earlier versions, the **Show** method made the **AmosDebug** window visible.

Syntax

*object*.**Show** ()

The **Show** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosDebug**. |

Default

The **AmosDebug** window is visible.

<a id="t_unloadmethod"></a>
##### Unload Method

*Help context ID: 6408*

The **Unload** method is no longer supported because output from the **AmosDebug** class is now written to the trace listeners in the Listeners collection, not to a separate **AmosDebug** window.

In earlier versions, the **Unload** method closed the **AmosDebug** window.

Syntax

*object*.**Unload** ()

The **Unload** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosDebug**. |

<a id="t_1893"></a>
### AmosRanGen Class Reference

The **AmosRanGen** class generates multivariate normal random numbers with prescribed means and covariances. The class also generates uniform random numbers and performs some related matrix operations.

If you are not using Amos's built-in program editor, you need to provide a reference to **AmosRandom.dll** in order to use the **AmosRanGen** class. In Visual Studio 2003:

- Click **Project -> Add Reference**.
- In the **Add Reference** dialog, click **Browse**.
- When the **Select Component** dialog opens, select AmosRandom.dll from the Amos program directory and click **Open**.
- In the **Add Reference** dialog, click **OK**.

<a id="t_amosrangenclassmembers"></a>
#### AmosRanGen Class Members

[Properties](#t_7892)

[Methods](#t_7891)

<a id="t_7892"></a>
##### Properties

This section documents the properties of the [AmosRanGen](#t_1893) class.

<a id="t_choleskyepsilonproperty"></a>
###### CholeskyEpsilon Property

*Help context ID: 6461*

The threshold used in the Cholesky decomposition of the population covariance matrix to decide whether a variable is linearly dependent on previous variables. The *k*-th variable is judged to be linearly dependent on variables 1 through *k*-1 if the *k*-th pivot is less than **CholeskyEpsilon**.

The [InstantSqrt](#t_instantsqrtmethod) and [SpecifyPopulation](#t_specifypopulationmethod) methods make use of **CholeskyEpsilon**.

Syntax

*value= object*.**CholeskyEpsilon**

*object*.**CholeskyEpsilon **= *value*

The **CholeskyEpsilon** property syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosRanGen**. |
| *value* | The threshold. |

Default

The default threshold is 1.0e-10.

<a id="t_choleskyepsilonpropertyexample"></a>
###### CholeskyEpsilon Property Example

The following program sets CholeskyEpsilon to 1.0e-15. Then it displays the Cholesky square root of the matrix $\left[\begin{array}{ll} 3 & 1 \\ 1 & 2 \end{array}\right]$ as well as the rank of the matrix and the square root of its determinant.

Module MainModule  Sub Main()  Dim arand As New AMOSRANDOMLib6.AmosRanGen  Dim Cov(2) As Double  Cov(0) = 3  Cov(1) = 1  Cov(2) = 2  Dim Rank As Integer  Dim sqrdet As Double   arand.CholeskyEpsilon = 0.0000000001   Call arand.InstantSqrt(2, Cov(0), Rank, sqrdet)  Dim ad As New AmosDebug.AmosDebug  Call ad.PrintTriangle(Cov, "Square root of matrix")  Call ad.PrintX(Rank, "Rank")  Call ad.PrintX(sqrdet, "Square root of determinant")  End Sub End Module

<a id="t_rankproperty"></a>
###### Rank Property

*Help context ID: 6473*

Gets the rank of the population covariance matrix already specified with [SpecifyPopulation](#t_specifypopulationmethod).

Syntax

*result = object*.**Rank**

The **Rank** property syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | Output of type Integer. The rank of the covariance matrix. |
| *object* | An object of type **AmosRanGen**. |

Remarks

The **Rank** property is read-only.

<a id="t_rankpropertyexample"></a>
###### Rank Property Example

The following program specifies a multivariate normal population with covariance matrix and mean given by

$\boldsymbol{\Sigma}=\left[\begin{array}{ll} 3 & 1 \\ 1 & 2 \end{array}\right], \quad \boldsymbol{\mu}=\left[\begin{array}{l} 4 \\ 5 \end{array}\right]$.

Then it displays the rank of the covariance matrix.

Imports System.Diagnostics Module MainModule  Sub Main()  Dim arand As New AMOSRANDOMLib6.AmosRanGen  Dim Covariances(2) As Double  Dim Means(1) As Double  Covariances(0) = 3  Covariances(1) = 1  Covariances(2) = 2  Means(0) = 4  Means(1) = 5   Call arand.SpecifyPopulation(Covariances, Means)   Debug.WriteLine("Rank = " & arand.Rank)  End Sub End Module

<a id="t_secondmomentstypeproperty"></a>
###### SecondMomentsType Property

*Help context ID: 6478*

The type of second order moments returned by [RandomMoments](#t_randommomentsmethod).

Syntax

*value = object*.**SecondMomentsType**

*object*.**SecondMomentsType** = *value*

The **SecondMomentsType** property syntax has the following parts:


| Part | Description |
| --- | --- |
| *value* | One of the values specified in Settings. |
| *object* | An object of type **AmosRanGen**. |

**Settings**

The settings for *value* are:


| Constant | Value | Description |
| --- | --- | --- |
| SSCP | 1 | RandomMoments() returns sums of squares and cross products about the mean. |
| ML | 2 | RandomMoments() returns the (biased) maximum likelihood estimate of the population covariances. |
| UNBIASED | 3 | RandomMoments() returns the unbiased estimate of the population covariances. |

<a id="t_secondmomentstypepropertyexample"></a>
###### SecondMomentsType Property Example

The following program specifies a multivariate normal population with covariance matrix and mean given by

$\boldsymbol{\Sigma}=\left[\begin{array}{ll} 3 & 1 \\ 1 & 2 \end{array}\right], \quad \boldsymbol{\mu}=\left[\begin{array}{l} 4 \\ 5 \end{array}\right]$.

Then it draws a sample of 500 and displays the (biased) maximum likelihood estimate of the covariance matrix and mean vector.

Module MainModule  Sub Main()  Dim arand As New AMOSRANDOMLib6.AmosRanGen  Dim PopCovariances(2) As Double  Dim PopMeans(1) As Double  PopCovariances(0) = 3  PopCovariances(1) = 1  PopCovariances(2) = 2  PopMeans(0) = 4  PopMeans(1) = 5   Call arand.SpecifyPopulation(PopCovariances, PopMeans)   Dim SampleCovariances(2) As Double  Dim SampleMeans(1) As Double   arand.SecondMomentsType = AMOSRANDOMLib6.SECONDMOMENTS.ML   Call arand.RandomMoments(SampleCovariances(0), SampleMeans(0), 2, 500)   Dim ad As New AmosDebug.AmosDebug  Call ad.PrintTriangle(SampleCovariances, "Sample Covariances")  Call ad.PrintX(SampleMeans, "Sample Means")  End Sub End Module

<a id="t_7891"></a>
##### Methods

This section documents the methods of the [AmosRanGen](#t_1893) class.

<a id="t_chversinplacemethod"></a>
###### ChversInPlace Method

*Help context ID: 6462*

Replaces a positive definite symmetric matrix with its inverse.

Syntax

*object*.**ChversInPlace **(*N, SymMatrix, WorkVector, Determinant, Eps, errorflag*)

The **ChversInPlace **property syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosRanGen**. |
| *N* | Number of rows in the matrix. |
| *SymMatrix* | An array of length N\*(N+1)/2, of type Double. On input, the matrix to be inverted. On output, the inverse. SymMatrix contains the first element of the first row, the first two elements of the second row, and so on. The first element of SymMatrix is passed by reference. |
| *WorkVector* | An array of length N, of type Double. Used as work space. The first element of WorkVector is passed by reference. |
| *Determinant* | Output, of type Double. The determinant. |
| *Eps* | Input, of type Double. Each pivot element must exceed Eps. |
| *errorflag* | Output, of type Integer. If the matrix was successfully inverted, errorflag=0. Otherwise, errorflag=1. |

<a id="t_chversinplacemethodexample"></a>
###### ChversInPlace Method Example

The following program displays the inverse and the determinant of $\left[\begin{array}{ll} 3 & 1 \\ 1 & 2 \end{array}\right]$.

Module MainModule  Sub Main()  Const eps As Double = 0.000000000000001  Dim arand As New AMOSRANDOMLib6.AmosRanGen  Dim ad As New AmosDebug.AmosDebug  Dim Cov(2) As Double  Cov(0) = 3  Cov(1) = 1  Cov(2) = 2  Call ad.PrintTriangle(Cov, "The matrix")  Dim w(1) As Double  Dim det As Double  Dim ef As Integer   Call arand.ChversInPlace(2, Cov(0), w(0), det, eps, ef)   If ef = 0 Then  Call ad.PrintTriangle(Cov, "The inverse")  Call ad.PrintX(det, "Determinant")  Else  Call ad.PrintX("Error")  End If  End Sub End Module

<a id="t_initializemethodamosrangen"></a>
###### Initialize Method (AmosRanGen)

*Help context ID: 6463*

Initializes the random number generator.

Syntax

*object*.**Initialize** (*Seed*)

The **Initialize** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosRanGen**. |
| *Seed* | Input, of type Integer. Seed for the random number generator. |

<a id="t_initializemethodexample2"></a>
###### Initialize Method Example

The following program displays three pairs of random numbers. The second pair is identical to the first pair.

Imports System.Diagnostics Module MainModule  Sub Main()  Dim arand As New AMOSRANDOMLib6.AmosRanGen   arand.Initialize(5)  Debug.WriteLine(arand.NextNormal() & arand.NextNormal())   arand.Initialize(5)  Debug.WriteLine(arand.NextNormal() & arand.NextNormal())   arand.Initialize(6)  Debug.WriteLine(arand.NextNormal() & arand.NextNormal())   End Sub End Module

<a id="t_instantrandomvectormethod"></a>
###### InstantRandomVector Method

*Help context ID: 6464*

Gets a random multivariate normal vector where the mean vector and the square root of the covariance matrix are specified.

Syntax

*object*.**InstantRandomVector **(*N, X, mean, s_sqrt*)

The **InstantRandomVector** property syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosRanGen**. |
| *N* | Input of type Integer. Number of elements in the vector. |
| *X* | Output array of length N, of type Double. The random vector. The first element of X is passed by reference. X must be dimensioned by the caller. |
| *mean* | Input array of length N, of type Double. The population mean. The first element of mean is passed by reference. |
| *s_sqrt* | Input array of length N\*(N+1)/2, of type Double. The square root of the population covariance matrix. s_sqrt contains the first element of the first row, the first two elements of the second row, and so on. The first element of s_sqrt is passed by reference. |

See Also

[InstantRandomVectorEx Method](#t_instantrandomvectorexmethod)

[RandomVector Method](#t_randomvectormethod)

<a id="t_instantrandomvectormethodexample"></a>
###### InstantRandomVector Method Example

The following program displays 5 observations from a multivariate normal population with covariance matrix and mean given by

$\boldsymbol{\Sigma}=\left[\begin{array}{ll} 3 & 1 \\ 1 & 2 \end{array}\right], \quad \boldsymbol{\mu}=\left[\begin{array}{l} 4 \\ 5 \end{array}\right]$.

Imports System.Diagnostics Module MainModule  Sub Main()  Dim arand As New AMOSRANDOMLib6.AmosRanGen  Dim Cov(2) As Double  Dim Mean(1) As Double  Cov(0) = 3  Cov(1) = 1  Cov(2) = 2  Mean(0) = 4  Mean(1) = 5  Dim Rank As Integer  Dim sqrdet As Double  Call arand.InstantSqrt(2, Cov(0), Rank, sqrdet)   Dim rx(1) As Double  Dim i As Long   For i = 1 To 5  Call arand.InstantRandomVector(2, rx(0), Mean(0), Cov(0))  Debug.WriteLine(rx(0) & rx(1))  Next  End Sub End Module

<a id="t_instantrandomvectorexmethod"></a>
###### InstantRandomVectorEx Method

*Help context ID: 6465*

Generates a random multinormal vector and calculates its squared Mahalanobis distance from the mean.

Syntax

*object*.**InstantRandomVectorEx **(*N, X, mean, s_sqrt, MahalanobisD2*)

The **InstantRandomVectorEx **property syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosRanGen**. |
| *N* | Input of type Integer. Number of elements in the vector. |
| *X* | Output array of length N, of type Double. The random vector. The first element of X is passed by reference. X must be dimensioned by the caller. |
| *mean* | Input array of length N, of type Double. The population mean. The first element of mean is passed by reference. |
| *s_sqrt* | Input array of length N\*(N+1)/2, of type Double. The square root of the population covariance matrix. s_sqrt contains the first element of the first row, the first two elements of the second row, and so on. The first element of s_sqrt is passed by reference. |
| *MahalanobisD2* | Output of type Double. The squared Mahalanobis distance between X and mean. |

See Also

[InstantRandomVector Method](#t_instantrandomvectormethod)

[RandomVector Method](#t_randomvectormethod)

<a id="t_instantrandomvectorexmethodexample"></a>
###### InstantRandomVectorEx Method Example

The following program displays 5 observations from a multivariate normal population with covariance matrix and mean given by

$\boldsymbol{\Sigma}=\left[\begin{array}{ll} 3 & 1 \\ 1 & 2 \end{array}\right], \quad \boldsymbol{\mu}=\left[\begin{array}{l} 4 \\ 5 \end{array}\right]$.

The program also displays the squared Mahalanobis distance of each observation from the mean.

Imports System.Diagnostics Module MainModule  Sub Main()  Dim arand As New AMOSRANDOMLib6.AmosRanGen  Dim Cov(2) As Double  Dim Mean(1) As Double  Cov(0) = 3  Cov(1) = 1  Cov(2) = 2  Mean(0) = 4  Mean(1) = 5  Dim Rank As Integer  Dim sqrdet As Double  Call arand.InstantSqrt(2, Cov(0), Rank, sqrdet)   Dim D2 As Double  Dim rx(1) As Double  Dim i As Long   For i = 1 To 5  Call arand.InstantRandomVectorEx(2, rx(0), Mean(0), Cov(0), D2)  Debug.WriteLine(rx(0) & rx(1) & "D2 = " & D2)  Next  End Sub End Module

<a id="t_instantsolvemethod"></a>
###### InstantSolve Method

*Help context ID: 6466*

Solves **Ax**=**y** for **x** where **A** is lower triangular.

Syntax

*object*.**InstantSolve **(*N, A, x, errorflag*)

The **InstantSolve** property syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosRanGen**. |
| *N* | Input of type Integer. The number of rows in the matrix a. |
| *A* | Input array of length N\*(N+1)/2, of type Double. A contains the first element of the first row, the first two elements of the second row, and so on. The first element of A is passed by reference. |
| *x* | Input and output array of length N, of type double. The first element of x is passed by reference. |
| *errorflag* | Output, of type Integer. If the system of linear equations was successfully solved, errorflag=0. Otherwise, errorflag=1. |

<a id="t_instantsolvemethodexample"></a>
###### InstantSolve Method Example

The following program displays $\left[\begin{array}{ll} 3 & 0 \\ 1 & 2 \end{array}\right]^{-1}\left[\begin{array}{l} 4 \\ 5 \end{array}\right]=\left[\begin{array}{l} 1.333 \\ 1.833 \end{array}\right]$.

Module MainModule  Sub Main()  Dim arand As New AMOSRANDOMLib6.AmosRanGen  Dim A(2) As Double  A(0) = 3  A(1) = 1  A(2) = 2  Dim x(1) As Double  x(0) = 4  x(1) = 5  Dim errorflag As Integer   Call arand.InstantSolve(2, A(0), x(0), errorflag)   Dim ad As New AmosDebug.AmosDebug  ad.PrintX(x)  End Sub End Module

<a id="t_instantsqrtmethod"></a>
###### InstantSqrt Method

*Help context ID: 6467*

Replaces a nonnegative definite symmetric matrix with its Cholesky square root.

Syntax

*object*.**InstantSqrt **(*n, x, rank, sqrdet*)

The **InstantSqrt** property syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosRanGen**. |
| *n* | Input of type Integer. The number of rows in the matrix. |
| *x* | Input and output array of length N\*(N+1)/2, of type Double. x contains the first element of the first row, the first two elements of the second row, and so on. The first element of x is passed by reference. |
| *rank* | Output of type Integer. The number of pivot elements greater than [CholeskyEpsilon](#t_choleskyepsilonproperty). |
| *sqrdet* | Output of type double. The square root of the determinant. |

Remarks

On output, *x* and *sqrdet* are meaningful only if *rank* = *n*.

See Also

[CholeskyEpsilon Property](#t_choleskyepsilonproperty)

<a id="t_instantsqrtmethodexample"></a>
###### InstantSqrt Method Example

The following program displays the Cholesky square root of the matrix $\left[\begin{array}{ll} 3 & 1 \\ 1 & 2 \end{array}\right]$ as well as the rank of the matrix and the square root of its determinant.

Module MainModule  Sub Main()  Dim arand As New AMOSRANDOMLib6.AmosRanGen  Dim Cov(2) As Double  Cov(0) = 3  Cov(1) = 1  Cov(2) = 2  Dim Rank As Integer  Dim sqrdet As Double   Call arand.InstantSqrt(2, Cov(0), Rank, sqrdet)   Dim ad As New AmosDebug.AmosDebug  Call ad.PrintTriangle(Cov, "Square root of matrix")  Call ad.PrintX(Rank, "Rank")  Call ad.PrintX(sqrdet, "Square root of determinant")  End Sub End Module

<a id="t_mahalanobisd2method"></a>
###### MahalanobisD2 Method

*Help context ID: 6468*

Gets the squared Mahalanobis distance of an observation from the mean.

Syntax

*object*.**MahalanobisD2 **(*N, covsqrt, mean, X, D2, errorflag*)

The **MahalanobisD2** property syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosRanGen**. |
| *N* | Input of type Integer. The number of elements in the vector. |
| *covsqrt* | Input array of length N\*(N+1)/2, of type Double. The square root of the covariance matrix. covsqrt contains the first element of the first row, the first two elements of the second row, and so on. The first element of covsqrt is passed by reference. |
| *mean* | Input array of length N, of type Double. The mean vector. The first element of mean is passed by reference. |
| *X* | Input array of length N, of type Double. The observation. The first element of X is passed by reference. |
| *D2* | Output of type Double. The squared Mahalanobis distance between X and mean. |
| *errorflag* | Output of type Integer. errorflag=1 if an error occurred, errorflag=0 otherwise. |

<a id="t_mahalanobisd2methodexample"></a>
###### MahalanobisD2 Method Example

The following program evaluates the squared Mahalanobis distance,

$(\mathbf{x}-\boldsymbol{\mu})^{T} \boldsymbol{\Sigma}^{-1}(\mathbf{x}-\boldsymbol{\mu})$,

of the vector $\mathbf{x}=\left[\begin{array}{l} 6 \\ 7 \end{array}\right]$ from the mean of a multivariate normal distribution with covariance matrix and mean given by

$\boldsymbol{\Sigma}=\left[\begin{array}{ll} 3 & 1 \\ 1 & 2 \end{array}\right], \quad \boldsymbol{\mu}=\left[\begin{array}{l} 4 \\ 5 \end{array}\right]$.

Imports System.Diagnostics Module MainModule  Sub Main()  Dim arand As New AMOSRANDOMLib6.AmosRanGen  Dim Cov(2) As Double  Dim Mean(1) As Double  Cov(0) = 3  Cov(1) = 1  Cov(2) = 2  Mean(0) = 4  Mean(1) = 5  Dim Rank As Integer  Dim sqrdet As Double  Call arand.InstantSqrt(2, Cov(0), Rank, sqrdet)  Dim D2 As Double  Dim ef As Integer  Dim x(1) As Double  x(0) = 6  x(1) = 7   Call arand.MahalanobisD2(2, Cov(0), Mean(0), x(0), D2, ef)   If ef = 0 Then  Debug.WriteLine("Squared Mahalanobis distance = " & D2)  Else  Debug.WriteLine("Error")  End If  End Sub End Module

<a id="t_nextnormalmethod"></a>
###### NextNormal Method

*Help context ID: 6469*

Gets a normally distributed random number that has mean 0 and standard deviation 1.

Syntax

*result = object*.**NextNormal**** ()**

The **NextNormal** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | Output of type Double. The random number. |
| *object* | An object of type **AmosRanGen**. |

Remarks

**NextNormal** uses the [NextUniform](#t_nextuniformmethod) method.

<a id="t_nextnormalmethodexample"></a>
###### NextNormal Method Example

The following program generates 20 random numbers.

Imports System.Diagnostics Module MainModule  Sub Main()  Dim arand As New AMOSRANDOMLib6.AmosRanGen  Dim i As Long  For i = 1 To 20  Debug.WriteLine(arand.NextNormal())  Next  End Sub End Module

<a id="t_nextuniformmethod"></a>
###### NextUniform Method

*Help context ID: 6470*

Gets a random number that is uniformly distributed over the interval from 0 to 1.

Syntax

*result = object*.**NextUniform** ()

The **NextUniform** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | Output of type Double. The random number. |
| *object* | An object of type **AmosRanGen**. |

<a id="t_nextuniformmethodexample"></a>
###### NextUniform Method Example

The following program generates 20 random numbers.

Imports System.Diagnostics Module MainModule  Sub Main()  Dim arand As New AMOSRANDOMLib6.AmosRanGen  Dim i As Long  For i = 1 To 20  Debug.WriteLine(arand.NextUniform())  Next  End Sub End Module

<a id="t_randommomentsmethod"></a>
###### RandomMoments Method

*Help context ID: 6471*

Gets a sample mean vector and covariance matrix from the population specified by [SpecifyPopulation](#t_specifypopulationmethod).

Syntax

*object*.**RandomMoments** (*Covariances, Means, NCases*)

The **RandomMoments** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosRanGen**. |
| *Covariances* | Output array of type Double. Second order moment matrix from a sample of *NCases *observations. Use [SecondMomentsType](#t_secondmomentstypeproperty) to specify whether *Covariances *contains unbiased estimates of the population covariances, maximum likelihood estimates of the population covariances, or sums of squares and cross products about the sample mean. *Covariances *contains the first element of the first row, the first two elements of the second row, and so on. The first element of *Covariances *is passed by reference. *Covariances* must be dimensioned by the caller. |
| *Means* | Output array of type Double. The vector of sample means from a sample of *NCases *observations. The first element of *Means *is passed by reference. Means must be dimensioned by the caller. |
| *NCases* | Input of type Integer. The number of observations. |

<a id="t_randommomentsmethodexample"></a>
###### RandomMoments Method Example

The following program specifies a multivariate normal population with covariance matrix and mean given by

$\boldsymbol{\Sigma}=\left[\begin{array}{ll} 3 & 1 \\ 1 & 2 \end{array}\right], \quad \boldsymbol{\mu}=\left[\begin{array}{l} 4 \\ 5 \end{array}\right]$.

Then it draws a sample of 500 and displays the sample covariance matrix and mean vector. The unbiased estimate of the covariance matrix is displayed because the default value of [SecondMomentsType](#t_secondmomentstypeproperty) is UNBIASED.

Module MainModule  Sub Main()  Dim arand As New AMOSRANDOMLib6.AmosRanGen  Dim PopCovariances(2) As Double  Dim PopMeans(1) As Double  PopCovariances(0) = 3  PopCovariances(1) = 1  PopCovariances(2) = 2  PopMeans(0) = 4  PopMeans(1) = 5  Call arand.SpecifyPopulation(PopCovariances, PopMeans)  Dim SampleCovariances(2) As Double  Dim SampleMeans(1) As Double   Call arand.RandomMoments(SampleCovariances(0), SampleMeans(0), 2, 500)   Dim ad As New AmosDebug.AmosDebug  Call ad.PrintTriangle(SampleCovariances, "Sample Covariances")  Call ad.PrintX(SampleMeans, "Sample Means")  End Sub End Module

<a id="t_randomvectormethod"></a>
###### RandomVector Method

*Help context ID: 6472*

Gets a random vector from the population specified by [SpecifyPopulation](#t_specifypopulationmethod).

Syntax

*object*.**RandomVector** (*X*)

The **RandomVector** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosRanGen**. |
| *X* | Output array of type Double. The random vector. The first element of *X* is passed by reference. It must be dimensioned by the caller. |

<a id="t_randomvectormethodexample"></a>
###### RandomVector Method Example

The following program specifies a multivariate normal population with covariance matrix and mean given by

$\boldsymbol{\Sigma}=\left[\begin{array}{ll} 3 & 1 \\ 1 & 2 \end{array}\right], \quad \boldsymbol{\mu}=\left[\begin{array}{l} 4 \\ 5 \end{array}\right]$.

Then it generates a sample of 20 cases from that population.

Imports System.Diagnostics Module MainModule  Sub Main()  Dim arand As New AMOSRANDOMLib6.AmosRanGen  Dim Covariances(2) As Double  Dim Means(1) As Double  Covariances(0) = 3  Covariances(1) = 1  Covariances(2) = 2  Means(0) = 4  Means(1) = 5  Call arand.SpecifyPopulation(Covariances, Means)   Dim x(1) As Double  Dim i As Long  For i = 1 To 20  Call arand.RandomVector(x(0), 2)  Debug.WriteLine(x(0) & x(1))  Next  End Sub End Module

<a id="t_restorestatemethod"></a>
###### RestoreState Method

*Help context ID: 6474*

The **RestoreState** method is no longer supported. The random number generator can be placed in a reproducible state by using the [NextSeed](#t_nextseedmethod) method of the **CAmosSeedManager** class to obtain a seed, and then using the [Initialize](#t_initializemethodamosrangen) method of the **AmosRanGen** class to initialize the random number generator.

<a id="t_restorestatefromfilemethod"></a>
###### RestoreStateFromFile Method

*Help context ID: 6475*

The **RestoreStateFromFile** method is no longer supported. The random number generator can be placed in a reproducible state by using the [NextSeed](#t_nextseedmethod) method of the **CAmosSeedManager** class to obtain a seed, and then using the [Initialize](#t_initializemethodamosrangen) method of the **AmosRanGen** class to initialize the random number generator.

<a id="t_savestatemethod"></a>
###### SaveState Method

*Help context ID: 6476*

The **SaveState** method is no longer supported. The random number generator can be placed in a reproducible state by using the [NextSeed](#t_nextseedmethod) method of the **CAmosSeedManager** class to obtain a seed, and then using the [Initialize](#t_initializemethodamosrangen) method of the **AmosRanGen** class to initialize the random number generator.

<a id="t_savestatetofilemethod"></a>
###### SaveStateToFile Method

*Help context ID: 6477*

The **SaveStateToFile** method is no longer supported. The random number generator can be placed in a reproducible state by using the [NextSeed](#t_nextseedmethod) method of the **CAmosSeedManager** class to obtain a seed, and then using the [Initialize](#t_initializemethodamosrangen) method of the **AmosRanGen** class to initialize the random number generator.

<a id="t_specifypopulationmethod"></a>
###### SpecifyPopulation Method

*Help context ID: 6479*

Specifies the population covariance matrix and mean vector used by [RandomMoments](#t_randommomentsmethod), [RandomVector](#t_randomvectormethod), [Rank](#t_rankproperty), [SqrDeterminant](#t_sqrdeterminantmethod). and [Sqrt](#t_sqrtmethod).

The specified population covariance matrix must be non-negative definite.

Syntax

*object*.**SpecifyPopulation** (*CovarianceMatrix, MeanVector*)

The **SpecifyPopulation** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosRanGen**. |
| *CovarianceMatrix* | Input. One-dimensional array of type Double. CovarianceMatrix is the population covariance matrix. CovarianceMatrix contains the first element of the first row, the first two elements of the second row, and so on. CovarianceMatrix is passed as a 1-dimensional array of type Double. |
| *MeanVector* | (Optional) Input. One-dimensional array of type Double. MeanVector is the population mean vector. MeanVector is passed as a 1-dimensional array of type Double. If MeanVector is omitted, the population mean vector is assumed to be zero. |

<a id="t_specifypopulationmethodexample"></a>
###### SpecifyPopulation Method Example

The following program specifies a multivariate normal population with covariance matrix and mean given by

$\boldsymbol{\Sigma}=\left[\begin{array}{ll} 3 & 1 \\ 1 & 2 \end{array}\right], \quad \boldsymbol{\mu}=\left[\begin{array}{l} 4 \\ 5 \end{array}\right]$.

Then it displays the square root of the determinant of the covariance matrix.

Imports System.Diagnostics Module MainModule  Sub Main()  Dim arand As New AMOSRANDOMLib6.AmosRanGen  Dim Covariances(2) As Double  Dim Means(1) As Double  Covariances(0) = 3  Covariances(1) = 1  Covariances(2) = 2  Means(0) = 4  Means(1) = 5   Call arand.SpecifyPopulation(Covariances, Means)   Debug.WriteLine(arand.SqrDeterminant())  End Sub End Module

<a id="t_sqrdeterminantmethod"></a>
###### SqrDeterminant Method

*Help context ID: 6480*

Gets the square root of the determinant of the covariance matrix previously specified with [SpecifyPopulation](#t_specifypopulationmethod).

Syntax

*result = object*.**SqrDeterminant **()

The **SqrDeterminant** property syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The square root of the determinant |
| *object* | An object of type **AmosRanGen**. |

<a id="t_sqrdeterminantmethodexample"></a>
###### SqrDeterminant Method Example

The following program specifies a multivariate normal population with covariance matrix and mean given by

$\boldsymbol{\Sigma}=\left[\begin{array}{ll} 3 & 1 \\ 1 & 2 \end{array}\right], \quad \boldsymbol{\mu}=\left[\begin{array}{l} 4 \\ 5 \end{array}\right]$.

Then it displays the square root of the determinant of the covariance matrix.

Imports System.Diagnostics Module MainModule  Sub Main()  Dim arand As New AMOSRANDOMLib6.AmosRanGen  Dim Covariances(2) As Double  Dim Means(1) As Double  Covariances(0) = 3  Covariances(1) = 1  Covariances(2) = 2  Means(0) = 4  Means(1) = 5   Call arand.SpecifyPopulation(Covariances, Means)   Debug.WriteLine(arand.SqrDeterminant())  End Sub End Module

<a id="t_sqrtmethod"></a>
###### Sqrt Method

*Help context ID: 6481*

Gets the Cholesky square root of the population covariance matrix previously specified with [SpecifyPopulation](#t_specifypopulationmethod).

Syntax

*object*.**Sqrt** (X)

The **Sqrt** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *X* | Output array of type Double. The Cholesky square root. The first element of *X* is passed by reference. It must be dimensioned by the caller. |
| *object* | An object of type **AmosRanGen**. |

<a id="t_sqrtmethodexample"></a>
###### Sqrt Method Example

The following program specifies a multivariate normal population with covariance matrix and mean given by

$\boldsymbol{\Sigma}=\left[\begin{array}{ll} 3 & 1 \\ 1 & 2 \end{array}\right], \quad \boldsymbol{\mu}=\left[\begin{array}{l} 4 \\ 5 \end{array}\right]$.

Then it displays the Cholesky square root of the covariance matrix.

Module MainModule  Sub Main()  Dim arand As New AMOSRANDOMLib6.AmosRanGen  Dim ad As New AmosDebug.AmosDebug  Dim Covariances(2) As Double  Dim Means(1) As Double  Covariances(0) = 3  Covariances(1) = 1  Covariances(2) = 2  Means(0) = 4  Means(1) = 5   Call arand.SpecifyPopulation(Covariances, Means)   Dim SquareRoot(2) As Double   Call arand.Sqrt(SquareRoot(0), 2)   Call ad.PrintTriangle(SquareRoot)  End Sub End Module

<a id="t_svmultmethod"></a>
###### SVMult Method

*Help context ID: 6482*

Multiplies a symmetric matrix times a vector.

Syntax

*object*.**SVMult**(*N, matrix, invector, outvector*)

The **SVMult** property syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosRanGen**. |
| *N* | Input of type Integer. The number of elements in the vector. |
| *matrix* | Input array of array of length N\*(N+1)/2, of type Double. matrix contains the first element of the first row, the first two elements of the second row, and so on. The first element of matrix is passed by reference. |
| *invector* | Input array of length N, of type Double. The first element of invector is passed by reference. |
| *outvector* | Output array of length N, of type Double. The product of matrix times invector. The first element of outvector is passed by reference. outvector must be dimensioned by the caller. |

Remarks

*outvector* must be distinct from *invector*.

<a id="t_svmultmethodexample"></a>
###### SVMult Method Example

The following program displays the result of the matrix multiplication, $\left[\begin{array}{ll} 3 & 1 \\ 1 & 2 \end{array}\right]\left[\begin{array}{l} 4 \\ 5 \end{array}\right]$.

Module MainModule  Public Sub Main()  Dim arand As New AMOSRANDOMLib6.AmosRanGen  Dim ad As New AmosDebug.AmosDebug  Dim A(2) As Double  Dim x(1) As Double  Dim y(1) As Double  A(0) = 3  A(1) = 1  A(2) = 2  x(0) = 4  x(1) = 5   Call arand.SVMult(2, A(0), x(0), y(0))   ad.PrintX(y)  End Sub End Module

<a id="t_timingtestmethod"></a>
###### TimingTest Method

*Help context ID: 6483*

Generates N uniform random numbers for performance testing.

Syntax

*object*.**TimingTest**(*N*)

The **TimingTest** property syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **AmosRanGen**. |
| *N* | The number of random numbers to generate. |

<a id="t_timingtestmethodexample"></a>
###### TimingTest Method Example

The following program reports the time needed to generate 100,000,000 random numbers.

Imports System Imports System.Diagnostics Imports Microsoft.VisualBasic Module MainModule  Sub Main()  Dim arand As New AMOSRANDOMLib6.AmosRanGen  Dim Time0 As DateTime  Time0 = Now  Call arand.TimingTest(100000000)  Debug.WriteLine("Elapsed time = " & Now.Subtract(Time0).ToString)  End Sub End Module

<a id="t_1950"></a>
### CAmosSeedManager Class Reference

The **CAmosSeedManager** class provides a means of generating seeds for use with the random number generators of the [AmosRanGen](#t_1893) class, and for maintaining a record of the seeds used by those random number generators. When you use [AmosRanGen](#t_1893) in your programs, you can use **CAmosSeedManager** to make sure that your programs always use the same random number seed, or to make sure that they always use a different random number seed. You can also use **CAmosSeedManager** to find the random number seeds used by your programs in the past.

If you are not using Amos's built-in program editor, you need to provide a reference to **SeedManager3.exe** in order to use the **CAmosSeedManager** class. In Visual Studio 2003:

- Click **Project -> Add Reference**.
- In the **Add Reference** dialog, click **Browse**.
- When the **Select Component** dialog opens, select SeedManager3.exe from the Amos program directory and click **Open**.
- In the **Add Reference** dialog, click **OK**.

<a id="t_camosseedmanagerclassmembers"></a>
#### CAmosSeedManager Class Members

[Methods](#t_7890)

<a id="t_7890"></a>
##### Methods

This section documents the methods of the CAmosSeedManager class.

<a id="t_nextseedmethod"></a>
###### NextSeed Method

*Help context ID: 6491*

Gets a 32-bit integer value that your program can use as a random number seed. The value returned by **NextSeed** is determined by a rule that you specify by clicking **Tools**®**Seed Manager** on the Amos Graphics menu, or by opening the Windows **Start** menu and searching for IBM SPSS Amos  Seed Manager.

Syntax

*object*.**NextSeed** (*AppName*)

The **NextSeed** property syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type **CAmosSeedManager**. |
| *AppName* | A string that identifies your program. |

<a id="t_nextseedmethodexample"></a>
###### NextSeed Method Example

The following program uses **NextSeed** to obtain a random number seed and then displays ten random numbers from a standard normal distribution. The random number seed will be saved in the **CAmosSeedManager** history log with the date and time and with the identifying string "My Program".

Imports System.Diagnostics Module MainModule  Sub Main()  Dim SeedManager As New PAmosSeedManager3.CAmosSeedManager3  Dim ARand As New AMOSRANDOMLib6.AmosRanGen  Dim Seed As Integer  Seed = SeedManager.NextSeed("My Program")  Call ARand.Initialize(Seed)   Dim i As Long  For i = 1 To 10  Debug.WriteLine(ARand.NextNormal)  Next  End Sub End Module

<a id="t_persistfilemethod"></a>
###### PersistFile Method

*Help context ID: 6492*

Gets the name of the file in which **CAmosSeedManager** keeps a history of random number seeds returned by **NextSeed**. The file may be examined in a text editor, although the history of seed values is more easily viewed by clicking **Tools**®**Seed Manager **on the Amos Graphics menu, or by opening the Windows **Start** menu and searching for IBM SPSS Amos  Seed Manager.

Syntax

*result = object*.**PersistFile **()

The **PersistFile** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The name of the file that contains the history of random number seeds. |
| *object* | An object of type **CAmosSeedManager**. |

<a id="t_persistfilemethodexample"></a>
###### PersistFile Method Example

The following program uses **PersistFile** to display the name of the file in which **CAmosSeedManager** keeps a history of random number seeds

Imports System.Diagnostics Module MainModule  Sub Main()  Dim SeedManager As New PAmosSeedManager3.CAmosSeedManager3  Debug.WriteLine(SeedManager.PersistFile())  End Sub End Module

<a id="t_8221"></a>
### CValue Class Reference

An object of type **CValue** is passed to the **Value** method in the **IUserValue** interface. (The **Value** method is the method that the user writes to specify a user-defined estimand.)

The **CValue** object that is passed to the **Value** method can be used to obtain information about a single sample and about estimates obtained by fitting the model to that sample. For example, a **CValue **object "knows" (for a particular sample) what the sample covariance matrix is, as well as the estimated values of all the model parameters, all the direct and indirect effects, the factor score weights, and so on. During some calls to the **Value** method, the **CValue** object provides information about the original sample. During other calls to the **Value** method, the **CValue** object provides information about a bootstrap sample.

[CValue Class Members](#t_8222)

<a id="t_8222"></a>
#### CValue Class Members

The [CValue](#t_8221) class members consist only of [methods](#t_8223). The class has no public properties.

<a id="t_8223"></a>
##### Methods

This section documents the methods of the [CValue](#t_8221) class.

<a id="t_8254"></a>
###### GetAllImpliedCorrelationsElement Method

Gets one element of the implied correlation matrix for all observed and latent variables, giving the implied correlation between two observed or latent variables. As an alternative, you can use [GetAllImpliedCorrelationsMatrix](#t_8238) to get the entire matrix of implied correlations.

Syntax

*result = object*.**GetAllImpliedCorrelationsElement** (*rowVariableName, columnVariableName*)

*result = object*.**GetAllImpliedCorrelationsElement** (*rowVariable, columnVariable*)

The **GetAllImpliedCorrelationsElement** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The implied correlation. |
| *object* | An object of type [CValue](#t_8221). |
| *rowVariableName* | (String) The name of an observed or latent variable. |
| *columnVariableName* | (String) The name of an observed or latent variable. |
| *rowVariable* | (An object of type [Variable](#t_8280)) An observed or latent variable. |
| *columnVariable* | (An object of type [Variable](#t_8280)) An observed or latent variable. |

<a id="t_8238"></a>
###### GetAllImpliedCorrelationsMatrix Method

Gets the implied correlation matrix for all observed and latent variables. As an alternative, you can use [GetAllImpliedCorrelationsElement](#t_8254) to get the implied correlation between two observed or latent variables.

Syntax

*object*.**GetAllImpliedCorrelationsMatrix** (*theSymmetricMatrix, variables*)

The **GetAllImpliedCorrelationsMatrix** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type [CValue](#t_8221). |
| *theSymmetricMatrix* | The implied correlation matrix. The returned matrix contains only the non-redundant diagonal and subdiagonal elements. |
| *variables* | A list of the [variables](#t_8280) that correspond to the rows (and also the columns) of the implied correlation matrix. |

<a id="t_8253"></a>
###### GetAllImpliedCovariancesElement Method

Gets one element of the implied covariance matrix for all observed and latent variables, giving the implied covariance between two observed or latent variables. As an alternative, you can use [GetAllImpliedCovariancesMatrix](#t_8237) to get the entire matrix of implied covariances.

Syntax

*result = object*.**GetAllImpliedCovariancesElement** (*rowVariableName, columnVariableName*)

*result = object*.**GetAllImpliedCovariancesElement** (*rowVariable, columnVariable*)

The **GetAllImpliedCovariancesElement** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The implied covariance. |
| *object* | An object of type [CValue](#t_8221). |
| *rowVariableName* | (String) The name of an observed or latent variable. |
| *columnVariableName* | (String) The name of an observed or latent variable. |
| *rowVariable* | (An object of type [Variable](#t_8280)) An observed or latent variable. |
| *columnVariable* | (An object of type [Variable](#t_8280)) An observed or latent variable. |

<a id="t_8237"></a>
###### GetAllImpliedCovariancesMatrix Method

Gets the implied covariance matrix for all observed and latent variables. As an alternative, you can use [GetAllImpliedCovariancesElement](#t_8253) to get the implied covariance between two observed or latent variables or the implied variance of a single observed or latent variable.

Syntax

*object*.**GetAllImpliedCovariancesMatrix** (*theSymmetricMatrix, variables*)

The **GetAllImpliedCovariancesMatrix** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type [CValue](#t_8221). |
| *theSymmetricMatrix* | The implied covariance matrix. The returned matrix contains only the non-redundant diagonal and subdiagonal elements. |
| *variables* | A list of the [variables](#t_8280) that correspond to the rows (and also the columns) of the implied covariance matrix. |

<a id="t_8255"></a>
###### GetAllImpliedMeansElement Method

Gets one element of the implied means vector for all observed and latent variables, giving the implied mean for a single observed or latent variable. As an alternative, you can use [GetAllImpliedMeansVector](#t_8239) to get the entire vector of implied means.

Syntax

*result = object*.**GetAllImpliedMeansElement** (*variableName*)

*result = object*.**GetAllImpliedMeansElement** (*theVariable*)

The **GetAllImpliedMeansElement** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The implied mean. |
| *object* | An object of type [CValue](#t_8221). |
| *variableName* | (String) The name of an observed or latent variable whose implied mean you want. |
| *theVariable* | (An object of type [Variable](#t_8280)) An observed or latent variable whose implied mean you want. |

<a id="t_8239"></a>
###### GetAllImpliedMeansVector Method

Gets the implied means vector for all observed and latent variables. As an alternative, you can use [GetAllImpliedMeansElement](#t_8255) to get the implied mean of a single observed or latent variable.

Syntax

*object*.**GetAllImpliedMeansVector** (*theVector, variables*)

The **GetAllImpliedMeansVector** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type [CValue](#t_8221). |
| *theVector* | A vector of implied means. |
| *variables* | A list of the [variables](#t_8280) that correspond to the elements of the implied means vector. |

<a id="t_8277"></a>
###### GetCorrelationList Method

Gets the correlations among exogenous variables.

Syntax

*result = object*.**GetCorrelationList** ()

The **GetCorrelationList** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | A list of [UnorderedPairAndValue](#t_8301) objects. Each [UnorderedPairAndValue](#t_8301) object consists of two [variables](#t_8280) and a correlation. |
| *object* | An object of type [CValue](#t_8221). |

<a id="t_8274"></a>
###### GetCovarianceList Method

Gets the covariances among exogenous variables.

Syntax

*result = object*.**GetCovarianceList** ()

The **GetCovarianceList** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | A list of [UnorderedPairAndValue](#t_8301) objects. Each [UnorderedPairAndValue](#t_8301) object consists of two [variables](#t_8280) and a covariance. |
| *object* | An object of type [CValue](#t_8221). |

<a id="t_8244"></a>
###### GetDirectEffectsElement Method

Gets one element of the matrix of direct effects, giving the direct effect of one variable on another. As an alternative, you can use [GetDirectEffectsMatrix](#t_8227) to get the entire matrix of direct effects.

Syntax

*result = object*.**GetDirectEffectsElement** (*rowVariableName, columnVariableName*)

*result = object*.**GetDirectEffectsElement** (*rowVariable, columnVariable*)

The **GetDirectEffectsElement** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | One element of the matrix of direct effects, giving the direct effect of one variable on another. |
| *object* | An object of type [CValue](#t_8221). |
| *rowVariableName* | (String) The name of the "dependent" variable for which you want to estimate the direct effect of some other variable. |
| *columnVariableName* | (String) The name of the "independent" variable whose direct effect on some other variable you want to estimate. |
| *rowVariable* | (An object of type [Variable](#t_8280)) The "dependent" variable for which you want to estimate the direct effect of some other variable. |
| *columnVariable* | (An object of type [Variable](#t_8280)) The "independent" variable whose direct effect on some other variable you want to estimate. |

<a id="t_8227"></a>
###### GetDirectEffectsMatrix Method

Gets the matrix of direct effects. As an alternative, you can use [GetDirectEffectsElement](#t_8244) to get the direct effect of one variable on another.

Syntax

*object*.**GetDirectEffectsMatrix** (*theDirectEffects, rowVariables, columnVariables*)

The **GetDirectEffectsMatrix** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type [CValue](#t_8221). |
| *theDirectEffects* | The matrix of direct effects. Each row and each column corresponds to a single model variable. The elements of the matrix give the effects of the column variables on the row variables. In other words, the column variables affect the row variables. |
| *rowVariables* | A list of the [variables](#t_8280) that correspond to the rows of the matrix of direct effects. |
| *columnVariables* | A list of the [variables](#t_8280) that correspond to the columns of the matrix of direct effects. |

<a id="t_8249"></a>
###### GetFactorScoreWeightsElement Method

Gets one element of the matrix of factor score weights, giving the regression weight applied to one of the observed variables in predicting one of the latent variables. As an alternative, you can use [GetFactorScoreWeightsMatrix](#t_8232) to get the entire matrix of factor score weights.

Syntax

*result = object*.**GetFactorScoreWeightsElement** (*rowVariableName, columnVariableName*)

*result = object*.**GetFactorScoreWeightsElement** (*rowVariable, columnVariable*)

The **GetFactorScoreWeightsElement** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The regression weight. |
| *object* | An object of type [CValue](#t_8221). |
| *rowVariableName* | (String) The name of one (predicted) latent variable. |
| *columnVariableName* | (String) The name of one observed variable (which acts as a predictor). |
| *rowVariable* | (An object of type [Variable](#t_8280)) A (predicted) latent variable. |
| *columnVariable* | (An object of type [Variable](#t_8280)) An observed variable (which acts as a predictor). |

<a id="t_8232"></a>
###### GetFactorScoreWeightsMatrix Method

Gets the matrix of factor score weights. As an alternative, you can use [GetFactorScoreWeightsElement](#t_8249) to get one element of the matrix of factor score weights.

Syntax

*object*.**GetFactorScoreWeightsMatrix** (*theFactorScoreWeights, rowVariables, columnVariables*)

The **GetFactorScoreWeightsMatrix** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type [CValue](#t_8221). |
| *theFactorScoreWeights* | The matrix of factor score weights. The rows of the matrix correspond to the unobserved variables in the model. The columns correspond to the observed variables. The elements of the matrix give the regression weights for using the observed variables to predict the unobserved variables. |
| *rowVariables* | A list of the [variables](#t_8280) that correspond to the rows of the matrix of factor score weights. |
| *columnVariables* | A list of the [variables](#t_8280) that correspond to the columns of the matrix of factor score weights. |

<a id="t_8259"></a>
###### GetGroupName Method

Gets the name of the group for which estimates and sample moments are available during this call to the Value method.

Syntax

*result = object*.**GetGroupName** ()

*result = object*.**GetGroupName** (*groupNumber*)

The **GetGroupName** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The group name. |
| *object* | An object of type [CValue](#t_8221). |
| *groupNumber* | A group number, where groupNumber=1 for the first group. |

<a id="t_8251"></a>
###### GetImpliedCorrelationsElement Method

Gets one element of the implied correlation matrix for the observed variables, giving the implied correlation between two observed variables. As an alternative, you can use [GetImpliedCorrelationsMatrix](#t_8235) to get the entire matrix of implied correlations.

Syntax

*result = object*.**GetImpliedCorrelationsElement** (*rowVariableName, columnVariableName*)

*result = object*.**GetImpliedCorrelationsElement** (*rowVariable, columnVariable*)

The **GetImpliedCorrelationsElement** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The implied correlation. |
| *object* | An object of type [CValue](#t_8221). |
| *rowVariableName* | (String) The name of an observed variable. |
| *columnVariableName* | (String) The name of an observed variable. |
| *rowVariable* | (An object of type [Variable](#t_8280)) An observed variable. |
| *columnVariable* | (An object of type [Variable](#t_8280)) An observed variable. |

<a id="t_8235"></a>
###### GetImpliedCorrelationsMatrix Method

Gets the implied correlation matrix for the observed variables in the model. As an alternative, you can use [GetImpliedCorrelationsElement](#t_8251) to get the implied correlation between two observed variables.

Syntax

*object*.**GetImpliedCorrelationsMatrix** (*theSymmetricMatrix, variables*)

The **GetImpliedCorrelationsMatrix** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type [CValue](#t_8221). |
| *theSymmetricMatrix* | The implied correlation matrix. The returned matrix contains only the non-redundant diagonal and subdiagonal elements. |
| *variables* | A list of the [variables](#t_8280) that correspond to the rows (and also the columns) of the implied correlation matrix. |

<a id="t_8250"></a>
###### GetImpliedCovariancesElement Method

Gets one element of the implied covariance matrix for the observed variables, giving the implied covariance between two observed variables. As an alternative, you can use [GetImpliedCovariancesMatrix](#t_8234) to get the entire matrix of implied covariances.

Syntax

*result = object*.**GetImpliedCovariancesElement** (*rowVariableName, columnVariableName*)

*result = object*.**GetImpliedCovariancesElement** (*rowVariable, columnVariable*)

The **GetImpliedCovariancesElement** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The implied covariance. |
| *object* | An object of type [CValue](#t_8221). |
| *rowVariableName* | (String) The name of an observed variable. |
| *columnVariableName* | (String) The name of an observed variable. |
| *rowVariable* | (An object of type [Variable](#t_8280)) An observed variable. |
| *columnVariable* | (An object of type [Variable](#t_8280)) An observed variable. |

<a id="t_8234"></a>
###### GetImpliedCovariancesMatrix Method

Gets the implied covariance matrix for the observed variables. As an alternative, you can use [GetImpliedCovariancesElement](#t_8250) to get the implied covariance between two observed variables or the implied variance of a single observed variable.

Syntax

*object*.**GetImpliedCovariancesMatrix** (*theSymmetricMatrix, variables*)

The **GetImpliedCovariancesMatrix** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type [CValue](#t_8221). |
| *theSymmetricMatrix* | The implied covariance matrix. The returned matrix contains only the non-redundant diagonal and subdiagonal elements. |
| *variables* | A list of the [variables](#t_8280) that correspond to the rows (and also the columns) of the implied covariance matrix. |

<a id="t_8252"></a>
###### GetImpliedMeansElement Method

Gets one element of the implied means vector for the observed variables, giving the implied mean for a single observed variable. As an alternative, you can use [GetImpliedMeansVector](#t_8236) to get the entire vector of implied means.

Syntax

*result = object*.**GetImpliedMeansElement** (*variableName*)

*result = object*.**GetImpliedMeansElement** (*theVariable*)

The **GetImpliedMeansElement** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The implied mean. |
| *object* | An object of type [CValue](#t_8221). |
| *variableName* | (String) The name of an observed variable whose implied mean you want. |
| *theVariable* | (An object of type [Variable](#t_8280)) An observed variable whose implied mean you want. |

<a id="t_8236"></a>
###### GetImpliedMeansVector Method

Gets the implied means vector for the observed variables. As an alternative, you can use [GetImpliedMeansElement](#t_8252) to get the implied mean of a single observed variable.

Syntax

*object*.**GetImpliedMeansVector** (*theVector, variables*)

The **GetImpliedMeansVector** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type [CValue](#t_8221). |
| *theVector* | A vector of implied means. |
| *variables* | A list of the [variables](#t_8280) that correspond to the elements of the implied means vector. |

<a id="t_8245"></a>
###### GetIndirectEffectsElement Method

Gets one element of the matrix of indirect effects, giving the indirect effect of one variable on another. As an alternative, you can use [GetIndirectEffectsMatrix](#t_8228) to get the entire matrix of indirect effects.

Syntax

*result = object*.**GetIndirectEffectsElement** (*rowVariableName, columnVariableName*)

*result = object*.**GetIndirectEffectsElement** (*rowVariable, columnVariable*)

The **GetIndirectEffectsElement** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | One element of the matrix of indirect effects, giving the indirect effect of one variable on another. |
| *object* | An object of type [CValue](#t_8221). |
| *rowVariableName* | (String) The name of the "dependent" variable for which you want to estimate the indirect effect of some other variable. |
| *columnVariableName* | (String) The name of the "independent" variable whose indirect effect on some other variable you want to estimate. |
| *rowVariable* | (An object of type [Variable](#t_8280)) The "dependent" variable for which you want to estimate the indirect effect of some other variable. |
| *columnVariable* | (An object of type [Variable](#t_8280)) The "independent" variable whose indirect effect on some other variable you want to estimate. |

<a id="t_8228"></a>
###### GetIndirectEffectsMatrix Method

Gets the matrix of indirect effects. As an alternative, you can use [GetIndirectEffectsElement](#t_8245) to get the indirect effect of one variable on another.

Syntax

*object*.**GetIndirectEffectsMatrix** (*theIndirectEffects, rowVariables, columnVariables*)

The **GetIndirectEffectsMatrix** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type [CValue](#t_8221). |
| *theIndirectEffects* | The matrix of indirect effects. Each row and each column corresponds to a single model variable. The elements of the matrix give the effects of the column variables on the row variables. In other words, the column variables affect the row variables. |
| *rowVariables* | A list of the [variables](#t_8280) that correspond to the rows of the matrix of indirect effects. |
| *columnVariables* | A list of the [variables](#t_8280) that correspond to the columns of the matrix of indirect effects. |

<a id="t_8273"></a>
###### GetInterceptList Method

Gets estimates of the intercepts in the regression equations for predicting the endogenous variables.

Syntax

*result = object*.**GetInterceptList** ()

The **GetInterceptList** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | A list of [VariableAndValue](#t_8289) objects. Each [VariableAndValue](#t_8289) object consists of an endogenous [Variable](#t_8280) and an intercept. Intercepts that are fixed at a constant, and therefore not estimated, are not included on the list. |
| *object* | An object of type [CValue](#t_8221). |

<a id="t_8272"></a>
###### GetMeanList Method

Gets the estimated means for the exogenous variables.

Syntax

*result = object*.**GetMeanList** ()

The **GetMeanList** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | A list of [VariableAndValue](#t_8289) objects. Each [VariableAndValue](#t_8289) object consists of an exogenous [Variable](#t_8280) and a mean. |
| *object* | An object of type [CValue](#t_8221). |

<a id="t_8271"></a>
###### GetRegressionWeightList Method

Gets the estimated regression weights.

Syntax

*result = object*.**GetRegressionWeightList** ()

The **GetRegressionWeightList** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | A list of [OrderedPairAndValue](#t_8295) objects. Each [OrderedPairAndValue](#t_8295) object consists of a dependent [Variable](#t_8280) (the 'to' variable), an independent [Variable](#t_8280) (the 'from' variable), and a regression weight. |
| *object* | An object of type [CValue](#t_8221). |

<a id="t_8257"></a>
###### GetSampleCorrelationsElement Method

Gets one element of the sample correlation matrix, giving the sample correlation between two observed variables. As an alternative, you can use [GetSampleCorrelationsMatrix](#t_8241) to get the entire matrix of sample correlations.

Syntax

*result = object*.**GetSampleCorrelationsElement** (*rowVariableName, columnVariableName*)

*result = object*.**GetSampleCorrelationsElement** (*rowVariable, columnVariable*)

The **GetSampleCorrelationsElement** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The sample correlation. |
| *object* | An object of type [CValue](#t_8221). |
| *rowVariableName* | (String) The name of an observed variable. |
| *columnVariableName* | (String) The name of an observed variable. |
| *rowVariable* | (An object of type [Variable](#t_8280)) An observed variable. |
| *columnVariable* | (An object of type [Variable](#t_8280)) An observed variable. |

<a id="t_8241"></a>
###### GetSampleCorrelationsMatrix Method

Gets the sample correlation matrix. As an alternative, you can use [GetSampleCorrelationsElement](#t_8257) to get the sample correlation between two observed variables.

Syntax

*object*.**GetSampleCorrelationsMatrix** (*theSymmetricMatrix, variables*)

The **GetSampleCorrelationsMatrix** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type [CValue](#t_8221). |
| *theSymmetricMatrix* | The sample correlation matrix. |
| *variables* | A list of the [variables](#t_8280) that correspond to the rows (and also the columns) of the sample correlation matrix. |

<a id="t_8256"></a>
###### GetSampleCovariancesElement Method

Gets one element of the sample covariance matrix, giving the sample covariance between two observed variables. As an alternative, you can use [GetSampleCovariancesMatrix](#t_8240) to get the entire matrix of sample covariances.

Syntax

*result = object*.**GetSampleCovariancesElement** (*rowVariableName, columnVariableName*)

*result = object*.**GetSampleCovariancesElement** (*rowVariable, columnVariable*)

The **GetSampleCovariancesElement** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The sample covariance. |
| *object* | An object of type [CValue](#t_8221). |
| *rowVariableName* | (String) The name of an observed variable. |
| *columnVariableName* | (String) The name of an observed variable. |
| *rowVariable* | (An object of type [Variable](#t_8280)) An observed variable. |
| *columnVariable* | (An object of type [Variable](#t_8280)) An observed variable. |

<a id="t_8240"></a>
###### GetSampleCovariancesMatrix Method

Gets the sample covariance matrix. As an alternative, you can use [GetSampleCovariancesElement](#t_8256) to get the sample covariance between two variables or the sample variance of a single variable.

Syntax

*object*.**GetSampleCovariancesMatrix** (*theSymmetricMatrix, variables*)

The **GetSampleCovariancesMatrix** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type [CValue](#t_8221). |
| *theSymmetricMatrix* | The sample correlation matrix. The returned matrix contains only the non-redundant diagonal and subdiagonal elements. |
| *variables* | A list of the [variables](#t_8280) that correspond to the rows (and also the columns) of the sample covariance matrix. |

<a id="t_8258"></a>
###### GetSampleMeansElement Method

Gets one element of the sample means vector, giving the sample mean for a single observed variable. As an alternative, you can use [GetSampleMeansVector](#t_8242) to get the entire vector of sample means.

Syntax

*result = object*.**GetSampleMeansElement** (*variableName*)

*result = object*.**GetSampleMeansElement** (*theVariable*)

The **GetSampleMeansElement** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The sample mean. |
| *object* | An object of type [CValue](#t_8221). |
| *variableName* | (String) The name of an observed variable whose sample mean you want. |
| *theVariable* | (An object of type [Variable](#t_8280)) An observed variable whose sample mean you want. |

<a id="t_8242"></a>
###### GetSampleMeansVector Method

Gets the sample means vector. As an alternative, you can use [GetSampleMeansElement](#t_8258) to get the sample mean of a single observed variable.

Syntax

*object*.**GetSampleMeansVector** (*theVector, variables*)

The **GetSampleMeansVector** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type [CValue](#t_8221). |
| *theVector* | A vector of sample means. |
| *variables* | A list of the [variables](#t_8280) that correspond to the elements of the sample means vector. |

<a id="t_8343"></a>
###### GetSmc Method

Gets the squared multiple correlation for an endogenous variable.

Syntax

*result = object*.**GetIndirectEffectsElement** (*variableName*)

*result = object*.**GetIndirectEffectsElement** (*theVariable*)

The **GetIndirectEffectsElement** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | (Double) The squared multiple correlation. |
| *object* | An object of type [CValue](#t_8221). |
| *variableName* | (String) The name of an endogenous variable. |
| *theVariable* | (An object of type [Variable](#t_8280)) An endogenous variable. |

<a id="t_8278"></a>
###### GetSmcList Method

Gets a list of squared multiple correlations for the endogenous variables.

Syntax

*result = object*.**GetSmcList** ()

The **GetSmcList** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | A list of [VariableAndValue](#t_8289) objects. Each [VariableAndValue](#t_8289) object consists of an endogenous [Variable](#t_8280) and a squared multiple correlation. |
| *object* | An object of type [CValue](#t_8221). |

<a id="t_8247"></a>
###### GetStandardizedDirectEffectsElement Method

Gets one element of the matrix of standardized direct effects, giving the standardized direct effect of one variable on another. As an alternative, you can use [GetStandardizedDirectEffectsMatrix](#t_8230) to get the entire matrix of standardized direct effects.

Syntax

*result = object*.**GetStandardizedDirectEffectsElement** (*rowVariableName, columnVariableName*)

*result = object*.**GetStandardizedDirectEffectsElement** (*rowVariable, columnVariable*)

The **GetStandardizedDirectEffectsElement** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | One element of the matrix of standardized direct effects, giving the standardized direct effect of one variable on another. |
| *object* | An object of type [CValue](#t_8221). |
| *rowVariableName* | (String) The name of the "dependent" variable for which you want to estimate the standardized direct effect of some other variable. |
| *columnVariableName* | (String) The name of the "independent" variable whose standardized direct effect on some other variable you want to estimate. |
| *rowVariable* | (An object of type [Variable](#t_8280)) The "dependent" variable for which you want to estimate the standardized direct effect of some other variable. |
| *columnVariable* | (An objet of type [Variable](#t_8280)) The "independent" variable whose standardized direct effect on some other variable you want to estimate. |

<a id="t_8230"></a>
###### GetStandardizedDirectEffectsMatrix Method

Gets the matrix of standardized direct effects. As an alternative, you can use [GetStandardizedDirectEffectsElement](#t_8247) to get the standardized direct effect of one variable on another.

Syntax

*object*.**GetStandardizedDirectEffectsMatrix** (*theStandardizedDirectEffects, rowVariables, columnVariables*)

The **GetStandardizedDirectEffectsMatrix** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type [CValue](#t_8221). |
| *theStandardizedDirectEffects* | The matrix of standardized direct effects. Each row and each column corresponds to a single model variable. The elements of the matrix give the effects of the column variables on the row variables. In other words, the column variables affect the row variables. |
| *rowVariables* | A list of the [variables](#t_8280) that correspond to the rows of the matrix of standardized direct effects. |
| *columnVariables* | A list of the [variables](#t_8280) that correspond to the columns of the matrix of standardized direct effects. |

<a id="t_8248"></a>
###### GetStandardizedIndirectEffectsElement Method

Gets one element of the matrix of standardized indirect effects, giving the standardized indirect effect of one variable on another. As an alternative, you can use [GetStandardizedIndirectEffectsMatrix](#t_8231) to get the entire matrix of standardized indirect effects.

Syntax

*result = object*.**GetStandardizedIndirectEffectsElement** (*rowVariableName, columnVariableName*)

*result = object*.**GetStandardizedIndirectEffectsElement** (*rowVariable, columnVariable*)

The **GetStandardizedIndirectEffectsElement** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | One element of the matrix of standardized indirect effects, giving the standardized indirect effect of one variable on another. |
| *object* | An object of type [CValue](#t_8221). |
| *rowVariableName* | (String) The name of the "dependent" variable for which you want to estimate the standardized indirect effect of some other variable. |
| *columnVariableName* | (String) The name of the "independent" variable whose standardized indirect effect on some other variable you want to estimate. |
| *rowVariable* | (An object of type [Variable](#t_8280)) The "dependent" variable for which you want to estimate the standardized indirect effect of some other variable. |
| *columnVariable* | (An object of type [Variable](#t_8280)) The "independent" variable whose standardized indirect effect on some other variable you want to estimate. |

<a id="t_8231"></a>
###### GetStandardizedIndirectEffectsMatrix Method

Gets the matrix of standardized indirect effects. As an alternative, you can use [GetStandardizedIndirectEffectsElement](#t_8248) to get the standardized indirect effect of one variable on another.

Syntax

*object*.**GetStandardizedIndirectEffectsMatrix** (*theStandardizedIndirectEffects, rowVariables, columnVariables*)

The **GetStandardizedIndirectEffectsMatrix** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type [CValue](#t_8221). |
| *theStandardizedIndirectEffects* | The matrix of standardized indirect effects. Each row and each column corresponds to a single model variable. The elements of the matrix give the effects of the column variables on the row variables. In other words, the column variables affect the row variables. |
| *rowVariables* | A list of the [variables](#t_8280) that correspond to the rows of the matrix of standardized indirect effects. |
| *columnVariables* | A list of the [variables](#t_8280) that correspond to the columns of the matrix of standardized indirect effects. |

<a id="t_8276"></a>
###### GetStandardizedRegressionWeightList Method

Gets the standardized regression weights.

Syntax

*result = object*.**GetStandardizedRegressionWeightList** ()

The **GetStandardizedRegressionWeightList** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | A list of [OrderedPairAndValue](#t_8295) objects. Each [OrderedPairAndValue](#t_8295) object consists of a dependent [Variable](#t_8280) (the 'to' variable), an independent [Variable](#t_8280) (the 'from' variable), and a standardized regression weight. |
| *object* | An object of type [CValue](#t_8221). |

<a id="t_8246"></a>
###### GetStandardizedTotalEffectsElement Method

Gets one element of the matrix of standardized total effects, giving the standardized total effect of one variable on another. As an alternative, you can use [GetStandardizedTotalEffectsMatrix](#t_8229) to get the entire matrix of standardized total effects.

Syntax

*result = object*.**GetStandardizedTotalEffectsElement** (*rowVariableName, columnVariableName*)

*result = object*.**GetStandardizedTotalEffectsElement** (*rowVariable, columnVariable*)

The **GetStandardizedTotalEffectsElement** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | One element of the matrix of standardized total effects, giving the standardized total effect of one variable on another. |
| *object* | An object of type [CValue](#t_8221). |
| *rowVariableName* | (String) The name of the "dependent" variable for which you want to estimate the standardized total effect of some other variable. |
| *columnVariableName* | (String) The name of the "independent" variable whose standardized total effect on some other variable you want to estimate. |
| *rowVariable* | (An object of type [Variable](#t_8280)) The "dependent" variable for which you want to estimate the standardized total effect of some other variable. |
| *columnVariable* | (An object of type [Variable](#t_8280)) The "independent" variable whose standardized total effect on some other variable you want to estimate. |

<a id="t_8229"></a>
###### GetStandardizedTotalEffectsMatrix Method

Gets the matrix of standardized total effects. As an alternative, you can use [GetStandardizedTotalEffectsElement](#t_8246) to get the standardized total effect of one variable on another.

Syntax

*object*.**GetStandardizedTotalEffectsMatrix** (*theStandardizedTotalEffects, rowVariables, columnVariables*)

The **GetStandardizedTotalEffectsMatrix** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type [CValue](#t_8221). |
| *theStandardizedTotalEffects* | The matrix of standardized total effects. Each row and each column corresponds to a single model variable. The elements of the matrix give the effects of the column variables on the row variables. In other words, the column variables affect the row variables. |
| *rowVariables* | A list of the [variables](#t_8280) that correspond to the rows of the matrix of standardized total effects. |
| *columnVariables* | A list of the [variables](#t_8280) that correspond to the columns of the matrix of standardized total effects. |

<a id="t_8225"></a>
###### GetTotalEffectsElement Method

Gets one element of the matrix of total effects, giving the total effect of one variable on another. As an alternative, you can use [GetTotalEffectsMatrix](#t_8224) to get the entire matrix of total effects.

Syntax

*result = object*.**GetTotalEffectsElement** (*rowVariableName, columnVariableName*)

*result = object*.**GetTotalEffectsElement** (*rowVariable, columnVariable*)

The **GetTotalEffectsElement** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | One element of the matrix of total effects, giving the total effect of one variable on another. |
| *object* | An object of type [CValue](#t_8221). |
| *rowVariableName* | (String) The name of the "dependent" variable for which you want to estimate the total effect of some other variable. |
| *columnVariableName* | (String) The name of the "independent" variable whose total effect on some other variable you want to estimate. |
| *rowVariable* | (An object of type [Variable](#t_8280)) The "dependent" variable for which you want to estimate the total effect of some other variable. |
| *columnVariable* | (An object of type [Variable](#t_8280)) The "independent" variable whose total effect on some other variable you want to estimate. |

<a id="t_8224"></a>
###### GetTotalEffectsMatrix Method

Gets the matrix of total effects. As an alternative, you can use [GetTotalEffectsElement](#t_8225) to get the total effect of one variable on another.

Syntax

*object*.**GetTotalEffectsMatrix** (*theTotalEffects, rowVariables, columnVariables*)

The **GetTotalEffectsMatrix** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type [CValue](#t_8221). |
| *theTotalEffects* | The matrix of total effects. Each row and each column corresponds to a single model variable. The elements of the matrix give the effects of the column variables on the row variables. In other words, the column variables affect the row variables. |
| *rowVariables* | A list of the [variables](#t_8280) that correspond to the rows of the matrix of total effects. |
| *columnVariables* | A list of the [variables](#t_8280) that correspond to the columns of the matrix of total effects. |

<a id="t_8275"></a>
###### GetVarianceList Method

Gets the variances of exogenous variables.

Syntax

*result = object*.**GetVarianceList** ()

The **GetVarianceList** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | A list of [VariableAndValue](#t_8289) objects. Each [VariableAndValue](#t_8289) object consists of an exogenous [Variable](#t_8280) and a variance. |
| *object* | An object of type [CValue](#t_8221). |

<a id="t_8260"></a>
###### IsModelingMeansAndIntercepts Method

Gets a boolean value that indicates whether means and intercepts are explicit model parameters.

Syntax

*result = object*.**IsModelingMeansAndIntercepts** ()

The **IsModelingMeansAndIntercepts** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | True if means and intercepts are explicit model parameters, false otherwise. |
| *object* | An object of type [CValue](#t_8221). |

<a id="t_8269"></a>
###### ListOfEndogenousVariables Method

Gets a list of the endogenous variables in the model.

Syntax

*result = object*.**ListOfEndogenousVariables** ()

The **ListOfEndogenousVariables** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The list of endogenous [variables](#t_8280) in the model. |
| *object* | An object of type [CValue](#t_8221). |

<a id="t_8267"></a>
###### ListOfObservedVariables Method

Gets a list of the observed variables in the model.

Syntax

*result = object*.**ListOfObservedVariables** ()

The **ListOfObservedVariables** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The list of observed [variables](#t_8280) in the model. |
| *object* | An object of type [CValue](#t_8221). |

<a id="t_8268"></a>
###### ListOfUnobservedVariables Method

Gets a list of the unobserved variables in the model.

Syntax

*result = object*.**ListOfUnobservedVariables** ()

The **ListOfUnobservedVariables** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The list of unobserved [variables](#t_8280) in the model. |
| *object* | An object of type [CValue](#t_8221). |

<a id="t_8261"></a>
###### NumberOfGroups Method

Gets the number of groups.

Syntax

*result = object*.**NumberOfGroups** ()

The **NumberOfGroups** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The number of groups. |
| *object* | An object of type [CValue](#t_8221). |

<a id="t_8262"></a>
###### NumberOfParameters Method

Gets the number of parameters.

Syntax

*result = object*.**NumberOfParameters** ()

The **NumberOfParameters** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The number of parameters. |
| *object* | An object of type [CValue](#t_8221). |

<a id="t_8263"></a>
###### ParameterName Method

Gets the name of a parameter.

Syntax

*result = object*.**ParameterName** (*parameterIndex*)

The **ParameterName** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | A parameter name, which will be an empty string for parameters that are not named. |
| *object* | An object of type [CValue](#t_8221). |
| *parameterIndex* | An integer index that identifies a parameter uniquely. parameterIndex ranges from 1 to n, where n is the number of parameters. |

<a id="t_8264"></a>
###### ParameterNumber Method

Gets an integer index that identifies a parameter uniquely.

Syntax

*result = object*.**ParameterNumber** (*parameterName*)

The **ParameterNumber** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | An integer index that identifies a parameter uniquely. The index ranges from 1 to n, where n is the number of parameters. |
| *object* | An object of type [CValue](#t_8221). |
| *parameterName* | The parameter name. (Note that some parameters may be unnamed.) |

<a id="t_8265"></a>
###### ParameterValue Method

Gets a parameter value.

Syntax

*result = object*.**ParameterValue** (*parameterName*)

*result = object*.**ParameterValue** (*rowVariable, columnVariable*)

The **ParameterValue** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The parameter value. |
| *object* | An object of type [CValue](#t_8221). |
| *parameterName* | The parameter name. (Note that some parameters may be unnamed.) |
| *parameterIndex* | An integer index that identifies a parameter uniquely. parameterIndex ranges from 1 to n, where n is the number of parameters. |

<a id="t_8266"></a>
###### ParameterVector Method

Gets a vector of all parameter values.

Syntax

*object*.**ParameterVector** (*theVector*)

The **ParameterVector** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *object* | An object of type [CValue](#t_8221). |
| *theVector* | The vector of parameter values. |

<a id="t_8270"></a>
###### VariableFromName Method

Gets a [Variable](#t_8280) object . A **Variable** object contains information about a variable, such as its name, whether it is exogenous, etc.

Syntax

*result = object*.**VariableFromName** (*variableName*)

The **VariableFromName** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | An object of type [Variable](#t_8280). |
| *object* | An object of type [CValue](#t_8221). |
| *variableName* | (String) A variable name. |

<a id="t_8389"></a>
### CValueSimple Class Reference

[CValueSimple Class Members](#t_8391)

<a id="t_8391"></a>
#### CValueSimple Class Members

The [CValueSimple](#t_8389) class members consist only of [methods](#t_8393). The class has no public properties.

<a id="t_8393"></a>
##### Methods

This section documents the methods of the [CValueSimple](#t_8389) class.

<a id="t_8399"></a>
###### DirectEffect Method

Gets the direct effect of one variable on another.

Syntax

*result = object*.**DirectEffect** (*dependentVariable, independentVariable*)

The **DirectEffect** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The direct effect. |
| *object* | An object of type [CValueSimple](#t_8389). |
| *dependentVariable* | (An object of type [Variable](#t_8280)) The "dependent" variable. |
| *independentVariable* | (An object of type [Variable](#t_8280)) The "independent" variable. |

<a id="t_8404"></a>
###### FactorScoreWeight Method

Gets the regression weight applied to one of the observed variables when all observed variables are used to predict one of the latent variables.

Syntax

*result = object*.**FactorScoreWeight** (*latentVariable, observedVariable*)

The **FactorScoreWeight** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The standardized total effect. |
| *object* | An object of type [CValueSimple](#t_8389). |
| *latentVariable* | (An object of type [Variable](#t_8280)) A (predicted) latent variable. |
| *observedVariable* | (An object of type [Variable](#t_8280)) An observed predictor variable. |

<a id="t_8395"></a>
###### ImpliedCorrelation Method

Gets the implied correlation between two observed or latent variables. This method cannot be used to get the implied correlation between a unique variable (such as an error variable) and another variable.

Syntax

*result = object*.**ImpliedCorrelation** (*variable1, variable2*)

The **ImpliedCorrelation** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The implied correlation. |
| *object* | An object of type [CValueSimple](#t_8389). |
| *variable1* | (An object of type [Variable](#t_8280)) An observed or latent variable. |
| *variable2* | (An object of type [Variable](#t_8280)) An observed or latent variable. |

<a id="t_8394"></a>
###### ImpliedCovariance Method

Gets the implied covariance between two observed or latent variables. This method cannot be used to get the implied covariance between a unique variable (such as an error variable) and another variable.

Syntax

*result = object*.**ImpliedCovariance** (*variable1, variable2*)

The **ImpliedCovariance** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The implied covariance. |
| *object* | An object of type [CValueSimple](#t_8389). |
| *variable1* | (An object of type [Variable](#t_8280)) An observed or latent variable. |
| *variable2* | (An object of type [Variable](#t_8280)) An observed or latent variable. |

<a id="t_8396"></a>
###### ImpliedMean Method

Gets the implied mean for a single observed or latent variable. This method cannot be used to get the implied mean of a unique variable (such as an error variable).

Syntax

*result = object*.**ImpliedMean** (*theVariable*)

The **ImpliedMean** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The implied mean. |
| *object* | An object of type [CValueSimple](#t_8389). |
| *theVariable* | (An object of type [Variable](#t_8280)) An observed or latent variable. |

<a id="t_8400"></a>
###### IndirectEffect Method

Gets the indirect effect of one variable on another.

Syntax

*result = object*.**IndirectEffect** (*dependentVariable, independentVariable*)

The **IndirectEffect** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The indirect effect. |
| *object* | An object of type [CValueSimple](#t_8389). |
| *dependentVariable* | (An object of type [Variable](#t_8280)) The "dependent" variable. |
| *independentVariable* | (An object of type [Variable](#t_8280)) The "independent" variable. |

<a id="t_8408"></a>
###### Intercept Method

Gets the intercept in the regression equation for predicting an endogenous variable.

Syntax

*result = object*.**Intercept** (*theVariable*)

The **Intercept** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The intercept. |
| *object* | An object of type [CValueSimple](#t_8389). |
| *theVariable* | (An object of type [Variable](#t_8280)) An endogenous variable. |

<a id="t_8397"></a>
###### SampleCorrelation Method

Gets the sample correlation between two observed variables.

Syntax

*result = object*.**SampleCorrelation** (*variable1, variable2*)

The **SampleCorrelation** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The sample correlation. |
| *object* | An object of type [CValueSimple](#t_8389). |
| *variable1* | (An object of type [Variable](#t_8280)) An observed variable. |
| *variable2* | (An object of type [Variable](#t_8280)) An observed variable. |

<a id="t_8398"></a>
###### SampleCovariance Method

Gets the sample covariance between two observed variables.

Syntax

*result = object*.**SampleCovariance** (*variable1, variable2*)

The **SampleCovariance** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The sample covariance. |
| *object* | An object of type [CValueSimple](#t_8389). |
| *variable1* | (An object of type [Variable](#t_8280)) An observed variable. |
| *variable2* | (An object of type [Variable](#t_8280)) An observed variable. |

<a id="t_8406"></a>
###### SampleMean Method

Gets the sample mean for a single observed variable.

Syntax

*result = object*.**SampleMean** (*theVariable*)

The **SampleMean** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The sample mean. |
| *object* | An object of type [CValueSimple](#t_8389). |
| *theVariable* | (An object of type [Variable](#t_8280)) An observed variable. |

<a id="t_8407"></a>
###### Smc Method

Gets the squared multiple correlation between an endogenous variable and its predictors.

Syntax

*result = object*.**Smc** (*theVariable*)

The **Smc** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The squared multiple correlation. |
| *object* | An object of type [CValueSimple](#t_8389). |
| *theVariable* | (An object of type [Variable](#t_8280)) An endogenous variable. |

<a id="t_8402"></a>
###### StandardizedDirectEffect Method

Gets the standardized direct effect of one variable on another.

Syntax

*result = object*.**StandardizedDirectEffect** (*dependentVariable, independentVariable*)

The **StandardizeDirectEffect** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The standardized direct effect. |
| *object* | An object of type [CValueSimple](#t_8389). |
| *dependentVariable* | (An object of type [Variable](#t_8280)) The "dependent" variable. |
| *independentVariable* | (An object of type [Variable](#t_8280)) The "independent" variable. |

<a id="t_8403"></a>
###### StandardizedIndirectEffect Method

Gets the standardized indirect effect of one variable on another.

Syntax

*result = object*.**StandardizedIndirectEffect** (*dependentVariable, independentVariable*)

The **StandardizedIndirectEffect** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The standardized indirect effect. |
| *object* | An object of type [CValueSimple](#t_8389). |
| *dependentVariable* | (An object of type [Variable](#t_8280)) The "dependent" variable. |
| *independentVariable* | (An object of type [Variable](#t_8280)) The "independent" variable. |

<a id="t_8405"></a>
###### StandardizedTotalEffect Method

Gets the standardized total effect of one variable on another.

Syntax

*result = object*.**StandardizedTotalEffect** (*dependentVariable, independentVariable*)

The **StandardizedTotalEffect** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The standardized total effect. |
| *object* | An object of type [CValueSimple](#t_8389). |
| *dependentVariable* | (An object of type [Variable](#t_8280)) The "dependent" variable. |
| *independentVariable* | (An object of type [Variable](#t_8280)) The "independent" variable. |

<a id="t_8401"></a>
###### TotalEffect Method

Gets the total effect of one variable on another.

Syntax

*result = object*.**TotalEffect** (*dependentVariable, independentVariable*)

The **TotalEffect** method syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The total effect. |
| *object* | An object of type [CValueSimple](#t_8389). |
| *dependentVariable* | (An object of type [Variable](#t_8280)) The "dependent" variable. |
| *independentVariable* | (An object of type [Variable](#t_8280)) The "independent" variable. |

<a id="t_8279"></a>
### The t Namespace

The t namespace contains several classes that you are likely to make use of in defining your own estimands. When writing a program to specify a user-defined estimand you can get an intelliprompt list of classes in the t namespace by typing "t." (in other words, by typing the letter 't' and then a period ('.')

<a id="t_8295"></a>
#### OrderedPairAndValue Class Reference

An **OrderedPairAndValue** object consists of an ordered pair of variables and a numeric value associated with the pair. For example, it might consist of an independent variable, a dependent variable, and a regression weight.

<a id="t_8296"></a>
##### OrderedPairAndValue Class Members

<a id="t_8297"></a>
###### Properties

<a id="t_8298"></a>
###### fromVariable Property

Gets a [Variable](#t_8280) object that refers to an independent variable. A **Variable** object contains information about a variable, such as its name, whether it is exogenous, etc.

Syntax

*result = object*.**fromVariable**

The **fromVariable** property syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The independent [Variable](#t_8280) object. |
| *object* | An object of type [CValue](#t_8221). |

<a id="t_8299"></a>
###### toVariable Property

Gets a [Variable](#t_8280) object that refers to a dependent variable. A **Variable** object contains information about a variable, such as its name, whether it is exogenous, etc.

Syntax

*result = object*.**toVariable**

The **toVariable** property syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The dependent [Variable](#t_8280) object. |
| *object* | An object of type [CValue](#t_8221). |

<a id="t_8300"></a>
###### value Property

Gets a numeric value, either a regression weight or a standardized regression weight, that is associated with an ordered pair of variables.

Syntax

*result = object*.**value**

The **value** property syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The regression weight or standardized regression weight. |
| *object* | An object of type [CValue](#t_8221). |

<a id="t_8301"></a>
#### UnorderedPairAndValue Class Reference

An **UnorderedPairAndValue** object consists of an unordered pair of variables and a numeric value associated with the pair. For example, it might consist of two variables and their correlation.

<a id="t_8302"></a>
##### UnorderedPairAndValue Class Members

<a id="t_8303"></a>
###### Properties

<a id="t_8304"></a>
###### variable1 Property

Gets a [Variable](#t_8280) object. A **Variable** object contains information about a variable, such as its name, whether it is exogenous, etc.

Syntax

*result = object*.**variable1**

The **variable1** property syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | A [Variable](#t_8280) object. |
| *object* | An object of type [CValue](#t_8221). |

<a id="t_8305"></a>
###### variable2 Property

Gets a [Variable](#t_8280) object. A **Variable** object contains information about a variable, such as its name, whether it is exogenous, etc.

Syntax

*result = object*.**variable2**

The **variable2** property syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | A [Variable](#t_8280) object. |
| *object* | An object of type [CValue](#t_8221). |

<a id="t_8306"></a>
###### value Property

Gets a numeric value, such as a correlation or covariance, that is associated with an unordered pair of variables.

Syntax

*result = object*.**value**

The **value** property syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The numeric value. |
| *object* | An object of type [CValue](#t_8221). |

<a id="t_8280"></a>
#### Variable Class Reference

A **Variable **object contains information about a single model variable, such as the variable's name, whether it is observed, whether it is exogenous, and so on.

<a id="t_8281"></a>
##### Variable Class Members

<a id="t_8283"></a>
###### Properties

<a id="t_8284"></a>
###### Name Property

Gets the variable's name.

Syntax

*result = object*.**Name**

The **Name** property syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | Gets the variable's name. |
| *object* | An object of type [CValue](#t_8221). |

<a id="t_8285"></a>
###### IsUnique Property

Gets a boolean value that indicates whether the variable is a unique variable (i.e., is unobserved and exogenous, and affects only one other variable).

Syntax

*result = object*.**IsUnique**

The **IsUnique** property syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | True if the variable is a unique variable. |
| *object* | An object of type [CValue](#t_8221). |

<a id="t_8286"></a>
###### IsEndogenous Property

Gets a boolean value that indicates whether the variable is endogenous.

Syntax

*result = object*.**IsEndogenous**

The **IsEndogenous** property syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | True if the variable is endogenous. |
| *object* | An object of type [CValue](#t_8221). |

<a id="t_8287"></a>
###### IsObserved Property

Gets a boolean value that indicates whether the variable is observed.

Syntax

*result = object*.**IsObserved**

The **IsObserved** property syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | True if the variable is observed. |
| *object* | An object of type [CValue](#t_8221). |

<a id="t_8289"></a>
#### VariableAndValue Class Reference

A **VariableAndValue** object consists of a model variable together with a numeric value that is associated with the variable. For example, a VariableAndValue object might contain a variable and its variance, or a variable and its mean.

<a id="t_8290"></a>
##### VariableAndValue Class Members

<a id="t_8291"></a>
###### Properties

<a id="t_8292"></a>
###### variable Property

Gets a [Variable](#t_8280) object. A **Variable **object contains information about a variable, such as its name, whether it is exogenous, etc.

Syntax

*result = object*.**variable**

The **variable** property syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The [Variable](#t_8280) object. |
| *object* | An object of type [CValue](#t_8221). |

<a id="t_8294"></a>
###### value Property

Gets a numeric value that is associated with a model variable (for example, the variable's mean or variance).

Syntax

*result = object*.**value**

The **value** property syntax has the following parts:


| Part | Description |
| --- | --- |
| *result* | The numeric value. |
| *object* | An object of type [CValue](#t_8221). |

<a id="t_8288"></a>
#### VariableList Class Reference

The **VariableList** class inherits from Generic.List(Of Variable). VariableList does not have any members other than the members of Generic.List(Of Variable). The VariableList class is provided only as shorthand for Generic.List(Of Variable).

<a id="t_1957"></a>
## Additional Programming Examples

<a id="t_examplesusingtheamosgraphicsclasses"></a>
### Examples using the Amos Graphics classes

<a id="t_usetheamosgraphicsclassestocalculateanewfitmeasure"></a>
#### Use the Amos Graphics classes to calculate a new fit measure

The following plugin adds to Amos Graphics the ability to compute an additional fit measure -- the standardized root mean square residual (RMR). After you run this plugin, Amos Graphics will display the standardized root mean square residual for each analysis that it performs.

The **PreFitOptions** subroutine tells the Amos Engine that sample correlations and implied correlations are needed for calculation of the standardized RMR.

The **PostFitResults** subroutine calculates and displays the standardized RMR.

Imports Microsoft.VisualBasic Imports Amos Imports AmosEngineLib.AmosEngine.TMatrixID <System.ComponentModel.Composition.Export(GetType(IPlugin))> Public Class CustomCode  Implements IPlugin   Public Function Mainsub() As Integer Implements IPlugin.Mainsub  AddHandler Pd.PreFitOptions, AddressOf PreFitOptions  AddHandler Pd.PostFitResults, AddressOf PostFitResults  MsgBox("The plugin for calculating standardized RMR is now installed.",, "Standardized RMR")  End Function   Private Sub PreFitOptions(ByVal Sem As AmosEngineLib.AmosEngine)  Sem.NeedEstimates(SampleCorrelations)  Sem.NeedEstimates(ImpliedCorrelations)  End Sub   Private Sub PostFitResults(ByVal Sem As AmosEngineLib.AmosEngine, ByVal ModelName As String, ByVal status As Integer)  Dim N As Integer  Dim i As Integer  Dim j As Integer  Dim DTemp As Double  Dim Sample(,) As Double  Dim Implied(,) As Double  Sem.GetEstimates(SampleCorrelations, Sample)  Sem.GetEstimates(ImpliedCorrelations, Implied)  N = UBound(Sample, 1) + 1   DTemp = 0  For i = 1 To N - 1  For j = 0 To i - 1  DTemp = DTemp + (Sample(i, j) - Implied(i, j)) ^ 2  Next  Next   DTemp = System.Math.Sqrt(DTemp / (N \* (N - 1) / 2))   'Dtemp is the standardized RMR  'Display it  Dim message As String  message = "Model: " & ModelName & vbCrLf  If status = 0 Then  message &= "Standardized RMR = " & DTemp.ToString("#.0000")  Else  message &= ("The model was not successfully fitted.")  End If  MsgBox(message,,"Standardized RMR")  End Sub   Public Function Name() As String Implements IPlugin.Name  End Function   Public Function Description() As String Implements IPlugin.Description  End Function End Class

<a id="t_usetheamosgraphicsclassestochangetheappearanceoflatentvariables"></a>
#### Use the Amos Graphics classes to change the appearance of latent variables

Running the following Amos Graphics plugin modifies the appearance of latent variables. The [Undraw](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_undrawmethod) and [Draw](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_drawmethod) methods make the changes immediately visible. The [UndoToHere](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_undotoheremethod) and [UndoResume](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_undoresumemethod) methods allow you to undo all the changes carried out by the program with one press of [](https://ai-docs.amosdevelopment.com/02-amos-graphics-reference-guide-part-1.md#t_undothepreviouschange). The **On Error GoTo** statement is a safety measure to make sure that undo capability is restored before the program exits.

Imports Amos Imports System.drawing <System.ComponentModel.Composition.Export(GetType(IPlugin))> Public Class CustomCode  Implements IPlugin   Public Function Mainsub() As Integer Implements IPlugin.Mainsub  Dim x As PDElement  Pd.UndoToHere()  On Error Goto ErrExit   For Each x In Pd.PDElements  If x.IsLatentVariable Then  x.Undraw()  x.BorderColor = Color.Black.ToArgb  x.FillColor = Color.White.ToArgb  x.NameColor = Color.Red.ToArgb  x.ParameterColor = Color.Green.ToArgb  x.Fillstyle = 0  x.Penwidth = 2  x.Draw()  End If  Next  ErrExit:  Pd.UndoResume()  End Function   Public Function Name() As String Implements IPlugin.Name  End Function   Public Function Description() As String Implements IPlugin.Description  End Function End Class

<a id="t_usetheamosgraphicsclassestocreateuserdefinedproperties"></a>
#### Use the Amos Graphics classes to create user-defined properties

When the path diagram of Example 4 (which includes a variable called **Performance**) is in the Amos Graphics window, the following plugin uses the [PropertySave](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_propertysavemethod) method to create two properties for Performance. The two properties are called **Reliability** and **Variance**. Reliability is assigned the value ".8230" and Variance is assigned the value ".0209". These numbers are in fact the reliability estimate and the sample variance for Performance reported by [Warren, White and Fuller (1974)](https://ai-docs.amosdevelopment.com/08-references.md#t_warren__white__fuller_1974). When the path diagram is subsequently saved, these two properties of Performance will be saved along with it.

Imports Amos <System.ComponentModel.Composition.Export(GetType(IPlugin))> Public Class CustomCode  Implements IPlugin   Public Function Mainsub() As Integer Implements IPlugin.Mainsub  Dim E As PDElement  E = Pd.PDE("Performance")  E.PropertySave("Reliability", ".8230")  E.PropertySave("Variance", ".0209")  End Function   Public Function Name() As String Implements IPlugin.Name  End Function   Public Function Description() As String Implements IPlugin.Description  End Function End Class

The following plugin uses the properties created by the previous plugin to compute an estimate of Performance's error variance. If Reliability or Variance is undefined, [PropertyGet](https://ai-docs.amosdevelopment.com/04-programming-with-amos-part-1.md#t_propertygetmethod) returns the non-numeric string, "x". Attempting to perform arithmetic with the non-numeric string generates the error message "Could not compute error variance."

Imports Microsoft.VisualBasic Imports Amos <System.ComponentModel.Composition.Export(GetType(IPlugin))> Public Class CustomCode  Implements IPlugin   Public Function Mainsub() As Integer Implements IPlugin.Mainsub  Dim ErrorVariance As Double  Try  Dim E As PDElement = Pd.PDE("Performance")  ErrorVariance = (1 - E.PropertyGet("Reliability", "x")) _  \* E.PropertyGet("Variance", "x")  MsgBox("Error variance = " & ErrorVariance,, "Error variance")  Catch ex As System.Exception  MsgBox("Could not compute error variance.",, "Error variance")  End Try  End Function   Public Function Name() As String Implements IPlugin.Name  End Function   Public Function Description() As String Implements IPlugin.Description  End Function End Class

