Skip to content

Example 11: Single Indicator (Version 0.2)

psunthud edited this page Dec 30, 2012 · 3 revisions

Model Description

This example will show how to create a factor with a single indicator. We will not introduce any new syntax here; however, we will emphasize on the mean and variance vectors. We will simulate a model with three factors: two of which are single-indicator factors and the other factor has three indicators. The multiple indicator factor and one single-indicator factor predict the other single-indicator factor. The loadings of the multiple indicator factor are uniformly distribution from 0.7 to 0.9 and the error variances are set to make the indicator variance of 1. The factor loadings of the single-indicator factors are freely estimated with a population parameter of 1. The factor loading is free instead of the factor variance to set the scale of factor variance at 1 and making the latent covariance matrix equivalent to a correlation matrix. The error variances of the single-indicator factors are fixed to 0. The variances of all factors are fixed to 1. The exogenous factor correlation is uniformly distributed from -0.5 to 0.5, as well as the regression paths toward the only endogenous factor. We still have model misspecification in error correlations (normally distributed with the mean of 0 and standard deviation of 1). The misspecified error correlations are not applicable to the indicators in the single-indicator factor. The exogenous single-indicator factor is chi-squared distributed with three degrees of freedom.

Example 11 Model

Syntax

All relevant distribution objects are specified:

u79 <- simUnif(0.7, 0.9)
u5 <- simUnif(-0.5, 0.5)
n01 <- simNorm(0, 1)
c5 <- simChisq(5)

Factor loading are specified:

loading <- matrix(0, 5, 3)
loading[1:3, 1] <- NA
loading[4, 2] <- NA
loading[5, 3] <- NA
loadingVal <- matrix(0, 5, 3)
loadingVal[1:3, 1] <- "u79"
loadingVal[4, 2] <- 1
loadingVal[5, 3] <- 1
LY <- simMatrix(loading, loadingVal)

Note that the factor loadings of Indicators 4 and 5 are free and set their parameter values as 1. The factor correlation is specified:

facCor <- diag(3)
facCor[2, 1] <- NA
facCor[1, 2] <- NA
RPS <- symMatrix(facCor, "u5")

The regression paths among factors are specified:

path <- matrix(0, 3, 3)
path[3, 1] <- NA
path[3, 2] <- NA
BE <- simMatrix(path, "u5")

The error correlations are specified:

RTE <- symMatrix(diag(5))

Importantly, the indicator variances (not measurement error variance) are specified:

VY <- simVector(c(NA, NA, NA, 0, 0), 1)

The indicator variances of the first three indicators are set as free and have parameter values of 1. It means that the error variances are free and the parameter values of the error variances are the values that make the indicator variances equal 1. The last two indicators, the single-indicator factors, are not free and fixed as 0. For this package, if the total indicator variance is set to 0, it means that error variance is set to 0. This feature sallow users to set measurement error of 0 while allowing them to set the total variance of other variables at the same time.

The set of SEM object is specified:

SEM.Model <- simSetSEM(LY=LY, RPS=RPS, BE=BE, RTE=RTE, VY=VY)

Trivial model misspecification is specified:

errorCorMis <- diag(5)
errorCorMis[1:3, 1:3] <- NA
errorCorMis <- diag(5)
RTE.mis <- symMatrix(errorCorMis, n01)
SEM.Model.Mis <- simMisspecSEM(RTE=RTE.mis)

The distribution of factors (one multiple indicator factor and two single indicator factors) is specified:

facDist <- simDataDist(n01, c5, n01)

The data object, model object, and result object are specified:

SimData <- simData(SEM.Model, 200, misspec=SEM.Model.Mis, sequential=TRUE, facDist=facDist)
SimModel <- simModel(SEM.Model, estimator="mlm")
Output <- simResult(1000, SimData, SimModel)
getCutoff(Output, 0.05)
plotCutoff(Output, 0.05)
summaryParam(Output)

The figure below shows the graph provided by the plotCutoff function:

Example 11 SSD

Here is the summary of the whole script in this example.

Remarks

Fix Factor Loading in Specifying Single Indicator

The example specifies single indicator factors by freeing the factor loadings and estimating the indicator intercepts to specify the mean. Instead, we can estimate the factor variance and factor mean as another parameterization of the single indicator. The syntax is more complicated. The factor loading in Lines 8-16 can be changed to:

loading <- matrix(0, 5, 3)
loading[1:3, 1] <- NA
loading[4, 2] <- 1
loading[5, 3] <- 1
loadingVal <- matrix(0, 5, 3)
loadingVal[1:3, 1] <- "u79"
LY <- simMatrix(loading, loadingVal)

The factor loadings of the single-indicator factors are fixed to 1. In addition, Lines 31-32 can be changed to:

VE <- simVector(c(1, NA, NA), c(0, 1, 1))
ME <- simVector(c(0, NA, NA), c(0, 0, 0))
TY <- simVector(c(NA, NA, NA, 0, 0), rep(0, 5))
SEM.Model <- simSetSEM(LY=LY, RPS=RPS, BE=BE, RTE=RTE, VY=VY, VE=VE, ME=ME, TY=TY)

VE is the total variance of factors. Here we fix the variance of the first factor as 1. The variances of the single-indicator factors are free and their parameter values are 1. ME is the total mean of factors. The overall mean of the first factor is fixed to 1. The overall mean of the second and the third factors are free and their parameter values are 1. TY is the indicator intercept. The first three indicators intercepts are freely estimates and their parameter values are 1. The measurement intercepts of the single-factor indicator are fixed to 1. The measurement intercepts of the other two indicators are fixed to 1.

Clone this wiki locally