Running a Delta CFI

151 views
Skip to first unread message

p007...@brookes.ac.uk

unread,
Jan 22, 2017, 3:55:28 AM1/22/17
to lavaan
In my research I have run a model with  three different variations of which the last finds better fit statistics. I reported this but a requested correction for my thesis is that it would be helpful to run and report a delta CFI to test this statistically. I have used the tutorial and installed the semTools package. I can also see that I need to model the syntax on;
'measurementInvariance(HS.model, data = HolzingerSwineford1939, group = "school")' however am struggling to adapt this to my project. Can anyone advise? The syntax I am using is pasted below. Also can anyone advise on a good paper that indicates how to then write up the findings. Many thanks

library('foreign')

library('lavaan')

library('lme4')

library('semPlot')

library(semTools)

 

 

# Read data C:\Users\brown\Desktop\DPhil\SEM analysis

mydata <- read.spss ("C:/Users/Carol/Desktop/DPhil/SEM analysis/SEM analysis april 2016 inc MLR/Main study data (AS1).sav", to.data.frame=T)

 

# Create numeric school variable

mydata$school[mydata$schsector=="State sector"] <- 1

mydata$school[mydata$schsector=="Independent sector"] <- 0

 

# scale variables

mydata$ISEImo2 <- mydata$ISEImo / 10

mydata$ISEIfa2 <- mydata$ISEIfa / 10

mydata$ TotalASExaminationPointscore <- mydata$ TotalASExaminationPointscore / 100

# 2. What is the relationship between expectations and subjective task value for an A-level student sample?

 

rq.2 <- '

# Measurement part

# Expectations

expectations =~ Q24 + Q26 + Q28 + Q32 + Q36

 

 

#STV model 1 (3 factor)

intrinsic  =~ Q21 + Q30

attainment =~ Q25 + Q31 + Q37

utility =~ Q22 + Q34

 

STV =~ intrinsic + attainment + utility'

 

fit <- sem(rq.2, data = mydata, missing='fiml', estimator='MLR')

summary(fit, fit.measures=TRUE, standardized=TRUE)

inspect(fit,"cor.lv")

semPaths (fit, what="std",

          style="lisrel",edge.color="black", fade=FALSE,

          edge.width=0.5, nCharNodes=7, intercepts = FALSE)

 

rq.2 <- '

 

# Measurement part

 

# Expectations

expectations =~ Q24 + Q26 + Q28 + Q32 + Q36

 

#STV model 2 (attainment utility as a combined model)

intrinsic  =~ Q21 + Q30

attainmentutility =~ Q25 + Q31 + Q37 + Q22 + Q34

 

STV =~ intrinsic + attainmentutility'

 

 

fit <- sem(rq.2, data = mydata, missing='fiml', estimator='MLR')

summary(fit, fit.measures=TRUE, standardized=TRUE)

inspect(fit,"cor.lv")

semPaths (fit, what="std",

          style="lisrel",edge.color="black", fade=FALSE,

          edge.width=0.5, nCharNodes=7, intercepts = FALSE)

 

 

#STV (excluding utility value)

 

rq.2 <- '

 

# Measurement part

# Expectations

expectations =~ Q24 + Q26 + Q28 + Q32 + Q36

 

#STV model 3 (excluding utility)

 

intrinsic  =~ Q21 + Q30

attainment =~ Q25 + Q31 + Q37

 

STV =~ intrinsic + attainment'

 

fit <- sem(rq.2, data = mydata, missing='fiml', estimator='MLR')

 

summary(fit, fit.measures=TRUE, standardized=TRUE)

inspect(fit,"cor.lv")

semPaths (fit, what="std",

          style="lisrel",edge.color="black", fade=FALSE,

          edge.width=0.5, nCharNodes=7, intercepts = FALSE)

Terrence Jorgensen

unread,
Jan 23, 2017, 9:17:13 AM1/23/17
to lavaan
the last finds better fit statistics

Your last model excludes two variables, so that statistic is not comparable with the models that were fit to a different set of data.

report a delta CFI to test this statistically

CFI is a fit index, not a test statistic. It is more appropriate to think of it as a measure of effect size that accompanies a null-hypothesis test.  Chi-squared tells you whether your fit is statistically significant, whereas CFI tells you how substantial that difference is (relative to the fit of a baseline model).   

'measurementInvariance(HS.model, data = HolzingerSwineford1939, group = "school")' however am struggling to adapt this to my project

This function is for testing whether parameters of the same model are equivalent across groups (school in that example).  You are not fitting a multigroup model.  You are fitting different models to the same single sample.  You can just print the fit measures you want using the fitMeasures() function on each of your fitted models (see details in the tutorial: http://lavaan.ugent.be/tutorial/inspect.html). You can also see them displayed in the summary() output when you add the argument fit.measures = TRUE.

Also can anyone advise on a good paper that indicates how to then write up the findings. 

I'd recommend Hoyle's (2012) Handbook of SEM, which has a chapter on what to report, written by the same author above but more updated to current standards.  The handbook has lots of useful chapters devoted to specific topics, so it is worth having.

Terrence D. Jorgensen
Postdoctoral Researcher, Methods and Statistics
Research Institute for Child Development and Education, the University of Amsterdam

p007...@brookes.ac.uk

unread,
Jan 27, 2017, 4:42:15 AM1/27/17
to lavaan
Dear Terrance

Thank you so much for the advice and taking the time to reply. If I understand correctly here (and from the reading recommended) it seems that a Delta CFI may not actually be appropriate for my data as I am testing 3 different models with the same sample? I had run a separate model fit for each one usinf fit measures=True and reported these in my research. I have appreciated your advice, Thanks for taking the time to reply

Best wishes

Carol
Reply all
Reply to author
Forward
0 new messages