R interface to Blimp for Bayesian latent variable modeling, missing data analysis, and multiple imputation.
rblimp provides a seamless interface to integrate Blimp software into
R workflows. Blimp offers general-purpose Bayesian estimation for a wide
range of single-level and multilevel structural equation models with two
or three levels, with or without missing data.
mitml
format for pooling analysesBefore installing rblimp, you must download and install
Blimp (freely available):
Install from CRAN:
install.packages("rblimp")Or install the development version from GitHub:
# install.packages("remotes")
remotes::install_github("blimp-stats/rblimp")After installation, configure the path to Blimp:
library(rblimp)
# Automatic detection
detect_blimp()
# Or set manually
set_blimp("/path/to/blimp")
# Verify
has_blimp()View the getting started guide:
?rblimp_getting_startedExplore function documentation:
?rblimp # Fit Bayesian models
?rblimp_fcs # Multiple imputation
?rblimp_sim # Data simulation
help(package = "rblimp")library(rblimp)
# Generate data with latent factor
mydata <- rblimp_sim(
c(
'f ~ normal(0, 1)',
'x1:x5 ~ normal(f, 1)',
'y ~ normal(10 + 0.3*f, 1 - .3^2)'
),
n = 500,
seed = 19723,
variables = c('y', 'x1:x5')
)
# Fit SEM model
model <- rblimp(
list(
structure = 'y ~ f',
measurement = 'f -> x1:x5'
),
mydata,
seed = 3927,
latent = ~ f
)
# View results
summary(model)
# Check convergence
trace_plot(model)If you use rblimp in your research, please cite both the
package and Blimp software. Use citation("rblimp") for
citation information.
GPL-3