Learn R Programming

simsem (version 0.2-0)

indProd: Make a product of indicators using mean centering or double-mean centering

Description

This function will use mean centering or double is a constrctor of a function object which can be used for data transformation. The aim of the object is to create a function but will use later in a simulation study. For example, set up a mean centering for a dataset for using in a simulation.

Usage

indProd(data, var1, var2, match = TRUE, meanC = TRUE, residualC = FALSE, doubleMC = TRUE, namesProd = NULL)

Arguments

data
The desired data to be transformed.
var1
Names or indices of the variables loaded on the first factor
var2
Names or indices of the variables loaded on the second factor
match
Specify TRUE to use match-paired approach (Marsh, Wen, & Hau, 2004). If FALSE, the resulting products are all possible products.
meanC
Specify TRUE for mean centering the main effect indicator before making the products
residualC
Specify TRUE for residual centering the products by the main effect indicators (Little, Bovaird, & Widaman, 2006).
doubleMC
Specify TRUE for centering the resulting products (Lin et. al., 2010)
namesProd
The names of resulting products

Value

  • The original data attached with the products.

References

  • Marsh, H. W., Wen, Z. & Hau, K. T. (2004). Structural equation models of latent interactions: Evaluation of alternative estimation strategies and indicator construction.Psychological Methods, 9,275-300.
  • Lin, G. C., Wen, Z., Marsh, H. W., & Lin, H. S. (2010). Structural equation models of latent interactions: Clarification of orthogonalizing and double-mean-centering strategies.Structural Equation Modeling, 17, 374-391.
  • Little, T. D., Bovaird, J. A., & Widaman, K. F. (2006). On the merits of orthogonalizing powered and product terms: Implications for modeling interactions among latent variables.Structural Equation Modeling, 13, 497-519.

See Also

  • simFunctionto use this function within a simulation study

Examples

Run this code
dat <- indProd(attitude[,-1], var1=1:3, var2=4:6)

Run the code above in your browser using DataLab