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
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
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
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
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
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
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
Rolf,
Your example shows two plots with one above the other.
If that is what you want, then a solution like the one Jeff provided using
facet_grid() to separate data based on the parameter value. It also scales
up if you add additional sets of data for gamma and delta up to a point.
An alterna
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 ~ .) +
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
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
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
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
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
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
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
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
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
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
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
> 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
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's the
Hi Andre,
Perhaps you want something like this:
plot(c(p_conf[1],p_conf1[1],p_pred2[1],p_pred3[1]),xaxt="n",
xlab="Model",ylab="Estimate")
axis(1,at=1:4,labels=c("p_conf","p_conf1","p_pred2","p_pred3"))
library(plotrix)
dispersion(1:4,c(p_conf[1],p_conf1[1],p_pred2[1],p_pred3[1]),
ulim=c(p_conf[
Hi Kehl,
First i would like to thank you for the support.
to respond your question i want rather the 4 intervals with the labels, but
another one with the 4 bars with the intervals, it was fantastic!
Thank you again!
2015-05-02 9:24 GMT+01:00 Kehl Dániel :
> Hi Andre,
>
> I think you'll have t
Hi Andre,
I think you'll have to give some more information about what you want to see on
your plot. The 4 intervals with labels? A bar with an interval maybe? Four bars
with the intervals? Only two showing differences between conf and pred
intervals?
Also you do miss a 1 here I guess:
p_conf
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
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
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
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
I believe there is a set of options in the ggplot2 package that will create a
plot and add the confidence region to it, you will need to look at the
documentation for ggplot2, I don't know the details (have not made it that far
on my to do list, not anything against the package).
--
Gregory (G
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
Erin and all, I lavishly used the factor 2 for the confidence intervals. Of
course this should be approximately 1.96 for the 95% CI under the assumption
of normality. So just adjust the factor accordingly or according to your
desired alpha level when you create the CI data frame. Otherwise, my exam
Hi Erin, have a look at the following example:
#Simulate data
n=1000
x1=rnorm(n,0,0.05)
x2=rnorm(n,0,0.1)
x3=rnorm(n,0,0.02)
e=rnorm(n,0,1)
y=x1+2*x2-0.5*x3+e
#Run regression
reg=lm(y~x1+x2+x3)
#Regression output
summary(reg)$coef
#Create dataset with confidence intervals and an index
CI=data.
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
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
35 matches
Mail list logo