Skip to content

Commit

Permalink
prior for blavaan spec
Browse files Browse the repository at this point in the history
  • Loading branch information
ihrke committed May 24, 2024
1 parent 5fd095f commit e4d2060
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/printing.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ print.rmedsem.blavaan <- function(res, digits=3, indent=3){
indcstr <- strrep(" ", indent.conclusion)
formatstr <- "%5.3f" # format for real numbers

cat(sprintf("Prior (regression coefs): %s\n", blavInspect(mod, "dp")["beta"]))
cat(sprintf("Prior (regression coefs): %s\n", res$prior$beta))

# indentation
indstr <- strrep(" ", indent)
Expand Down
4 changes: 3 additions & 1 deletion R/rmedsem_blavaan.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,14 @@ rmedsem.blavaan <- function(mod, indep, med, dep,
ERpos <- bayes_proppos/(1-bayes_proppos)
ERneg <- bayes_propneg/(1-bayes_propneg)

prior_beta <- blavInspect(mod, "dp")["beta"]
res <- list(package="blavaan", standardized=T,
vars =list(med=med, indep=indep, dep=dep),
bayes=c(coef=bayes_coef, se=bayes_se, zval=bayes_z,
pvpos=bayes_proppos, pvneg=bayes_propneg,
ERpos=ERpos, ERneg=ERneg,
lower=bayes_lci, upper=bayes_uci)
lower=bayes_lci, upper=bayes_uci),
prior=list(beta=prior_beta)
#med.approach=approach,
#effect.size=es,
#med.data=list(sig_thresh=p.threshold,
Expand Down

0 comments on commit e4d2060

Please sign in to comment.