Comments (4)
The development version of blavaan allows you to use Stan, via the argument target="stan"
. See:
http://faculty.missouri.edu/~merklee/blavaan/source.html
There are a couple bugs that still exist here (and that will be fixed), but it usually works.
Ed
from blavaan.
That's super cool!
Unfortunately it didn't work :(
I've tried the following:
library(blavaan)
model <- '
# latent variable definitions
ind60 =~ x1 + x2 + x3
dem60 =~ y1 + a*y2 + b*y3 + c*y4
dem65 =~ y5 + a*y6 + b*y7 + c*y8
# regressions
dem60 ~ ind60
dem65 ~ ind60 + dem60
# residual correlations
y1 ~~ y5
y2 ~~ y4 + y6
y3 ~~ y7
y4 ~~ y8
y6 ~~ y8
'
fit <- bsem(model, data=PoliticalDemocracy, target="stan")
After several thousand (debug?) lines, it printed me the following error:
Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! Warning message:
l'exécution de la commande 'make -f "C:/PROGRA~1/R/R-34~1.2/etc/x64/Makeconf" -f "C:/PROGRA~1/R/R-34~1.2/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="file2aac41e606a.dll" WIN=64 TCLBIN=64 OBJECTS="file2aac41e606a.o"' renvoie un statut 127
In addition: Warning messages:
1: running command '"C:/PROGRA~1/R/R-34~1.2/bin//R" CMD config CXX' had status 1
2: running command 'C:/PROGRA~1/R/R-34~1.2/bin/x64/R CMD SHLIB file2aac41e606a.cpp 2> file2aac41e606a.cpp.err.txt' had status 1
Error in blavaan(model, data = PoliticalDemocracy, target = "stan", model.type = "bsem", :
blavaan ERROR: problem with MCMC estimation. The model syntax and data have been exported.
😢
from blavaan.
This error looks like it is coming from rstan. So I wonder whether you are able to run any simple example models in rstan? For what it's worth, the model works for me with the following package versions:
other attached packages:
[1] rstan_2.16.2 StanHeaders_2.16.0-1 ggplot2_2.2.1
[4] blavaan_0.2-5.225 lavaan_0.6-1.1175 runjags_2.0.4-2
loaded via a namespace (and not attached):
[1] Rcpp_0.12.13 MASS_7.3-47 munsell_0.4.2 mnormt_1.5-5
[5] colorspace_1.2-6 pbivnorm_0.6.0 lattice_0.20-35 quadprog_1.5-5
[9] plyr_1.8.3 MCMCpack_1.4-0 mcmc_0.9-5 tools_3.4.1
[13] parallel_3.4.1 grid_3.4.1 gtable_0.2.0 quantreg_5.33
[17] loo_1.1.0 coda_0.19-1 MatrixModels_0.4-1 matrixStats_0.52.2
[21] assertthat_0.1 lazyeval_0.2.0 tibble_1.2 Matrix_1.2-11
[25] gridExtra_2.2.1 codetools_0.2-15 inline_0.3.14 sandwich_2.4-0
[29] compiler_3.4.1 nonnest2_0.5 scales_0.4.1 stats4_3.4.1
[33] CompQuadForm_1.4.3 SparseM_1.77 mvtnorm_1.0-6 zoo_1.8-0
from blavaan.
Happy to revisit with further info...
from blavaan.
Related Issues (20)
- avoid nested lists
- blavFitIndices & multiple groups HOT 1
- blavaan failed to compile (Mac M1) HOT 4
- Bug with multiple groups HOT 1
- `blavCompare` errors HOT 2
- Problem with translation from lavaan to MCMC syntax HOT 9
- blavaan ERROR: problem with translation from lavaan to MCMC syntax HOT 11
- Error in lav2standata(lavobject) : object 'ptot' not found HOT 5
- Problem with multilevel model HOT 1
- error in help-page examples for wrappers HOT 2
- *blavaan* broken after latest update of *lavaan* HOT 6
- blavaan upgrade to 0.5-5 fails in R 4.4.0 under windows 11 Pro HOT 6
- BF is `NA` HOT 2
- For ordinal observed variables, can I fix thresholds and estimate mean? (Allow zero frequencies in some ordinal outcomes) HOT 6
- Specification of factor model with auto.var = TRUE, std.lv = TRUE with ordinal indicators HOT 5
- allow.empty.cell = TRUE maybe incomplete HOT 9
- build package on Ubuntu HOT 4
- ordered categorical variable with missing data HOT 10
- upper bound on observed variance? HOT 2
- not happy about missing values HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blavaan.