Movatterモバイル変換


[0]ホーム

URL:


lavaan.mi

This is an R package whose primary purpose is to extend thefunctionality of the R packagelavaan. When incomplete datahave been multiply imputed, thelavaan.mi package allowsusers to fit structural equation models as they would using thelavaan package.

The development version can be installed from GitHub using theremotespackage:

remotes::install_github("TDJorgensen/lavaan.mi")

Connectinglavaan.mi tolavaan

The top 4 lines of the table below indicate thelavaan.mi::lavaan.mi() function corresponds to thelavaan::lavaan() function, as do the wrapperscfa.mi(),sem.mi(), andgrowth.mi(), all of which return an object of classlavaan.mi.

standardizedSolution.mi()
lavaan Functionlavaan.mi Function
lavaan()lavaan.mi()
cfa()cfa.mi()
sem()sem.mi()
growth()growth.mi()
parameterEstimates()parameterEstimates.mi()
standardizedSolution()
lavTestLRT()lavTestLRT.mi()
lavTestWald()lavTestWald.mi()
lavTestScore()lavTestScore.mi()
modIndices()modIndices.mi()
lavResiduals()lavResiduals.mi()

Thedata= argument must be alist ofdata.frames rather than a singledata.frame,and the specifiedlavaan::model.syntax will be applied toeachdata.frame in thelist.

Inheritance fromlavaanList

Thelavaan.mi class inherits from classlavaanList (from thelavaan package),extending it with a few additional and customized slots (seeclass?lavaanList andclass?lavaan.mi fordetails).

It isnot wise to use “lazy loading” (i.e., callinglavaan.mi::lavaan.mi() without loadinglibrary(lavaan.mi) explicitly) because R may have troublefinding the correct methods in the package for applying genericfunctions (e.g.,summary) tolavaan.mi-classobjects. This occasionally happened in thesemTools packageas well. When the correct methods are not found, then the genericfunction will revert to the methods written forlavaanList-class objects (e.g.,summary() willonly have anest.ave column for the average estimate acrossdata sets). In most cases (e.g.,fitted(),anova(),residuals(), etc.), this will causean error because few methods have been written forlavaanList-class objects.

Additionallavaan output can be obtained per imputationusing theFUN= argument, which is applied to alavaan-class object formed from the result of eachimputation (prior to its being stored more succinctly in alavaanList-class object). The last?lavaan.mihelp-page example demonstrates how to obtain and extract additionaloutput.

Methods forlavaan andlavaan.mi objects

Many remaining methods written forlavaan-class objectsare also available forlavaan.mi-class objects (also seeclass?lavaan.mi for a list and descriptions ofarguments):

Connectinglavaan.mi tosemTools

Many of the functions in thesemTools package continueto be available forlavaan.mi-class objects (e.g.,semTools::compRelSEM() for model-based reliability), andfunctions such assemTools::parcelAllocation() andsemTools::plausibleValues() are enhanced by allowing theiroutput to be analyzed usinglavaan.mi().


[8]ページ先頭

©2009-2025 Movatter.jp