That method uses smean.cl.normal from the Hmisc package and if you
read the documentation for that you'll see that it is displaying the
"standard" error.
> 2. I would "prefer" to remove the grey background and replace it with
> a white one with a black border around the entire graphic.
theme_set(theme_bw())
> 3. as.numeric(Group) refers to two discrete groups. The mean of each
> group is connected via a bright blue line. Many publications do not
> allow color. Any way to make this line black instead of blue?
stat_summary(fun.y="mean",
geom="smooth", se=FALSE, colour = "black")
> 4. When I call scale_y_continuous(limits = c(0,200), name = "Total
> Rating"), my assumption was that it would scale the graph between
> those values. It does do this, sort of, but it leaves a small buffer
> above 200 and below zero. Any way to remove this?
It's usually a good idea to leave this buffer in, but if you really
want to get rid of it, do this:
+ scale_y_continuous("Total rating", limits = c(0, 200), expand = c(0, 0))
Regards,
Hadley
That method uses smean.cl.normal from the Hmisc package and if you
read the documentation for that you'll see that it is displaying the
"standard" error.
theme_set(theme_bw())
> 2. I would "prefer" to remove the grey background and replace it with
> a white one with a black border around the entire graphic.
>> That method uses smean.cl.normal from the Hmisc package and if you
>> read the documentation for that you'll see that it is displaying the
>> "standard" error.
>
> The documentation does say that, but my graph is definitely displaying the
> standard deviation, not the standard error. I can post a picture if it
> helps, but I'm entirely positive that this is the case.
Yes, it would be really helpful.
>> > 2. I would "prefer" to remove the grey background and replace it with
>> > a white one with a black border around the entire graphic.
>>
>> theme_set(theme_bw())
>
> This works, but when I re-render the image, it moves the label for the
> y-axis to the bottom of the graphic (It says "otal rating" on the bottom of
> the screen now). I've tested and it looks like this is being caused by the
> theme call, as it has the same behavior if I remove the expand call and the
> colour change. Any idea why this would move the label only on the Y-axis?
Yes, that's a bug in the current version. Try
theme_set(theme_bw())
theme_update(axis.title.y =
theme_text(size = 12, angle = 90, vjust = 0.5))
Hadley
By default you get 95% confidence intervals - i.e. 7.74 * 1.96 which
seems about what you get on the graph. It would also be helpful if
you could include your data so I can double-check.
Hadley
theme_set(theme_bw())
theme_update(axis.title.y =
theme_text(size = 12, angle = 90, vjust = 0.5))
#Error bars for Atotal
ggplot(math,
aes( as.numeric(Group), Atotal) ) +
stat_summary(fun.y="mean",
geom="point", colour="black") +
stat_summary(fun.y="mean",
geom="smooth", colour="black") +
stat_summary(fun.data="mean_cl_normal", conf.int=0.68,
geom="errorbar", se=FALSE, width=.2) + ##Or true
scale_x_discrete(limits=c("No Pauses", "Pauses"), name="Participant Group") +
scale_y_continuous(name ="Total Rating", limits = c(0,200), expand=c(0,0))
ggsave(file = "math/Atotal.eps")
Yes, it is. I'll look into it.
Hadley
Ok, will be fixed in the next version (which I'm aiming to release
tomorrow). You can also use mult = 1.
Hadley
Check out ?smean.cl.normal
Hadley