easystats / easystats/performance
support `lavaan.mi` models
Open
Nobody has claimed this yet.
Bug :bug:
Enhancement :boom:
- Dominant language
- R
- Stars
- 1.2k
- Forks
- 109
- Avg merge
- 6h 34m
- Merged PRs (30d)
- 8
Description
library(lavaan.mi)
data("mtcars")
set.seed(20260205)
mtcars_amp <- mice::ampute(mtcars)$amp
imp <- mice::mice(mtcars_amp)
mod <- "
mpg ~ hp + vs
hp ~ am
"
fit.mi <- sem.mi(mod, data = imp)
performance::model_performance(fit.mi)
#> Warning: Objects of class `lavaan.mi` are not supported model objects.
#> NULL
This does work though:
lavaan::fitMeasures(fit.mi)
#>
#> Test statistic(s) pooled using the D4 pooling method.
#> Pooled statistic: "standard"
#>
#> npar fmin chisq
#> 5.000 0.671 43.900
#> df pvalue baseline.chisq
#> 2.000 0.000 77.570
#> baseline.df baseline.pvalue cfi
#> 5.000 0.000 0.423
#> tli nnfi rfi
#> -0.443 -0.443 1.000
#> nfi pnfi ifi
#> 0.434 0.174 0.446
#> rni logl unrestricted.logl
#> 0.423 -264.179 -241.989
#> aic bic ntotal
#> 538.357 545.686 32.000
#> bic2 rmsea rmsea.ci.lower
#> 530.099 0.809 0.612
#> rmsea.ci.upper rmsea.ci.level rmsea.pvalue
#> 1.025 0.900 0.000
#> rmsea.close.h0 rmsea.notclose.pvalue rmsea.notclose.h0
#> 0.050 1.000 0.080
#> rmr rmr_nomean srmr
#> 20.736 20.736 0.297
#> srmr_bentler srmr_bentler_nomean crmr
#> 0.297 0.297 0.367
#> crmr_nomean srmr_mplus srmr_mplus_nomean
#> 0.367 0.289 0.289
#> cn_05 cn_01 gfi
#> 5.367 7.714 0.508
#> agfi pgfi mfi
#> -1.461 0.102 0.520
#> ecvi
#> 1.684
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the example with lavaan.mi and trace performance::model_performance(fit.mi), comparing its behavior with lavaan::fitMeasures(fit.mi). Done means model_performance supports lavaan.mi objects without the current warning and returns performance metrics.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100