plot.BMSC | R Documentation |
BMSC
object.Plot estimates from a BMSC
object.
## S3 method for class 'BMSC' plot(x, who = "both", type = "interval", CI = 0.95, ...)
x |
An object of class BMSC. |
who |
parameter to choose the estimates to plot
|
type |
a parameter to select the typology of graph
|
CI |
the dimension of the Credible Interval (or Equally Tailed Interval). Default 0.95. |
... |
other arguments are ignored. |
a plot, a ggplot2 object, or a bayesplot object
# simulation of healthy controls data Sigma.ctrl <- matrix(cbind(1, .7, .7, 1) ,nrow=2) U <- t(chol(Sigma.ctrl)) numobs <- 100 set.seed(123) random.normal <- matrix( rnorm( n = ncol(U) * numobs, mean = 3, sd = 1), nrow = ncol(U), ncol = numobs) X = U %*% random.normal dat.ctrl <- as.data.frame(t(X)) names(dat.ctrl) <- c("y","x") cor(dat.ctrl) # simulation of patient data Sigma.pt <- matrix(cbind(1, 0, 0, 1) ,nrow=2) U <- t(chol(Sigma.pt)) numobs <- 20 set.seed(0) random.normal <- matrix( rnorm( n = ncol(U) * numobs, mean = 3, sd = 1), nrow = ncol(U), ncol = numobs) X = U %*% random.normal dat.pt <- as.data.frame(t(X)) names(dat.pt) <- c("y","x") cor(dat.pt) # fit the single case model mdl.reg <- BMSC(y ~ x, data_ctrl = dat.ctrl, data_sc = dat.pt, seed = 10) # summarize the data summary(mdl.reg) # plot the results of both patient and control group plot(mdl.reg) # plot the results of the patient plot(mdl.reg, who = "single") # plot the results of the difference between the control group and the patient plot(mdl.reg, who = "delta") # density plots plot(mdl.reg, type = "area") # histograms plot(mdl.reg, type = "hist")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.