Re: [R] Plot multiple columns

From: Ben Bolker <bolker_at_ufl.edu>
Date: Tue, 01 Jun 2010 12:54:55 +0000 (UTC)

Noah Silverman <noah <at> smartmediacorp.com> writes:

>
> I'm running a long MCMC chain that is generating samples for 22 variables.
>
> I have each run of the chain as a row in a matrix.

> So: Chain[,1] is the column with all the samples for variable one.
> Chain[,2] is the column with all the samples for variable 2, etc.

  The previous 2 paragraphs seemed contradictory until I realized that in the first paragraph you are using "run" to mean what I would usually call a "sample" ...

> I'd like to fit all 22 on a single page to print a nice summary. It is
> OK if the graphs are small, I just need to show the overall shape and
> convergence.

  How about for example

> x <- matrix(runif(22000),ncol=22)
> library(coda)
> m <- as.mcmc(x)
> xyplot(m)
> xyplot(m,layout=c(4,6))



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Tue 01 Jun 2010 - 13:04:50 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 01 Jun 2010 - 16:50:26 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive