Re: [R] Plotting coloured histograms...
Try the H. Bengtsson's function plot.histogram from http://www.maths.lth.se/matstat/staff/hb/mypackages/R/plot.histogram.R Remigijus Saturday, January 25, 2003, 10:21:30 PM, you wrote: FHFPdR>Hi, I am having some trouble trying to plot a histogram in more than one FHFPdR> colour. What I want to do is, plot two vectors in the same histogram, but FHFPdR> with different colours, for instance: FHFPdR>> x <- rnorm(1000,20,4); FHFPdR>> y <- rnorm(1000,10,2); FHFPdR> Then I'd like to have x and y ploted on the same hist (I can do that FHFPdR> already doing w <- c(x,y) then hist(w)) but the bars representing the x's should FHFPdR> be in one colour and the bars representing the y should be in another one, FHFPdR> so that I could see the overlaping areas of the two distributions etc. FHFPdR> Is there any way to do that? I've read through the hist docummentation (>>help(hist)) and also googled for "R colour histogram" but didn't find FHFPdR> anything helpfull. FHFPdR> Thank you for your attention, FHFPdR> -- FHFPdR> __ FHFPdR> [EMAIL PROTECTED] mailing list FHFPdR> http://www.stat.math.ethz.ch/mailman/listinfo/r-help __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] AIC for regression models (was: (no subject))
Yes, you can use the `AIC' function in R: > set.seed(100) > x1 <- rnorm(100) > x2 <- rnorm(100) > y <- x1 + x2 + rnorm(100) > AIC(lm(y ~ x1 + x2)) [1] 286.7287 -roger ___ UCLA Department of Statistics [EMAIL PROTECTED] http://www.stat.ucla.edu/~rpeng On Fri, 24 Jan 2003, Simon CHAMAILLE wrote: > Dear All A> I just want to know if it is easily possible to compute AICc calculation for multiple regression models under R ? > Thanks a lot, > simon chamaillé > > __ > [EMAIL PROTECTED] mailing list > http://www.stat.math.ethz.ch/mailman/listinfo/r-help > __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] Plotting coloured histograms...
Hi, I am having some trouble trying to plot a histogram in more than one colour. What I want to do is, plot two vectors in the same histogram, but with different colours, for instance: > x <- rnorm(1000,20,4); > y <- rnorm(1000,10,2); Then I'd like to have x and y ploted on the same hist (I can do that already doing w <- c(x,y) then hist(w)) but the bars representing the x's should be in one colour and the bars representing the y should be in another one, so that I could see the overlaping areas of the two distributions etc. Is there any way to do that? I've read through the hist docummentation (>help(hist)) and also googled for "R colour histogram" but didn't find anything helpfull. Thank you for your attention, -- __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] survey package
A new package `survey' for analysing complex survey samples is on CRAN. It handles stratification, clustering, and unequal sampling probabilities in descriptive statistics, glms, and general maximum likelihood fitting. The package is still under development: - it doesn't do the finite population correction to variances - it needs some real life worked examples Most importantly, though, I don't do this sort of analysis routinely, so it's possible that some part of the interface is completely insane from the viewpoint of practising survey statisticians. Now would be an excellent time to complain. -thomas Thomas Lumley Asst. Professor, Biostatistics [EMAIL PROTECTED]University of Washington, Seattle __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] plotting primatives, ellipses, dots, radial coordinates etc.
[EMAIL PROTECTED] wrote: Is there a library in R that defines plotting primatives such as drawing an ellipse, drawing a colored dot, or drawing a line with a radius and angle? More complex figures would be cool too like defining a color-filled polygon as an object an placing it at any arbitrary position (x,y,scalex, scaled and rotated). - See the *package* ellipse - Hint: Ihaka & Gentleman (1996): "R: A Language for Data Analysis and _*Graphics*_", JCGS 5 (3), 299-314. This tells us implicitly: Look in R itself for some plotting mechanisms. See ?points, ?polygon, etc. Uwe Ligges __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] plot/screen
Luis Silva wrote: Dear helpers I have this code to make 10 plots in the same device a<-1 split.screen(c(2:5)) You mean: split.screen(c(2, 5)) for (i in 1:10){ nova.matriz<-a*sigma+(1-a)*S proj<-calculo.comp(treino,nova.matriz) print(proj[,1:2]) screen(i) plot(Re(proj[c(2,3,6,9:11,14,23),1:2]),xlim=range(c(- 15:15)),ylim=range(c(-5:5)),col="black") points(Re(proj[c(1,4:5,7:8,12:13,15:22,24:27),1:2]),col="red") points(Re(proj[28:38,1:2]),col="blue") a<-a-.1 } Is this the best way to do it? And I have this problem. It only plots 6 screens and then gives an error "Error in plot.new() : Figure margins too large" The idea is to make 10 plots being a function of parameter a. It goes from 1 to zero. I've already started at zero and gone to 1 but it happens the same thing. Any hints? What about reducing the margins (the obvious idea after reading the error message) or enlarging the space for the figures in another way (larger device region etc.)? In order to reduce the margins, e.g. use ... screen(i) par(mar=c(2,2,1,1)) ... I think you don't need such a complex thing like split.screen(). Another way is to use par(mfrow=c(5, 2)) or see ?layout for a third way. Uwe Ligges __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] plotting primatives, ellipses, dots, radial coordinates etc.
Is there a library in R that defines plotting primatives such as drawing an ellipse, drawing a colored dot, or drawing a line with a radius and angle? More complex figures would be cool too like defining a color-filled polygon as an object an placing it at any arbitrary position (x,y,scalex, scaled and rotated). Rex __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help
[R] plot/screen
Dear helpers I have this code to make 10 plots in the same device a<-1 split.screen(c(2:5)) for (i in 1:10){ nova.matriz<-a*sigma+(1-a)*S proj<-calculo.comp(treino,nova.matriz) print(proj[,1:2]) screen(i) plot(Re(proj[c(2,3,6,9:11,14,23),1:2]),xlim=range(c(- 15:15)),ylim=range(c(-5:5)),col="black") points(Re(proj[c(1,4:5,7:8,12:13,15:22,24:27),1:2]),col="red") points(Re(proj[28:38,1:2]),col="blue") a<-a-.1 } Is this the best way to do it? And I have this problem. It only plots 6 screens and then gives an error "Error in plot.new() : Figure margins too large" The idea is to make 10 plots being a function of parameter a. It goes from 1 to zero. I've already started at zero and gone to 1 but it happens the same thing. Any hints? -- Kit SAPO.ADSL.PT Apenas 50 . Adira já em http://www.sapo.pt/kitadsl __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman/listinfo/r-help