3D_R_gallery

3D_R_gallery - R graph gallery Compilation by Eric Lecoutre...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
R graph gallery Compilation by Eric Lecoutre December 12, 2003 Contents 3D Bivariate Normal Density . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 3D Scatterplot - Cloud, regression plan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 3D Wireframe - For surfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Agreement plot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Conditional Plot 1 - coplot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Fourfold Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Hexagon Binning Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Mosaicplot - Associations in a contingency table . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Parallel Plot - Comparing groups with few subjects . . . . . . . . . . . . . . . . . . . . . . . . . 15 Ternary Plot - Biplot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Tukey’s Hanging Rootogram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Violin Plot - Boxplot showing density, aka vase boxplot . . . . . . . . . . . . . . . . . . . . . . 19 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
3D Bivariate Normal Density variables : 2 QT library : - function : persp submitted by : Bernhard PfaF <Bernhard.Pfaff@drkw.com> Sample graph x1 -10 -5 0 5 10 x2 -10 -5 0 5 10 z 0.000 0.005 0.010 0.015 Two dimensional Normal Distribution f ( x 29 = 1 2 π σ 11 σ 22 ( 1 - ρ 2 29 . exp - 1 2 ( 1 - ρ 2 29 , ( x 1 - μ 1 29 2 σ 11 - 2 ρ x 1 - μ 1 σ 11 x 2 - μ 2 σ 22 + ( x 2 - μ 2 29 2 σ 22 Sample code # 3-D plots # # mu1<-0 # setting the expected value of x1 mu2<-0 # setting the expected value of x2 s11<-10 # setting the variance of x1 s12<-15 # setting the covariance between x1 and x2 s22<-10 # setting the variance of x2 rho<-0.5 # setting the correlation coefficient between x1 and x2 x1<-seq(-10,10,length=41) # generating the vector series x1 x2<-x1 # copying x1 to x2 # f<-function(x1,x2) { term1<-1/(2*pi*sqrt(s11*s22*(1-rho^2))) term2<--1/(2*(1-rho^2)) term3<-(x1-mu1)^2/s11 term4<-(x2-mu2)^2/s22 term5<--2*rho*((x1-mu1)*(x2-mu2))/(sqrt(s11)*sqrt(s22)) 2
Background image of page 2
term1*exp(term2*(term3+term4-term5)) } # setting up the function of the multivariate normal density # z<-outer(x1,x2,f) # calculating the density values # persp(x1, x2, z, main="Two dimensional Normal Distribution", sub=expression(italic(f)~(bold(x))==frac(1,2~pi~sqrt(sigma[11]~ sigma[22]~(1-rho^2)))~phantom(0)^bold(.)~exp~bgroup("{", list(-frac(1,2(1-rho^2)), bgroup("[", frac((x[1]~-~mu[1])^2, sigma[11])~-~2~rho~frac(x[1]~-~mu[1], sqrt(sigma[11]))~ frac(x[2]~-~mu[2],sqrt(sigma[22]))~+~ frac((x[2]~-~mu[2])^2, sigma[22]),"]")),"}")), col="lightgreen", theta=30, phi=20, r=50, d=0.1, expand=0.5, ltheta=90, lphi=180, shade=0.75, ticktype="detailed",
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 19

3D_R_gallery - R graph gallery Compilation by Eric Lecoutre...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online