Re: [R] Plotting confidence intervals with ggplot, in multiple facets.

2021-08-02 Thread Rolf Turner
On Mon, 2 Aug 2021 17:53:34 +0100 Rui Barradas wrote: > Hello, > > I'm glad it helped. > Here are a couple of ideas for theme. Thanks Rui. The scope of your knowledge and understanding is simply amazing! cheers, Rolf -- Honorary Research Fellow Department of Statistics University of Au

Re: [R] Plotting confidence intervals with ggplot, in multiple facets.

2021-08-02 Thread Rui Barradas
Hello, I'm glad it helped. Here are a couple of ideas for theme. 1) From ?theme: Theme inheritance Theme elements inherit properties from other theme elements hierarchically. For example, axis.title.x.bottom inherits from axis.title.x which inherits from axis.title, which in turn inherits fro

Re: [R] Plotting confidence intervals with ggplot, in multiple facets.

2021-08-02 Thread Rolf Turner
I would like to tie off this thread (?!?!) by thanking Jeff Newmiller, Rui Barradas, Avi Gross and Bill Dunlap for their advice and insight. I have attached the code that I finally put together, on the basis of the aforementioned advice, in the file ciPlot.txt. I have also attached the necessary

Re: [R] Plotting confidence intervals with ggplot, in multiple facets.

2021-07-20 Thread Rolf Turner
Thanks to Bill Dunlap and Avi Gross for their clear and helpful answers to my questions. cheers, Rolf Turner -- Honorary Research Fellow Department of Statistics University of Auckland Phone: +64-9-373-7599 ext. 88276 __ R-help@r-project.org mailin

Re: [R] Plotting confidence intervals with ggplot, in multiple facets.

2021-07-19 Thread Avi Gross via R-help
Of Rolf Turner Sent: Monday, July 19, 2021 7:24 PM To: r-help@r-project.org Subject: Re: [R] Plotting confidence intervals with ggplot, in multiple facets. Thanks to Jeff Newmiller, Rui Barradas and Avi Gross for their extremely helpful replies. I have got both Jeff's and Rui&#

Re: [R] Plotting confidence intervals with ggplot, in multiple facets.

2021-07-19 Thread Bill Dunlap
ggplot2::labs() interprets expressions as plotmath. E.g., data.frame(X=1:10,Y=(1:10)^2) %>% ggplot(aes(X,Y)) + geom_point() + labs(x = expression(beta), y = expression(beta^2)) -Bill On Mon, Jul 19, 2021 at 4:24 PM Rolf Turner wrote: > > > Thanks to Jeff Newmiller, Rui Barradas and

Re: [R] Plotting confidence intervals with ggplot, in multiple facets.

2021-07-19 Thread Rolf Turner
Thanks to Jeff Newmiller, Rui Barradas and Avi Gross for their extremely helpful replies. I have got both Jeff's and Rui's code to run. I am currently experimenting with Avi's suggestion of producing multiple plots and then putting them together using plotgrid() or grid.arrange(). This idea s

Re: [R] Plotting confidence intervals with ggplot, in multiple facets.

2021-07-18 Thread Avi Gross via R-help
error bars being displayed with parts below zero so showing where zero is graphically can be useful. -Original Message- From: R-help On Behalf Of Rolf Turner Sent: Sunday, July 18, 2021 2:17 AM To: r-help@r-project.org Subject: [R] Plotting confidence intervals with ggplot, in multiple f

Re: [R] Plotting confidence intervals with ggplot, in multiple facets.

2021-07-18 Thread Rui Barradas
Hello, Something like this? library(ggplot2) eg <- dget("data/egData.txt") ggplot(eg, aes(Ndat, estimate)) + � geom_errorbar(aes(ymin = lower, ymax = upper), width = 20) + � geom_point(colour = "slateblue", size = 1) + � geom_hline(yintercept = 0, colour = "red") + � facet_grid(param ~ .) +

Re: [R] Plotting confidence intervals with ggplot, in multiple facets.

2021-07-17 Thread Jeff Newmiller
ggplot(dta,aes(x=Ndat,y=estimate, ymin=lower,ymax=upper))+ geom_point() + geom_errorbar(width=30) + facet_grid(param~1) + theme_minimal() Width parameter seems odd... play with it I suppose. For facets, you can also use facet_wrap(~param, ncol=1). ggplot is very much about the data and t

