The function monetPlot creates a density plot of the posterior distribution of your model parameters and the traceplot that led to this density.
monetPlot(bml, parameter, label = NULL, r = 2, yaxis = T)A bml object. bml has to be run with monitor=T
A string with the parameter name. The internal name has to be used, which are the rownames in the bml reg.table output.
Specify number of decimal places. Default equals 3.
A string specifying one of the following options: "median", "mean", "MAP", or "mode".
String to describe the parameter on the graph's x-axis. Optional. If not specified, the internal parameter name is used.
TRUE or FALSE (default). If TRUE, the graph is saved to the current working directory as .png
Returns a plot. The solid vertical is at 0 and the dashed vertical line is the mode of the posterior distributions.
data(coalgov)
m1 <- bml(Surv(govdur, earlyterm) ~ 1 + mm(id(pid, gid), mmc(fdep), mmw(w ~ 1/n, constraint=1)) + majority + hm(id=cid, name=cname, type=RE, showFE=F),
          family="Weibull", monitor=T, data=coalgov)
#> Error in if (mmwconstraint == F) {    mmwfunction <- stringr::str_replace(mmwfunction, "w ~", "w[i] <-")    modelstring <- stringr::str_replace(modelstring, fixed("uw[i] <- 1/X.w[i,1]"),         mmwfunction)    modelstring <- stringr::str_remove(modelstring, fixed("w[i] <- uw[i] / sum(uw[l1i1.l1[i]:l1i2.l1[i]])\n"))} else {    mmwfunction <- stringr::str_replace(mmwfunction, "w ~", "uw[i] <-")    modelstring <- stringr::str_replace(modelstring, fixed("uw[i] <- 1/X.w[i,1]"),         mmwfunction)}: missing value where TRUE/FALSE needed
monetPlot(m1, parameter="b.l1")
#> Error: object 'm1' not found