R Under development (unstable) (2025-08-19 r88650 ucrt) -- "Unsuffered Consequences" Copyright (C) 2025 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > # Example 2: bivariate beta with repeated measures > library(zoib) Loading required package: rjags Loading required package: coda Linked to JAGS 4.3.1 Loaded modules: basemod,bugs Loading required package: abind Loading required package: Formula > data("BiRepeated", package = "zoib") > d= BiRepeated[1:100,] > eg2 <- zoib(y1|y2 ~ x|1|x, data= d, n.response=2, + random=1, EUID= d$id, + zero.inflation = c(FALSE,FALSE), one.inflation = c(FALSE,FALSE), + prior.Sigma = "VC.unif", n.iter=5, n.thin=1, n.burn=1) [1] "***************************************************************************" [1] "* List of parameter for which the posterior samples are generated *" [1] "* b: regression coeff in the linear predictor for the mean of beta dist'n *" [1] "* d: regression coeff in the linear predictor for the sum of the two *" [1] "* shape parameters in the beta distribution *" [1] "* b0: regression coeff in the linear predictor for Prob(y=0) *" [1] "* b1: regression coeff in the linear predictor for Prob(y=1) *" [1] "***************************************************************************" Compiling model graph Resolving undeclared variables Allocating nodes Graph information: Observed stochastic nodes: 200 Unobserved stochastic nodes: 48 Total graph size: 6838 Initializing model NOTE: Stopping adaptation [1] "NOTE: in the header of Markov Chain Monte Carlo (MCMC) output of " [1] "parameters (coeff), predicted values (ypred), residuals (resid), and" [1] "standardized residuals (resid.std), *Start, End, Thinning Interval* " [1] "values are after the initial burning and thinning periods specified " [1] "by the user. For example, n.iter = 151, n.thin = 2, n.burn=1, " [1] "then MCMC header of the *coeff* output would read as follows " [1] "--------------------------------------------------------------------" [1] "Markov Chain Monte Carlo (MCMC) output:" [1] "Start = 1" [1] "End = 75" [1] "Thinning interval = 1" [1] "--------------------------------------------------------------------" [1] " " [1] "Coefficients are presented in the order of b, b0 (if zero.inflation=TRUE)," [1] "b1 (if one.inflation=TRUE), and d. If the names of independent variables X" [1] "are not shown for the coefficients within each type (b, b0, b1, d), the " [1] "first coeffient is always the intercept, followed the coefficients for the" [1] "X's in the order as how they are entered in the model specification. " [1] "--------------------------------------------------------------------------" > coeff<- eg2$coeff > ypred<- eg2$ypred > Xb<- eg2$Xb > Xd<- eg2$Xd > Xb0<- eg2$Xb0 > > if(0){ + eg2 <- zoib(y1 ~x|1|x, data= BiRepeated, n.response=1, + random=1, EUID= BiRepeated$id, joint=FALSE, + zero.inflation = FALSE, one.inflation = FALSE, + prior.Sigma = "UN.halfcauchy", n.iter=60, n.thin=5, n.burn=10, + inits=list(list(b0=NULL,b1=NULL,b=matrix(c(-1.3,-2.6),2,1), + d=matrix(1.75,1,1),sigma=c(0.16,0.25),R=c(1,0.12,1)), + list(b0=NULL,b1=NULL,b=matrix(c(-0.7,-1.4),2,1), + d=matrix(3.25,1,1),sigma=c(0.25,0.16),R=c(1,0.08,1))) + ) + coeff<- eg2$coeff + traceplot(coeff) + + + eg2 <- zoib(y1|y2 ~ x|1|x, data= BiRepeated, n.response=2, + random=1, EUID= BiRepeated$id, + zero.inflation = FALSE, one.inflation = FALSE, + prior.Sigma = "UN.halfcauchy", n.iter=100, n.thin=2, n.burn=1, + inits=list(list(b0=NULL,b1=NULL,b=matrix(c(-1.3,-2.6,0.5,1.0),2,2), + d=matrix(c(1.75,2),1,2),sigma=c(0.16,0.25),R=c(1,0.12,1)), + list(b0=NULL,b1=NULL,b=matrix(c(-0.7,-1.4,0.5,1.0),2,2), + d=matrix(c(3.25,2),1,2),sigma=c(0.25,0.16),R=c(1,0.08,1))) + ) + coeff<- eg2$coeff + traceplot(coeff) + } > > proc.time() user system elapsed 0.87 0.14 1.00