[R] Plotting confidence intervals with ggplot, in multiple facets.

2021-07-17 Thread Rolf Turner
I have need of creating a plot displaying confidence intervals (for the mean bias in parameter estimates) with one panel or facet for each of the two parameters in question. I can do this in base R graphics, but the result is not as aesthetically pleasing as I would like. I have attached an exa

Re: [R] Plotting confidence intervals

2019-12-08 Thread phil
Thanks so much Jim. Yes, this is giving me what I want. Philip On 2019-12-08 05:00, Jim Lemon wrote: Hi Philip, This may be a starter: attach(airquality) heights <- tapply(Temp,Month,mean) temp_sd<-tapply(Temp,Month,sd) lower <- tapply(Temp,Month,function(v) t.test(v)$conf.int[1]) upper <- tap

Re: [R] Plotting confidence intervals

2019-12-08 Thread Jim Lemon
Hi Philip, This may be a starter: attach(airquality) heights <- tapply(Temp,Month,mean) temp_sd<-tapply(Temp,Month,sd) lower <- tapply(Temp,Month,function(v) t.test(v)$conf.int[1]) upper <- tapply(Temp,Month,function(v) t.test(v)$conf.int[2]) library(plotrix) barp(heights,ylim=c(0,100),names.arg=m

Re: [R] Plotting confidence intervals

2019-12-08 Thread phil
Thanks for these helpful suggestions. These options don't work in my case because I don't know the individual observations (the dots). A statistical agency collects the observations and keeps them confidential. It provides the mean value and the standard deviation, plus the fact that the obser

Re: [R] Plotting confidence intervals

2019-12-07 Thread Ben Tupper
Hi, Would something like yarrr do the trick? https://ndphillips.github.io/yarrr.html Or gghalves? https://github.com/erocoar/gghalves Cheers, Ben On Sat, Dec 7, 2019 at 9:32 PM wrote: > I want to show little bell curves on my bar chart to illustrate the > confidence ranges. The following ex

[R] Plotting confidence intervals

2019-12-07 Thread phil
I want to show little bell curves on my bar chart to illustrate the confidence ranges. The following example from Paul Teetor's "R Cookbook" does what I want, but shows I-beams instead of bell curves. The I-beams suggest uniform, rather than normal distributions. So I am looking for a way to pl

Re: [R] Plotting Confidence Intervals into a density plot

2016-12-02 Thread Elysa Mitova
Hi, sadly it does not work either, because my index (x axis) is an atomic vector. Error Message: $ operator is invalid for atomic vectors I think I have to stick to displaying the confidence intervals with straight lines (ablines) , instead of a shaded area (polygon) Thank you so much for your he

Re: [R] Plotting Confidence Intervals into a density plot

2016-12-02 Thread Jim Lemon
Hang on, maybe you mean something like this: erupt_dens<-density(faithful$eruptions) plot(erupt_dens,ylim=c(0,0.65)) dispersion(erupt_dens$x,erupt_dens$y,ulim=erupt_dens$y/5, type="l",fill="lightgray",interval=TRUE) lines(erupt_dens) Jim On Fri, Dec 2, 2016 at 9:36 PM, Jim Lemon wrote: > In o

Re: [R] Plotting Confidence Intervals into a density plot

2016-12-02 Thread Jim Lemon
In order to display a polygon, you need x/y pairs for each point. If you just want a rectangle, you only need four x/y pairs, e.g.: plot(0,xlim=x(2.44,2.57),ylim=c(0,1),type="n") polygon(c(2.44,2.57,2.57,2.44),c(0,0,1,1),col="lightgray") Now if you have a series of x values and want to display a

Re: [R] Plotting Confidence Intervals into a density plot

2016-12-02 Thread Elysa Mitova
Thank you, this seems to work, but it is not exactly what I need (it indeed looks great, but a bit beyond my understanding) I just need a shaded area between 2.44 to 2.57 along the x-axis - a polygon inserted into my density plot (and not a confidence line along a scatter plot like your suggeste

Re: [R] Plotting Confidence Intervals into a density plot

2016-12-02 Thread Jim Lemon
Hi Elysa, I think you are going a bit off course in your example. Try this and see if it is close to what you want: data<-rnorm(100)+runif(100,0,15) smu_data<-supsmu(1:100,data) rollfun<-function(x,window=10,FUN=sd) { xlen<-length(x) xout<-NA forward<-window%/%2 backward<-window-forward for(i

Re: [R] Plotting Confidence Intervals into a density plot

2016-12-02 Thread Elysa Mitova
Hi, thank you! I've constructed the upper and lower bounds with a <- 2.505766 s <- 0.7789832 n <- 607 error <- qnorm(0.975)*s/sqrt(n) left <- a-error right <- a+error left right Now, I have the numbers I need, but I have no idea how to plot them. I was thinking of using a polygon, but som

Re: [R] Plotting Confidence Intervals into a density plot

2016-12-01 Thread David Winsemius
> On Dec 1, 2016, at 12:10 PM, Elysa Mitova wrote: > > Hi, > > I am desperately looking for a way to plot confidence intervals into a > density plot of only one variable (not a scatter plot etc.) > > Have you any advice how to do this? > > I've only found manual ways to do with "abline", but

[R] Plotting Confidence Intervals into a density plot

2016-12-01 Thread Elysa Mitova
Hi, I am desperately looking for a way to plot confidence intervals into a density plot of only one variable (not a scatter plot etc.) Have you any advice how to do this? I've only found manual ways to do with "abline", but this is a rather bothersome method and only works with ggplot (and not g

Re: [R] Plotting Confidence Intervals

2015-05-03 Thread Steve Taylor
Have you tried: library(effects) plot(allEffects(ines),ylim=c(460,550)) -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Andre Roldao Sent: Saturday, 2 May 2015 2:50p To: r-help@r-project.org Subject: [R] Plotting Confidence Intervals Hi Guys, It&#

Re: [R] Plotting Confidence Intervals

2015-05-03 Thread Jim Lemon
;> d >> ________ >> Feladó: R-help [r-help-boun...@r-project.org] ; meghatalmazó: Andre >> Roldao [andre.rafael.rol...@gmail.com] >> Küldve: 2015. május 2. 4:49 >> To: r-help@r-project.org >> Tárgy: [R] Plotting Confidence Int

Re: [R] Plotting Confidence Intervals

2015-05-02 Thread Andre Roldao
__ > Feladó: R-help [r-help-boun...@r-project.org] ; meghatalmazó: Andre > Roldao [andre.rafael.rol...@gmail.com] > Küldve: 2015. május 2. 4:49 > To: r-help@r-project.org > Tárgy: [R] Plotting Confidence Intervals > > Hi Guys, > > It's the first time i use R-Help

Re: [R] Plotting Confidence Intervals

2015-05-02 Thread Kehl Dániel
rg] ; meghatalmazó: Andre Roldao [andre.rafael.rol...@gmail.com] Küldve: 2015. május 2. 4:49 To: r-help@r-project.org Tárgy: [R] Plotting Confidence Intervals Hi Guys, It's the first time i use R-Help and i hope you can help me. How can i plot conffidence intervals? with the data bellow: #

[R] Plotting Confidence Intervals

2015-05-02 Thread Andre Roldao
Hi Guys, It's the first time i use R-Help and i hope you can help me. How can i plot conffidence intervals? with the data bellow: #Package Austria library(car) #head(States) States1=data.frame(States) ines=lm(SATM ~ log2(pop) + SATV , data=States1) summary(ines) NJ=as.data.frame(States["NJ",c(

Re: [R] Plotting Confidence Intervals with a proiri calculated Intervals

2012-01-23 Thread R. Michael Weylandt
Would you like to do this plot in base graphics or in ggplot2? If the latter, I'd suggest you look over Hadley's online documentation and the archives of the dedicated ggplot2 mailing list. If you want to do it in base graphics, you'll have to say what your data set looks like and what sort of gra

Re: [R] Plotting Confidence Intervals with a proiri calculated Intervals

2012-01-23 Thread David Winsemius
On Jan 23, 2012, at 7:37 PM, klakoh wrote: I have already obtained my confidence intervals from a bootstrapping procedure and now I want to plot the estimates and the confidence intervals similar to the plots obtained when the geom_smooth function is used in ggplot2. Thanks You should look

[R] Plotting Confidence Intervals with a proiri calculated Intervals

2012-01-23 Thread klakoh
I have already obtained my confidence intervals from a bootstrapping procedure and now I want to plot the estimates and the confidence intervals similar to the plots obtained when the geom_smooth function is used in ggplot2. Thanks -- View this message in context: http://r.789695.n4.nabble.com/Pl

[R] Plotting confidence Intervals

2011-05-10 Thread Shubham Saxena
Hey guys, Suppose i have X ~ LN(0,1) A = rlnorm(5) How can I plot the 95% Confidence Interval of the ecdf of A in R? Thank You [[alternative HTML version deleted]] __ R-help@r-project.org mailin

Re: [R] Plotting confidence intervals of two response on same graph (panel).

2010-06-17 Thread Kim Jung Hwa
I actually need to plot all of my confidence interval for x and y axis but it seems error.crosses only plot the common ones. But thanks for suggesting error.crosses. Please let me know if I can specify some option in eror.crosses to implement that. Any idea about how to plot all confidence interva

Re: [R] Plotting confidence intervals of two response on same graph (panel).

2010-06-17 Thread William Revelle
Kim, It is possible that error.crosses in the psych package will do what you want. Bill At 9:25 AM -0400 6/17/10, Kim Jung Hwa wrote: Hello! I would like to draw a graph like the following: http://www.optics.rochester.edu/workgroups/cml/opt307/spr04/pavel/plot_small.jpg Aim is to plot confi

[R] Plotting confidence intervals of two response on same graph (panel).

2010-06-17 Thread Kim Jung Hwa
Hello! I would like to draw a graph like the following: http://www.optics.rochester.edu/workgroups/cml/opt307/spr04/pavel/plot_small.jpg Aim is to plot confidence intervals of treatments for X(=response1) and Y(=response2) axis simultaneously to visualize aggreement of confidence interval for two

Re: [R] plotting confidence intervals

2009-07-15 Thread Greg Snow
To: R help > Subject: [R] plotting confidence intervals > > Hi R People: > > If I have a fitted values from a model, how do I plot the > (1-alpha)100% confidence intervals along with the fitted values, > please? > > Also, if the intervals are "shaded" gray, th

Re: [R] plotting confidence intervals

2009-07-15 Thread Jim Lemon
Erin Hodgess wrote: Hi R People: If I have a fitted values from a model, how do I plot the (1-alpha)100% confidence intervals along with the fitted values, please? Also, if the intervals are "shaded" gray, that would be nice too, please? I check confint, but that doesn't seem to do what I want

Re: [R] plotting confidence intervals

2009-07-14 Thread Daniel Malter
Betreff: [R] plotting confidence intervals Hi R People: If I have a fitted values from a model, how do I plot the (1-alpha)100% confidence intervals along with the fitted values, please? Also, if the intervals are "shaded" gray, that would be nice too, please? I check confint, but th

Re: [R] plotting confidence intervals

2009-07-14 Thread Daniel Malter
dex HTH, Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Im Auftrag von Erin Hodgess Gesendet: Tuesday, July 14, 2009 11:40 AM An: R help Betreff: [R] plotti

Re: [R] plotting confidence intervals

2009-07-14 Thread Marc Schwartz
On Jul 14, 2009, at 10:40 AM, Erin Hodgess wrote: Hi R People: If I have a fitted values from a model, how do I plot the (1-alpha)100% confidence intervals along with the fitted values, please? Also, if the intervals are "shaded" gray, that would be nice too, please? I check confint, but

[R] plotting confidence intervals

2009-07-14 Thread Erin Hodgess
Hi R People: If I have a fitted values from a model, how do I plot the (1-alpha)100% confidence intervals along with the fitted values, please? Also, if the intervals are "shaded" gray, that would be nice too, please? I check confint, but that doesn't seem to do what I want. Thanks in advance,

Re: [R] plotting confidence intervals of regression line

2007-11-20 Thread Eik Vettorazzi
you can use the newdata statement in the predict function, as in n<-50 x<-sample(40:70,n,rep=T) y<-.7*x+rnorm(n,sd=5) plot(x,y,xlim=c(20,90),ylim=c(0,80)) mylm<-lm(y~x) abline(mylm,col="red") newx<-seq(20,90) prd<-predict(mylm,newdata=data.frame(x=newx),interval = c("confidence"), level = 0.90,ty

[R] plotting confidence intervals of regression line

2007-11-20 Thread Tim Holland
Hello, I am trying to generate a confidence interval (90 or 95%) of a regression line. This is primarily just for illustration on a scatter plot (i.e. I am trying to make this http://www.ast.cam.ac.uk/~rgm/scratch/statsbook/graphics/anima4.gif). I have been trying to use the predict.lm function,