Package: lava 1.8.0
lava: Latent Variable Models
A general implementation of Structural Equation Models with latent variables (MLE, 2SLS, and composite likelihood estimators) with both continuous, censored, and ordinal outcomes (Holst and Budtz-Joergensen (2013) <doi:10.1007/s00180-012-0344-y>). Mixture latent variable models and non-linear latent variable models (Holst and Budtz-Joergensen (2020) <doi:10.1093/biostatistics/kxy082>). The package also provides methods for graph exploration (d-separation, back-door criterion), simulation of general non-linear latent variable models, and estimation of influence functions for a broad range of statistical models.
Authors:
lava_1.8.0.tar.gz
lava_1.8.0.zip(r-4.5)lava_1.8.0.zip(r-4.4)lava_1.8.0.zip(r-4.3)
lava_1.8.0.tgz(r-4.4-any)lava_1.8.0.tgz(r-4.3-any)
lava_1.8.0.tar.gz(r-4.5-noble)lava_1.8.0.tar.gz(r-4.4-noble)
lava_1.8.0.tgz(r-4.4-emscripten)lava_1.8.0.tgz(r-4.3-emscripten)
lava.pdf |lava.html✨
lava/json (API)
NEWS
# Install 'lava' in R: |
install.packages('lava', repos = c('https://kkholst.r-universe.dev', 'https://cloud.r-project.org')) |
Bug tracker:https://github.com/kkholst/lava/issues
- bmd - Longitudinal Bone Mineral Density Data
- bmidata - Data
- brisa - Simulated data
- calcium - Longitudinal Bone Mineral Density Data
- hubble - Hubble data
- hubble2 - Hubble data
- indoorenv - Data
- missingdata - Missing data example
- nldata - Example data
- nsem - Example SEM data
- semdata - Example SEM data
- serotonin - Serotonin data
- serotonin2 - Data
- twindata - Twin menarche data
latent-variable-modelssimulationstatisticsstructural-equation-models
Last updated 9 months agofrom:35f308aa10. Checks:OK: 7. Indexed: yes.
Target | Result | Date |
---|---|---|
Doc / Vignettes | OK | Nov 20 2024 |
R-4.5-win | OK | Nov 20 2024 |
R-4.5-linux | OK | Nov 20 2024 |
R-4.4-win | OK | Nov 20 2024 |
R-4.4-mac | OK | Nov 20 2024 |
R-4.3-win | OK | Nov 20 2024 |
R-4.3-mac | OK | Nov 20 2024 |
Exports:%++%%in.closed%%in.open%%ni%aalenExponential.lvmaddattraddhookaddvaraddvar<-adjMatancestorsas.simbackdoorbaptizebeta.lvmbinary.lvmBinary.lvmbinomial.lvmbinomial.rdbinomial.rrblockdiagbootstrapBycancelcancel<-categoricalcategorical<-childrenchisq.lvmclickclosed.testingCoefMatCoefMat.multigroupfitColcolorbarcolselCombinecommutationcomparecomplikconfbandconfpredconstant.lvmconstrainconstrain<-constraintscontrcorrelationcovariancecovariance<-covfixcovfix<-coxExponential.lvmcoxGompertz.lvmcoxWeibull.lvmcsplitcurlydecomp.specialsdensity.simdescendantsdescribecoefdevcoordsdiagtestDiffdistributiondistribution<-dmvn0dsepedgelabelsedgelabels<-edgeListendogenousequivalenceestimateestimate.defaulteventTimeeventTime<-exogenousexogenous<-Expandexpitfinalizefixsomefoldrforestplotfplotfunctionalfunctional<-Gamma.lvmgaussian_logLik.lvmgaussian.lvmgethookgetMplusgetoutcomegetSASgkgammaGM2.lvmGM3.lvmgofGraphGraph<-graph2lvmGrepheavytailheavytail<-ICid.lvmIdenticalidplotigraph.lvmiidimagesindexindex<-informationinterceptintercept<-interventionintervention<-intfixintfix<-InverseIVkillkill<-ksmooth2labels<-latentlatent<-lavalava.optionsloggamma.lvmlogitlogit.lvmlognormal.lvmlvmmakemissingmanifestmeasurementmeasurement.errorMissingMissing<-mixtureModelModel<-modelParmodelsearchmodelVarmomentsmultigroupmultinomialmultinomial.lvmmvn.lvmmvnmixna.pass0NA2xnodecolor<-none.lvmnonlinearnonlinear<-normal.lvmNRoddsoffdiagoffdiag<-offdiagsones.lvmORordinalordinal<-ordregp.correctpairwise.diffparameterparameter<-parentspareto.lvmparfixparfix<-parlabelsparposparsparsedesignpartialcorpathpcorPDpdfconvertplot_regionplot.simplotConfpoisson.lvmpredictlvmPrintprobit.lvmprocformularandomsloperandomslope<-Range.lvmRatioregfixregfix<-regressionregression<-reindexrevdiagrevdiag<-riskcomprmvarrmvar<-rmvn0rootsrot2Drot3Drotate2rsqscheffescoreSequence.lvmsimsinksspaghettiSpecialsstarter.multigroupstartvaluesstartvalues0startvalues1startvalues2student.lvmsummary.simsurfacethreshold.lvmtigoltimedeptimedep<-toformulatotaleffectstrtransform<-trimtwostagetwostageCVuniform.lvmupdatelvmvar_icvariancevariance<-variancesvarsvecwaitweibull.lvmWeightswkmwrapvecx2NAzibreg
Dependencies:clicodetoolsdigestfuturefuture.applyglobalslatticelistenvMatrixnumDerivparallellyprogressrSQUAREMsurvival
Estimating partial correlations with lava
Rendered fromcorrelation.Rmd
usingknitr::rmarkdown
on Nov 20 2024.Last update: 2023-12-20
Started: 2020-05-23
Non-linear latent variable models and error-in-variable models
Rendered fromnonlinear.Rmd
usingknitr::rmarkdown
on Nov 20 2024.Last update: 2023-11-20
Started: 2020-05-23
The Art of Influence
Rendered frominfluencefunction.Rmd
usingknitr::rmarkdown
on Nov 20 2024.Last update: 2023-12-20
Started: 2023-11-15
Readme and manuals
Help Manual
Help page | Topics |
---|---|
Estimation and simulation of latent variable models | lava-package lava |
Concatenation operator | %++% |
Matching operator (x not in y) oposed to the '%in%'-operator (x in y) | %in.closed% %in.open% %ni% |
Add variable to (model) object | addvar addvar<- |
Backdoor criterion | backdoor |
Label elements of object | baptize |
Define constant risk difference or relative risk association for binary exposure | binomial.rd binomial.rr |
Combine matrices to block diagonal structure | blockdiag |
Longitudinal Bone Mineral Density Data (Wide format) | bmd |
Data | bmidata |
Generic bootstrap method | bootstrap |
Calculate bootstrap estimates of a lvm object | bootstrap.lvm bootstrap.lvmfit |
Simulated data | brisa |
Apply a Function to a Data Frame Split by Factors | By |
Longitudinal Bone Mineral Density Data | calcium |
Generic cancel method | cancel cancel<- |
Extract children or parent elements of object | adjMat ancestors children descendants edgeList parents roots sinks |
Identify points on plot | click click.default colsel idplot |
Closed testing procedure | closed.testing p.correct |
Generate a transparent RGB color | Col |
Add color-bar to plot | colorbar |
Report estimates across different models | Combine |
Finds the unique commutation matrix | commutation |
Statistical tests | compare |
Composite Likelihood for probit latent variable models | complik |
Add Confidence limits bar to plot | confband forestplot plot_region |
Calculate confidence limits for parameters | confint.lvmfit confint.multigroupfit |
Conformal prediction | confpred |
Add non-linear constraints to latent variable model | constrain constrain.default constrain<- constrain<-.default constrain<-.multigroup constraints parameter<- |
Create contrast matrix | contr pairwise.diff parsedesign |
Generic method for extracting correlation coefficients of model object | correlation |
Add covariance structure to Latent Variable Model | covariance covariance.lvm covariance<- covariance<-.lvm covfix covfix.lvm covfix<- covfix<-.lvm variance variance.lvm variance<- variance<-.lvm |
Split data into folds | csplit foldr |
Adds curly brackets to plot | curly |
Returns device-coordinates and plot-region | devcoords |
Calculate diagnostic tests for 2x2 table | diagtest Diff odds OR Ratio riskcomp |
Check d-separation criterion | dsep dsep.lvm |
Identify candidates of equivalent models | equivalence |
Estimate parameters and influence function. | estimate.array estimate.data.frame |
Estimation of functional of parameters | estimate estimate.default estimate.estimate estimate.mlm merge.estimate |
Estimation of parameters in a Latent Variable Model (lvm) | estimate.lvm |
Add an observed event time outcome to a latent variable model. | eventTime eventTime<- |
Create a Data Frame from All Combinations of Factors | Expand |
fplot | fplot |
Read Mplus output | getMplus |
Read SAS output | getSAS |
Extract model summaries and GOF statistics for model object | gof gof.lvmfit information information.lvmfit logLik.lvmfit moments moments.lvm score score.lvmfit |
Extract graph | Graph Graph<- |
Finds elements in vector or column-names in data.frame/matrix | Grep |
Hubble data | hubble |
Hubble data | hubble2 |
Extract i.i.d. decomposition (influence function) from model object | IC IC.default var_ic |
Extract i.i.d. decomposition from model object | iid |
Organize several image calls (for visualizing categorical data) | images |
Data | indoorenv |
Fix mean parameters in 'lvm'-object | intercept intercept.lvm intercept<- intercept<-.lvm intfix intfix.lvm intfix<- intfix<-.lvm |
Define intervention | intervention intervention.lvm intervention<- intervention<-.lvm |
Plot/estimate surface | ksmooth2 surface |
Define labels of graph | edgelabels edgelabels<- edgelabels<-.lvm labels labels.graphNEL labels.lvm labels.lvmfit labels<- labels<-.default nodecolor nodecolor<- nodecolor<-.default |
Set global options for 'lava' | lava.options |
Initialize new latent variable model | lvm print.lvm summary.lvm |
Create random missing data | makemissing |
Two-stage (non-linear) measurement error | measurement.error |
Missing value generator | Missing Missing, Missing<- |
Missing data example | missingdata |
Estimate mixture latent variable model. | mixture |
Extract model | Model Model<- |
Model searching | modelsearch |
Estimate probabilities in contingency table | gkgamma kappa.multinomial kappa.table multinomial |
Estimate mixture latent variable model | mvnmix |
Convert to/from NA | NA2x x2NA |
Example data (nonlinear model) | nldata |
Newton-Raphson method | NR |
Example SEM data (nonlinear) | nsem |
Define variables as ordinal | ordinal ordinal<- |
Univariate cumulative link regression models | ordreg |
Generic method for finding indeces of model parameters | parpos |
Calculate partial correlations | partialcor |
Extract pathways in model graph | effects effects.lvmfit path path.lvm totaleffects |
Polychoric correlation | pcor |
Dose response calculation for binomial regression models | PD |
Convert pdf to raster format | pdfconvert |
Plot method for 'estimate' objects | plot.estimate |
Plot path diagram | plot.lvm plot.lvmfit |
Plot method for simulation 'sim' objects | density.sim plot.sim |
Plot regression lines | plotConf |
Prediction in structural equation models | predict.lvm predict.lvmfit |
Predict function for latent variable models | predictlvm |
Generic print method | |
Define range constraints of parameters | Range.lvm |
Appending 'Surv' objects | rbind.Surv |
Add regression association to latent variable model | regfix regfix.lvm regfix<- regfix<-.lvm regression regression.lvm regression<- regression<-.lvm |
Create/extract 'reverse'-diagonal matrix or off-diagonal elements | offdiag offdiag<- revdiag revdiag<- |
Remove variables from (model) object. | kill kill<- rmvar rmvar<- |
Performs a rotation in the plane | rot2D rot3D rotate2 |
Calculate simultaneous confidence limits by Scheffe's method | scheffe |
Example SEM data | semdata |
Serotonin data | serotonin |
Data | serotonin2 |
Simulate model | aalenExponential.lvm beta.lvm Binary.lvm binary.lvm binomial.lvm categorical categorical<- chisq.lvm constant.lvm coxExponential.lvm coxGompertz.lvm coxWeibull.lvm distribution distribution.lvm distribution<- distribution<-.lvm functional functional.lvm functional<- functional<-.lvm Gamma.lvm gamma.lvm gaussian.lvm GM2.lvm GM3.lvm heavytail heavytail<- id.lvm loggamma.lvm logit.lvm lognormal.lvm multinomial.lvm mvn.lvm none.lvm normal.lvm ones.lvm pareto.lvm poisson.lvm probit.lvm Sequence.lvm sim sim.lvm sim.lvmfit simulate.lvm simulate.lvmfit student.lvm threshold.lvm transform.lvm transform<- transform<-.lvm uniform.lvm weibull.lvm |
Monte Carlo simulation | as.sim sim.default |
Spaghetti plot | spaghetti |
Stack estimating equations | stack.estimate |
For internal use | addattr addhook checkmultigroup CoefMat CoefMat.multigroupfit decomp.specials deriv describecoef dmvn0 estimate.MAR expit finalize fixsome gaussian_logLik.lvm gethook getoutcome graph2lvm Identical igraph.lvm index index.lvm index.lvmfit index<- Inverse IV lisrel logit matrices merge missingModel modelPar modelVar multigroup na.pass0 offdiags parameter parfix parfix<- parlabels pars pars.glm pars.lvm pars.lvmfit procdata.lvmfit procformula profci randomslope randomslope<- reindex reorderdata rmvn0 rsq score.glm Specials starter.multigroup startvalues startvalues0 startvalues1 startvalues2 startvalues3 stdcoef subgraph tigol updatelvm variances Weights |
Extract subset of latent variable model | measurement subset.lvm |
Summary method for 'sim' objects | summary.sim |
Time-dependent parameters | timedep timedep<- |
Converts strings to formula | toformula |
Trace operator | tr |
Trim string of (leading/trailing/all) white spaces | trim |
Twin menarche data | twindata |
Two-stage estimator | twostage |
Two-stage estimator (non-linear SEM) | nonlinear nonlinear<- twostage.estimate twostage.lvm twostage.lvm.mixture twostage.lvmfit |
Cross-validated two-stage estimator | twostageCV |
Extract variable names from latent variable model | endogenous endogenous.lvm endogenous.lvmfit endogenous.multigroup exogenous exogenous.lvm exogenous.lvmfit exogenous.multigroup exogenous<- exogenous<-.lvm latent latent.lvm latent.lvmfit latent.multigroup latent<- latent<-.lvm manifest manifest.lvm manifest.lvmfit manifest.multigroup vars vars.lvm vars.lvmfit |
vec operator | vec |
Wait for user input (keyboard or mouse) | wait waitclick |
Weighted K-means | wkm |
Wrap vector | wrapvec |
Regression model for binomial data with unkown group of immortals | zibreg |