The function rmmmonetPlot creates a density plot of the posterior distribution of your model parameters and the traceplot that led to this density.
monetPlot(rmm, parameter, lab = F, r = 3, sav = F)
A rmm object. rmm 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 rmm reg.table output.
String to describe the parameter on the graph's x-axis. Optional. If not specified, the internal parameter name is used.
Specify number of decimal places. Default equals 3.
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 <- rmm(Surv(govdur, earlyterm) ~ 1 + mm(id(pid, gid), mmc(fdep), mmw(w ~ 1/offset(n), constraint=1)) + majority + hm(id=cid, name=cname, type=RE, showFE=F),
family="Weibull", monitor=T, data=coalgov)
#> module glm loaded
#> Compiling model graph
#> Resolving undeclared variables
#> Allocating nodes
#> Graph information:
#> Observed stochastic nodes: 581
#> Unobserved stochastic nodes: 843
#> Total graph size: 14184
#>
#> Initializing model
#>
#> Error in jags.samples(model, variable.names, n.iter, thin, type = "trace", ...): thin must be a positive integer
monetPlot(m1, parameter="b.l1")
#>
#> Attaching package: 'cowplot'
#> The following object is masked from 'package:lubridate':
#>
#> stamp
#> Registered S3 method overwritten by 'GGally':
#> method from
#> +.gg ggplot2
#> Error in eval(expr, envir, enclos): object 'm1' not found