Learn R Programming

⚠️There's a newer version (1.8.1) of this package.Take me there.

lava (version 1.6)

Latent Variable Models

Description

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) ). 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.

Copy Link

Version

Install

install.packages('lava')

Monthly Downloads

137,111

Version

1.6

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Klaus Holst

Last Published

January 13th, 2018

Functions in lava (1.6)

Combine

Report estimates across different models
Expand

Create a Data Frame from All Combinations of Factors
Graph

Extract graph
Grep

Finds elements in vector or column-names in data.frame/matrix
Col

Generate a transparent RGB color
NA2x

Convert to/from NA
Org

Convert object to ascii suitable for org-mode
Missing

Missing value generator
Model

Extract model
bootstrap

Generic bootstrap method
bootstrap.lvm

Calculate bootstrap estimates of a lvm object
cancel

Generic cancel method
By

Apply a Function to a Data Frame Split by Factors
children

Extract children or parent elements of object
covariance

Add covariance structure to Latent Variable Model
csplit

Split data into folds
baptize

Label elements of object
blockdiag

Combine matrices to block diagonal structure
brisa

Simulated data
colorbar

Add color-bar to plot
commutation

Finds the unique commutation matrix
confpred

Conformal prediction
constrain<-

Add non-linear constraints to latent variable model
addvar

Add variable to (model) object
backdoor

Backdoor criterion
compare

Statistical tests
complik

Composite Likelihood for probit latent variable models
estimate.default

Estimation of functional of parameters
estimate.lvm

Estimation of parameters in a Latent Variable Model (lvm)
missingdata

Missing data example
PD

Dose response calculation for binomial regression models
Range.lvm

Define range constraints of parameters
click

Identify points on plot
closed.testing

Closed testing procedure
calcium

Longitudinal Bone Mineral Density Data
contr

Create contrast matrix
correlation

Generic method for extracting correlation coefficients of model object
hubble2

Hubble data
devcoords

Returns device-coordinates and plot-region
diagtest

Calculate diagnostic tests for 2x2 table
images

Organize several image calls (for visualizing categorical data)
mixture

Estimate mixture latent variable model.
partialcor

Calculate partial correlations
path

Extract pathways in model graph
getMplus

Read Mplus output
getSAS

Read SAS output
km

Weighted K-means
plot.estimate

Plot method for 'estimate' objects
plot.lvm

Plot path diagram
iid

Extract i.i.d. decomposition (influence function) from model object
makemissing

Create random missing data
measurement.error

Two-stage (non-linear) measurement error
bmd

Longitudinal Bone Mineral Density Data (Wide format)
bmidata

Data
curly

Adds curly brackets to plot
cv

Cross-validation
dsep.lvm

Check d-separation criterion
ksmooth2

Plot/estimate surface
labels<-

Define labels of graph
lava-package

Estimation and simulation of latent variable models
confband

Add Confidence limits bar to plot
confint.lvmfit

Calculate confidence limits for parameters
eventTime

Add an observed event time outcome to a latent variable model.
wrapvec

Wrap vector
zibreg

Regression model for binomial data with unkown group of immortals
%ni%

Matching operator (x not in y) oposed to the %in%-operator (x in y)
ordinal<-

Define variables as ordinal
plot.sim

Plot method for simulation 'sim' objects
fplot

fplot
gof

Extract model summaries and GOF statistics for model object
hubble

Hubble data
nsem

Example SEM data (nonlinear)
%++%

Concatenation operator
modelsearch

Model searching
multinomial

Estimate probabilities in contingency table
ordreg

Univariate cumulative link regression models
equivalence

Identify candidates of equivalent models
intercept

Fix mean parameters in 'lvm'-object
startvalues

For internal use
lava.options

Set global options for lava
lvm

Initialize new latent variable model
regression<-

Add regression association to latent variable model
indoorenv

Data
mvnmix

Estimate mixture latent variable model
nldata

Example data (nonlinear model)
parpos

Generic method for finding indeces of model parameters
predict.lvm

Prediction in structural equation models
predictlvm

Predict function for latent variable models
revdiag

Create/extract 'reverse'-diagonal matrix or off-diagonal elements
plotConf

Plot regression lines
scheffe

Calculate simultaneous confidence limits by Scheffe's method
twostage.lvmfit

Two-stage estimator (non-linear SEM)
vars

Extract variable names from latent variable model
pcor

Polychoric correlation
pdfconvert

Convert pdf to raster format
semdata

Example SEM data
sim

Simulate model
sim.default

Wrapper function for mclapply
subset.lvm

Extract subset of latent variable model
rmvar

Remove variables from (model) object.
rotate2

Performs a rotation in the plane
serotonin

Serotonin data
serotonin2

Data
timedep

Time-dependent parameters
toformula

Converts strings to formula
spaghetti

Spaghetti plot
stack.estimate

Stack estimating equations
tr

Trace operator
trim

Trim tring of (leading/trailing/all) white spaces
twindata

Twin menarche data
twostage

Two-stage estimator
vec

vec operator
wait

Wait for user input (keyboard or mouse)
summary.sim

Summary method for 'sim' objects