Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Labelling of factor intercepts in model.syntax with grouping variable leads to fit issues (fewer df) #84

Open
juliuspfadt opened this issue Jan 21, 2022 · 0 comments
Assignees

Comments

@juliuspfadt
Copy link
Collaborator

juliuspfadt commented Jan 21, 2022

To reproduce this one has to use the latest version for jaspFactor, which might not be in the nightlies yet.
However, in R one can:

library(lavaan)
dt <- read.csv("https://raw.githubusercontent.com/jasp-stats/jasp-desktop/development/Resources/Data%20Sets/Data%20Library/14.%20SEM/Grand%20Point%20Average.csv", header = T)

mod <- "
f1 =~ gpa1+ gpa2+ gpa3+ gpa4+ gpa5+ gpa6
f2 =~ job3+ job4+ job5+ job6
f1 ~ c(0, NA)*1
f2 ~ c(0, NA)*1
"
fit <- cfa(mod, dt, std.lv = TRUE, group = "admitted", meanstructure = TRUE)
fitmeasures(fit)
summary(fit)

this part is also what is produced through JASP:

f1 ~ c(0, NA) * 1
f2 ~ c(0, NA) * 1

stems from here: https://github.com/juliuspf/jaspFactor/blob/invarianceFix/R/confirmatoryfactoranalysis.R#L323-L333
I am confused and wonder why this piece of model syntax is added. It seems sufficient to just set meanstructure to TRUE.

I obtain standard error issues (can't be calculated) if the model syntax is specified like above, but no issues when only meanstructure=TRUE and the piece of code is omitted from the model syntax. All other estimates stay equal.

In terms of model syntax this should mean that the mean of the first factor for group 1 is set to 0 and the mean for the second group is forced to be a free parameter.... but why

As I understand this, with meanstructure you can either estimate the latent means or the manifest means. By default it is always the manifest means that are estimated, and only if one forces the manifest means to be zero in the model.syntax will the model estimate the latent means. But we do not have that option in JASP, so in any case the latent means will always be zero.

I suggest to not label the intercepts for the factors when we have multiple groups since meanstructure=TRUE is specified either way when the meanstructure option is chosen. The other parameter estimates won't change, it would only lead to fewer convergence issues since there are two degrees of freedom more.

@juliuspfadt juliuspfadt changed the title labelling of factor intercepts in model.synatx with grouping variable leads to fit issues Labelling of factor intercepts in model.syntax with grouping variable leads to fit issues Jan 21, 2022
@juliuspfadt juliuspfadt changed the title Labelling of factor intercepts in model.syntax with grouping variable leads to fit issues Labelling of factor intercepts in model.syntax with grouping variable leads to fit issues (fewer df) Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants