Learn R Programming

sirt (version 1.6-0)

lsem.estimate: Local Structural Equation Models (LSEM)

Description

Local structural equation models (LSEM) are structural equation models (SEM) which are evaluated for each value of a pre-defined moderator variable (Hildenbrandt, Wilhelm, & Robitzsch, 2009). Like in nonparametric regression models, observations near a focal point - at which the model is evaluated - obtain higher weights, far distant obervations obtain lower weight. The LSEM can be specified by making use of lavaan syntax. It is also possible to specify a discretized version of LSEM which means that values of the moderator are grouped into a small number of groups. The LSEM can be tested by employing a permutation test, see lsem.permutationTest. The function lsem.MGM.stepfunctions outputs stepwise functions for a multiple group model evaluated at a grid of focal points of the moderator, specified in moderator.grid.

Usage

lsem.estimate(data, moderator, moderator.grid, lavmodel, type="LSEM", h = 1.1, 
    residualize=TRUE, fit_measures = c("rmsea", "tli", "gfi", "srmr"), eps = 1e-08,
    verbose = TRUE, ...)
    
## S3 method for class 'lsem':
summary(object, file=NULL, digits=3, ...)

## S3 method for class 'lsem':
plot(x , parindex=NULL , ask=TRUE , ci = TRUE , lintrend = TRUE , 
       parsummary = TRUE , ylim=NULL , xlab=NULL,  ylab=NULL , main=NULL , 
       digits=3, ...)
       
lsem.MGM.stepfunctions( object , moderator.grid )

Arguments

data
Data frame
moderator
Variable name of the moderator
moderator.grid
Focal points at which the LSEM should be evaluated. If type="MGM", breaks are defined in this vector.
lavmodel
Specified SEM in lavaan. The function sem (lavaan) is used.
type
Type of estimated model. The default is type="LSEM" which means that a local structural equation model is estimated. A multiple group model with a discretized moderator as the grouping variable can be estimated with type="MGM"
h
Bandwidth factor
residualize
Logical indicating whether a residualization should be applied.
fit_measures
Vector with names of fit measures following the labels in lavaan
eps
Minimum number for weights
verbose
Optional logical printing information about computation progress.
object
Object of class lsem
file
A file name in which the summary output will be written.
digits
Number of digits.
x
Object of class lsem.
parindex
Vector of indices for parameters in plot function.
ask
A logical which asks for changing the graphic for each parameter.
ci
Logical indicating whether confidence intervals should be plotted.
lintrend
Logical indicating whether a linear trend should be plotted.
parsummary
Logical indicating whether a parameter summary should be displayed.
ylim
Plot parameter ylim. Can be a list, see Examples.
xlab
Plot parameter xlab. Can be a vector.
ylab
Plot parameter ylab. Can be a vector.
main
Plot parameter main. Can be a vector.
...
Further arguments to be passed to sem (lavaan).

Value

  • List with following entries
  • parametersData frame with all parameters estimated at focal points of moderator
  • weightsData frame with weights at each focal point
  • bwUsed bandwidth
  • hUsed bandwidth factor
  • NSample size
  • moderator.densityEstimated frequencies and effective sample size for moderator at focal points
  • moderator.statDescriptive statistics for moderator
  • moderatorVariable name of moderator
  • moderator.gridUsed grid of focal points for moderator
  • moderator.groupedData frame with informations about grouping of moderator if type="MGM".
  • residualized.interceptsEstmated intercept functions used for residualization.
  • lavmodelUsed lavaan model
  • dataUsed data frame, possibly residualized if residualize=TRUE

References

Hildebrandt, A., Wilhelm, O., & Robitzsch, A. (2009). Complementary and competing factor analytic approaches for the investigation of measurement invariance. Review of Psychology, 16, 87-102.

See Also

lsem.permutationTest

Examples

Run this code
#############################################################################
# EXAMPLE 1: data.lsem01 | Age differentiation
#############################################################################	
	
data(data.lsem01)
dat <- data.lsem01

# specify lavaan model
lavmodel <- "
        F =~ v1+v2+v3+v4+v5
        F ~~ 1*F"
        
# define grid of moderator variable age
moderator.grid <- seq(4,23,1)

#********************************
#*** Model 1: estimate LSEM with bandwidth 2
mod1 <- lsem.estimate( dat , moderator="age" , moderator.grid=moderator.grid , 
               lavmodel=lavmodel , h=2 , std.lv=TRUE)
summary(mod1)
plot(mod1 , parindex=1:5)

# perform permutation test for Model 1
pmod1 <- lsem.permutationTest( mod1 , B=10 )    
          # only for illustrative purposes the number of permutations B is set 
          # to a low number of 10
summary(pmod1)
plot(pmod1, type="global")

#********************************
#*** Model 2: estimate multiple group model with 4 age groups

# define breaks for age groups
moderator.grid <- seq( 3.5 , 23.5 , len=5) # 4 groups 
# estimate model
mod2 <- lsem.estimate( dat , moderator="age" , moderator.grid=moderator.grid , 
           lavmodel=lavmodel , type="MGM" , std.lv=TRUE)
summary(mod2)

# output step functions
smod2 <- lsem.MGM.stepfunctions( lsem.object=mod2 , moderator.grid=seq(4,23,1) )
str(smod2)

Run the code above in your browser using DataLab