r-lavaan

Error in getMethod(“summary”, signature = “FitDiff”)

天大地大妈咪最大 提交于 2020-08-09 08:46:42
问题 I am comparing lavaan objects using semTools::compareFit . It is throwing a very strange error message. I tried also the following reproducible example: data("HolzingerSwineford1939",package="lavaan") HS.modelA <- ' visual =~ x1 + x2 + x3 textual =~ x4 + x5 + x6 speed =~ x7 + x8 + x9' HS.modelB<- ' visual =~ x1 + x2 textual =~ x4 + x5 + x6 speed =~ x7 + x8 + x9' fit.A<- cfa(HS.modelA, data = HolzingerSwineford1939) fit.B<- cfa(HS.modelB, data = HolzingerSwineford1939) semTools::compareFit(fit

Error in getMethod(“summary”, signature = “FitDiff”)

和自甴很熟 提交于 2020-08-09 08:46:17
问题 I am comparing lavaan objects using semTools::compareFit . It is throwing a very strange error message. I tried also the following reproducible example: data("HolzingerSwineford1939",package="lavaan") HS.modelA <- ' visual =~ x1 + x2 + x3 textual =~ x4 + x5 + x6 speed =~ x7 + x8 + x9' HS.modelB<- ' visual =~ x1 + x2 textual =~ x4 + x5 + x6 speed =~ x7 + x8 + x9' fit.A<- cfa(HS.modelA, data = HolzingerSwineford1939) fit.B<- cfa(HS.modelB, data = HolzingerSwineford1939) semTools::compareFit(fit

Creating a first stage mediated moderation model, syntax issues

泄露秘密 提交于 2020-07-09 14:31:39
问题 How can I create a first stage mediated moderation model in R? I have been trying to write a model like this in lavaan, but I am running into issues trying to adapt the code from the laavan webpage. model <- ' # direct effect Y ~ c*X # mediator M ~ a*X Y ~ b*M # indirect effect (a*b) ab := a*b # total effect total := c + (a*b) ' fit <- sem(model) summary(fit) 回答1: I have full code, example datasets, and a .pdf walk-through of how to do this here. Relevant portion from the .pdf: “First Stage”

multiple imputation and multigroup SEM in R

匆匆过客 提交于 2020-06-17 15:17:18
问题 I want to perform multigroup SEM on imputed data using the R packages mice and semTools , specifically the runMI function that calls Lavaan . I am able to do so when imputing the entire dataset at once, but whilst trawling through stackoverflow/stackexchange I have come across the recommendation to impute data separately for each level of a grouping variable (e.g. men, women), so that the features of each group are preserved (e.g. https://stats.stackexchange.com/questions/149053/questions-on

multiple imputation and multigroup SEM in R

纵然是瞬间 提交于 2020-06-17 15:17:13
问题 I want to perform multigroup SEM on imputed data using the R packages mice and semTools , specifically the runMI function that calls Lavaan . I am able to do so when imputing the entire dataset at once, but whilst trawling through stackoverflow/stackexchange I have come across the recommendation to impute data separately for each level of a grouping variable (e.g. men, women), so that the features of each group are preserved (e.g. https://stats.stackexchange.com/questions/149053/questions-on

Implement ConQuest score command in TAM

谁说胖子不能爱 提交于 2019-12-20 06:07:42
问题 in the IRT software ConQuest you can use the command "score" to model multiple dimensions/latent variables using the same manifest variable/raw data, but different coding. For example: score (1,2,3) (0,1,2) (0,1,0) ! items(1-3); "recodes" the original scores from 1 to 3 in 0, 1, and 2 for the first dimension and to 0, 1, 0 for the second dimension (latent variable). Do you know any way how to implement the same in the R package TAM (using the lavaan syntax or otherwise)? I am trying to run a

Implement ConQuest score command in TAM

孤者浪人 提交于 2019-12-02 09:33:46
in the IRT software ConQuest you can use the command "score" to model multiple dimensions/latent variables using the same manifest variable/raw data, but different coding. For example: score (1,2,3) (0,1,2) (0,1,0) ! items(1-3); "recodes" the original scores from 1 to 3 in 0, 1, and 2 for the first dimension and to 0, 1, 0 for the second dimension (latent variable). Do you know any way how to implement the same in the R package TAM (using the lavaan syntax or otherwise)? I am trying to run a PCM analysis. Great thanks in advance! KH I didn't get an answer here, but I contacted Alexander